Skip to content
Snippets Groups Projects
Commit 9ead4774 authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Fix event duplication when recording

parent e47ad7d7
No related branches found
No related tags found
No related merge requests found
......@@ -705,7 +705,7 @@ int GenericProcessor::processEventBuffer(MidiBuffer& events)
else
{
if (*dataptr == TTL && // a TTL event
if (isWritableEvent(*dataptr) && // a TTL event
getNodeId() < 900 && // not handled by a specialized processor (e.g. AudioNode))
*(dataptr+4) > 0) // that's flagged for saving
{
......
......@@ -28,6 +28,9 @@ enum ChannelType {HEADSTAGE_CHANNEL = 0, AUX_CHANNEL = 1, ADC_CHANNEL = 2, EVENT
ELECTRODE_CHANNEL = 4, MESSAGE_CHANNEL = 5
};
//defines which events are writable to files
#define isWritableEvent(ev) (((int)(ev) == GenericProcessor::TTL) || ((int)(ev) == GenericProcessor::MESSAGE) || ((int)(ev) == GenericProcessor::BINARY_MSG))
#include "../../../JuceLibraryCode/JuceHeader.h"
#include "../Editors/GenericEditor.h"
#include "../Parameter/Parameter.h"
......
......@@ -41,8 +41,6 @@
#define strParameter(i,v) if ((parameter.id == i) && (parameter.type == EngineParameter::STR)) \
v = parameter.strParam.value
#define isWritableEvent(ev) (ev == GenericProcessor::TTL) || (ev == GenericProcessor::MESSAGE) || (ev == GenericProcessor::BINARY_MSG)
struct SpikeRecordInfo
{
String name;
......
......@@ -421,7 +421,7 @@ void RecordNode::handleEvent(int eventType, MidiMessage& event, int samplePositi
{
if (isWritableEvent(eventType))
{
if (event.getRawData()+4 > 0) // saving flag > 0 (i.e., event has not already been processed)
if (*(event.getRawData()+4) > 0) // saving flag > 0 (i.e., event has not already been processed)
{
EVERY_ENGINE->writeEvent(eventType, event, samplePosition);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment