Skip to content

Commit 660e778

Browse files
committed
insert event testing code
1 parent 5070076 commit 660e778

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

Source/Plugins/LfpDisplayNodeAlpha/LfpDisplayCanvas.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2615,7 +2615,6 @@ void LfpDisplay::rebuildDrawableChannelsList()
26152615
}
26162616
else // skip some channels
26172617
{
2618-
std::cout << "displaySkipAmt = " << displaySkipAmt << std::endl;
26192618
if (i % (displaySkipAmt) == 0) // add these channels
26202619
{
26212620
channels[i]->setHidden(false);
@@ -2951,7 +2950,7 @@ void LfpChannelDisplay::pxPaint()
29512950
{
29522951
if (rawEventState & (1 << ev_ch)) // events are representet by a bit code, so we have to extract the individual bits with a mask
29532952
{
2954-
//std::cout << "Drawing event." << std::endl;
2953+
// std::cout << "Drawing event." << std::endl;
29552954
Colour currentcolor=display->channelColours[ev_ch*2];
29562955

29572956
for (int k=jfrom_wholechannel; k<=jto_wholechannel; k++) // draw line

Source/Processors/FileReader/FileReader.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ void FileReader::updateSettings()
229229
}
230230
}
231231

232-
233232
void FileReader::process (AudioSampleBuffer& buffer)
234233
{
235234
const int samplesNeededPerBuffer = int (float (buffer.getNumSamples()) * (getDefaultSampleRate() / 44100.0f));
@@ -282,10 +281,41 @@ void FileReader::process (AudioSampleBuffer& buffer)
282281
timestamp += samplesNeededPerBuffer;
283282
setTimestampAndSamples(timestamp, samplesNeededPerBuffer);
284283

284+
// TODO: (kelly) clean this up, testing event display
285+
{
286+
static bool flag = false;
287+
// if (counter == 0)
288+
if (counter % 3 == 0)
289+
{
290+
flag = !flag;
291+
// TextEventPtr textEvent = TextEvent::createTextEvent(getEventChannel(0), timestamp, "Test Event");
292+
// TextEvent::createTextEvent
293+
// addEvent(0, textEvent, 0);
294+
uint8 value = 1;
295+
std::cout << "\n\nSending event with value " << (int)value << std::endl;
296+
TTLEventPtr ttlEvent = TTLEvent::createTTLEvent(getEventChannel(0), timestamp, &value, sizeof(uint8), 0);
297+
addEvent(0, ttlEvent, 0);
298+
299+
value = 0;
300+
std::cout << "Sending event with value " << (int) value << std::endl;
301+
TTLEventPtr ttlEvent2 = TTLEvent::createTTLEvent(getEventChannel(0), timestamp + 10, &value, sizeof(uint8), 0);
302+
addEvent(0, ttlEvent2, 100);
303+
}
304+
counter++;
305+
}
306+
// END_TODO
307+
285308
bufferCacheWindow += 1;
286309
bufferCacheWindow %= BUFFER_WINDOW_CACHE_SIZE;
287310
}
288311

312+
void FileReader::getDefaultEventInfo(Array<DefaultEventInfo> &events, int subproc) const
313+
{
314+
events.clear();
315+
316+
events.add(DefaultEventInfo(EventChannel::TTL, 1, sizeof(uint8), 44100));
317+
}
318+
289319

290320
void FileReader::setParameter (int parameterIndex, float newValue)
291321
{

Source/Processors/FileReader/FileReader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class FileReader : public GenericProcessor
6868

6969
bool isFileSupported (const String& filename) const;
7070
bool isFileExtensionSupported (const String& ext) const;
71+
72+
virtual void getDefaultEventInfo(Array<DefaultEventInfo>& events, int subproc) const override;
7173

7274

7375
private:

0 commit comments

Comments
 (0)