Is this an optimal repaint strategy? What happens if i have 10 of these running with different positions in diferent bits of the screen?
class LfoPositionIndicator : public Timer, public Component
{
public:
LfoPositionIndicator(DuckPumpAudioProcessor & p): processor(p)
{
startTimerHz(60);
setInterceptsMouseClicks(false, false);
}
void timerCallback() override
{
x = roundToInt(float(getWidth()) * float(processor.getPhasorPosition()));
repaint(lastX, 0, 1, getHeight());
repaint(x, 0, 1, getHeight());
lastX = x;
}
void paint(Graphics & g) override
{
g.setColour(Colours::orange);
g.drawVerticalLine(x, 0.0f, float(getHeight()));
}