Good experiences (so far) with Components


Since most of this is complaints by its very nature, I wanted to quickly write and say how uneventful my Juce GUI use has been.

I needed to put a cursor on top of a waveform. I did it the simplest possible way I could think of - starting a thread to change the cursor position every XX milliseconds, then requesting a repaint of the old and new cursor positions if they’d changed.

Immediately, the program crashed, at a very clear point in Juce that basically says, “You need to lock the message queue before you do this”. Nice! And very logical, someone has to do some locking and I’m happy that it’s me and not something below the covers.

I locked the message queue… and it worked right the first time. I’d worried about flicker, but it was nice and clear (we’ll see how long that lasts as there’s more crap put on the screen, I’ve been intending to look into the Juce code to see if it’s double buffered…) I’d worried about CPU (I had at least made sure that I didn’t repaint if the effective cursor rectangle didn’t change) but that seems unaltered. I’d worried about tweaking the thread refresh rate, but it seemed to work at any period between 5 and 100ms…

So it all worked nicely more or less the first time. Aces!


why not using a Timer, measuring the time difference, and optimize the drawing itself. The cursor itself should be a child component which you can move, the underlying waveform-component should be buffered (with setBufferedToImage)… just an idea