I’m new to Juce and relearning C++ in general. I do program C# daily. Apologies for the basic question, but I’m trying to understand how Juce works.
I’m following the Draw Audio Waveforms tutorial (https://docs.juce.com/master/tutorial_audio_thumbnail.html), and completed the exercise at the end of the tutorial to split the code so that the waveform and playback position is drawn by separate components.
The tutorial states that this would avoid unnecessary repaints for the thumbnail components:
Not only will this make the code easier to follow but, if done correctly, it will be much more efficient since we can avoid redrawing the waveform every frame.
However, if I put a breakpoint in the paint method of the waveform thumbnail component, I see that it still gets called.
By experimenting, I see that waveform component paint is not called if I turn off the timer that repaints playback position component. So the repaint of the waveform is caused by the playback position component that is positioned on top of it and has the same bounds.
I’ve observed the same behaviour in the solution code (AudioThumbnailTutorial_04.h).
My question: Does this mean that there are no performance gains from splitting the two, since they’re on top of each other?
If that makes a difference, I’m on macOS Big Sur and use CLion.