mirror of
https://codeberg.org/armin/trommelkiste.git
synced 2026-09-01 04:10:46 +02:00
Fix track signal indicator sometimes not showing for short samples
Use a latch pattern for trackActive: the audio thread sets it true whenever a voice is active, and the UI timer atomically reads and clears it via exchange(false). This eliminates the race where the flag was cleared at the start of every processBlock, causing the 30Hz timer to miss brief activations from short samples.
This commit is contained in:
parent
e1f36c8569
commit
2cded52eef
3 changed files with 3 additions and 5 deletions
|
|
@ -433,7 +433,7 @@ void TrommelkisteEditor::timerCallback()
|
|||
const double now = juce::Time::getMillisecondCounterHiRes() / 1000.0;
|
||||
for (int i = 0; i < NUM_TRACKS; ++i)
|
||||
{
|
||||
if (proc.trackActive[i])
|
||||
if (proc.trackActive[i].exchange(false))
|
||||
trackActivatedTime[i] = now;
|
||||
}
|
||||
repaint();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue