diff --git a/Source/Processors/SourceNode/SourceNode.cpp b/Source/Processors/SourceNode/SourceNode.cpp index 5f0e3947c88e1a96c7e7edc48dde8a3c175200ca..9d7a300f3cfd635d99cba503461d0542d300d5bd 100755 --- a/Source/Processors/SourceNode/SourceNode.cpp +++ b/Source/Processors/SourceNode/SourceNode.cpp @@ -67,7 +67,8 @@ SourceNode::SourceNode(const String& name_) } numEventChannels = dataThread->getNumEventChannels(); - eventChannelState = new int[numEventChannels]; + //eventChannelState = new int[numEventChannels]; + eventChannelState.malloc(numEventChannels); for (int i = 0; i < numEventChannels; i++) { eventChannelState[i] = 0; @@ -77,7 +78,7 @@ SourceNode::SourceNode(const String& name_) else { enabledState(false); - eventChannelState = 0; + // eventChannelState = 0; numEventChannels = 0; } @@ -85,7 +86,8 @@ SourceNode::SourceNode(const String& name_) startTimer(sourceCheckInterval); timestamp = 0; - eventCodeBuffer = new uint64[10000]; //10000 samples per buffer max? + //eventCodeBuffer = new uint64[10000]; //10000 samples per buffer max? + eventCodeBuffer.malloc(10000); } @@ -100,8 +102,8 @@ SourceNode::~SourceNode() } - if (eventChannelState) - delete[] eventChannelState; + //if (eventChannelState) + // delete[] eventChannelState; } DataThread* SourceNode::getThread() @@ -412,7 +414,9 @@ void SourceNode::process(AudioSampleBuffer& buffer, TTL, // eventType i, // sampleNum 0, // eventID - c // eventChannel + c, // eventChannel + 8, + (uint8*)(&eventCodeBuffer[i]) ); } else @@ -426,7 +430,9 @@ void SourceNode::process(AudioSampleBuffer& buffer, TTL, // eventType i, // sampleNum 1, // eventID - c // eventChannel + c, // eventChannel + 8, + (uint8*)(&eventCodeBuffer[i]) ); diff --git a/Source/Processors/SourceNode/SourceNode.h b/Source/Processors/SourceNode/SourceNode.h index 8a98cf74fe24c25b02d9ec0e0031a83cddc15908..8829c285797020fb3a8863c5118c9bc1f7354fd1 100755 --- a/Source/Processors/SourceNode/SourceNode.h +++ b/Source/Processors/SourceNode/SourceNode.h @@ -118,8 +118,10 @@ private: DataBuffer* inputBuffer; uint64 timestamp; - uint64* eventCodeBuffer; - int* eventChannelState; + //uint64* eventCodeBuffer; + //int* eventChannelState; + HeapBlock<uint64> eventCodeBuffer; + HeapBlock<int> eventChannelState; int ttlState;