This is my first post here! I just started using JUCE and I am liking it so far. I used to be a full-time Tracktion user way before I started programming, so it is cool to see under the hood.
I am working on an audio processing program that I eventually want to make into a VST. For now, I am just trying to do extremely simple audio stuff. I have figured out how to listen to the default audio input and detect peaks over a user-set threshold. I have an AudioIODeviceCallback that also multiple inherits from ActionBroadcaster; when it finds a peak it broadcasts an action back to the main component.
I would like to display a big red square during a peak, but revert to a different color when the audio isn’t peaking. But the red square needs to show for long enough to see it, so I want it to delay for a little bit after the peaking is over.
What is the best way to make my code display the red for a duration, say 100ms, before going back to blank? Naturally, I don’t want to tie the CPU up in the action listening method for that whole duration.