Skip to content

Commit a88af15

Browse files
committed
Update lastScreenBufferIndex even if no samples are available
1 parent d172d6d commit a88af15

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

Plugins/LfpDisplayNode/LfpDisplay.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ void LfpDisplay::refresh()
439439
else if (fillto < fillfrom)
440440
{
441441
totalPixelsToFill = canvasSplit->screenBufferWidth - fillfrom + fillto;
442-
}
442+
}
443+
444+
//std::cout << fillfrom << " : " << fillto << " ::: " << "totalPixelsToFill: " << totalPixelsToFill << std::endl;
443445

444446
int topBorder = viewport->getViewPositionY();
445447
int bottomBorder = viewport->getViewHeight() + topBorder;

Plugins/LfpDisplayNode/LfpDisplayCanvas.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,13 +1144,16 @@ void LfpDisplaySplitter::updateScreenBuffer()
11441144

11451145
if (newSamples == 0)
11461146
{
1147-
// std::cout << "No new samples." << std::endl;
1147+
//std::cout << "No new samples." << std::endl;
1148+
lastScreenBufferIndex.set(channel, screenBufferIndex[channel]);
11481149
return;
11491150
}
11501151

11511152
if (newSamples < 0)
11521153
newSamples += displayBufferSize;
11531154

1155+
//if (channel == 0)
1156+
// std::cout << newSamples << " new samples." << std::endl;
11541157

11551158
// this number is crucial -- converting from samples to values (in px) for the screen buffer:
11561159
float ratio = sampleRate * timebase / float(displayWidth); // samples / pixel
@@ -1161,6 +1164,7 @@ void LfpDisplaySplitter::updateScreenBuffer()
11611164

11621165
// hold the last screen buffer index for comparison
11631166
lastScreenBufferIndex.set(channel, sbi);
1167+
//std::cout << "Setting channel " << channel << " lastScreenBufferIndex to " << lastScreenBufferIndex[channel] << std::endl;
11641168

11651169
float subSampleOffset = leftOverSamples[channel];
11661170

@@ -1463,7 +1467,7 @@ void LfpDisplaySplitter::updateScreenBuffer()
14631467
else
14641468
leftOverSamples.set(channel, subSampleOffset - 1.0f);
14651469

1466-
// std::cout << "Setting channel " << channel << " sbi to " << sbi << std::endl;
1470+
//std::cout << "Setting channel " << channel << " sbi to " << sbi << std::endl;
14671471
screenBufferIndex.set(channel, sbi);
14681472
displayBufferIndex.set(channel, newDisplayBufferIndex); // need to store this locally
14691473

Source/Processors/SourceNode/SourceNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void SourceNode::process(AudioBuffer<float>& buffer)
314314
copiedChannels,
315315
channelsToCopy);
316316

317-
// std::cout << getNodeId() << " " << streamIdx << " " << nSamples << std::endl;
317+
//std::cout << getNodeId() << " " << streamIdx << " " << nSamples << std::endl;
318318

319319
copiedChannels += channelsToCopy;
320320

0 commit comments

Comments
 (0)