Hello JUCE Community,
I’m working on a project in JUCE and am at a crossroads regarding the UI update logic.
The concept is to color the keys blue when a sample is recorded onto them.
I’m deliberating between two approaches:
Should I use a timer to periodically check each key’s state and update the UI if a sample is recorded? This seems straightforward, but could be less efficient due to constant polling, especially if changes are sporadic.
Alternatively, would a callback mechanism be more effective, where the UI update is directly triggered by the event of a sample being recorded? This could be more efficient as updates occur only when necessary. However, I’m concerned about the complexity and ensuring thread safety.
I look forward to hearing your thoughts,
thank you!
Sol.