Skip to content

Commit f84d120

Browse files
committed
Include full word on TTL messages
1 parent da2aa37 commit f84d120

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

Source/Processors/SourceNode/SourceNode.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ SourceNode::SourceNode(const String& name_)
6767
}
6868

6969
numEventChannels = dataThread->getNumEventChannels();
70-
eventChannelState = new int[numEventChannels];
70+
//eventChannelState = new int[numEventChannels];
71+
eventChannelState.malloc(numEventChannels);
7172
for (int i = 0; i < numEventChannels; i++)
7273
{
7374
eventChannelState[i] = 0;
@@ -77,15 +78,16 @@ SourceNode::SourceNode(const String& name_)
7778
else
7879
{
7980
enabledState(false);
80-
eventChannelState = 0;
81+
// eventChannelState = 0;
8182
numEventChannels = 0;
8283
}
8384

8485
// check for input source every few seconds
8586
startTimer(sourceCheckInterval);
8687

8788
timestamp = 0;
88-
eventCodeBuffer = new uint64[10000]; //10000 samples per buffer max?
89+
//eventCodeBuffer = new uint64[10000]; //10000 samples per buffer max?
90+
eventCodeBuffer.malloc(10000);
8991

9092

9193
}
@@ -100,8 +102,8 @@ SourceNode::~SourceNode()
100102
}
101103

102104

103-
if (eventChannelState)
104-
delete[] eventChannelState;
105+
//if (eventChannelState)
106+
// delete[] eventChannelState;
105107
}
106108

107109
DataThread* SourceNode::getThread()
@@ -412,7 +414,9 @@ void SourceNode::process(AudioSampleBuffer& buffer,
412414
TTL, // eventType
413415
i, // sampleNum
414416
0, // eventID
415-
c // eventChannel
417+
c, // eventChannel
418+
8,
419+
(uint8*)(&eventCodeBuffer[i])
416420
);
417421
}
418422
else
@@ -426,7 +430,9 @@ void SourceNode::process(AudioSampleBuffer& buffer,
426430
TTL, // eventType
427431
i, // sampleNum
428432
1, // eventID
429-
c // eventChannel
433+
c, // eventChannel
434+
8,
435+
(uint8*)(&eventCodeBuffer[i])
430436
);
431437

432438

Source/Processors/SourceNode/SourceNode.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ class SourceNode : public GenericProcessor,
118118
DataBuffer* inputBuffer;
119119

120120
uint64 timestamp;
121-
uint64* eventCodeBuffer;
122-
int* eventChannelState;
121+
//uint64* eventCodeBuffer;
122+
//int* eventChannelState;
123+
HeapBlock<uint64> eventCodeBuffer;
124+
HeapBlock<int> eventChannelState;
123125

124126
int ttlState;
125127

0 commit comments

Comments
 (0)