Own update state / loop with JUCE audio (Question)

I have question about how can I manage own loops with JUCE audio?

I finish all GUI tutorials (except one (advanced layout techniques)) and want make something live. For example I want make text or some GUI parts moving when user click on it, or make dissapear it. How can I do that? Maybe Timer class?
I can imagine how I use own loop function, but don’t know if it is good idea because I want use audio for playback audio files.
I just quick read some tutorials for Audio, MIDI and VST, but I don’t know where is JUCE main loop or update function.

Have a look at the ComponentAnimator class.
Otherwise, yes a Timer would be the way to make GUI updates. Alternatively you could use a ChangeListener…

1 Like

Also a caveat, the Timer can be delayed, if CPU begins to struggle. So for your animation, if you use timer, don’t rely on that the periods between calls are always the same. Instead work against Time::getMillisecondCounter() (if you are old enough you remember when upgrading from an 8086 to 80386 when all games became unplayable :wink: )

Or you can use a HighResolutionTimer instead, that is more independent from the message loop (GUI workload). But then you cannot issue repaint directly but have to use the AsyncUpdater, so I would definitely start with a normal Timer…