In my app there’s a waveform display that shows the waveform of the MP3 that is being played. It goes without mentioning that the graphical update should never be interrupted and should be truly constant.
At the moment I use a Timer that calls repaint() every 20ms or so to update the waveform display. But the problem is that, since Timer messages are sent through the message queue, the waveform display starts to stop for a little time as soon as I (for instance) do some action with the mouse in my Treeview or some other scrolling components, because this will generate a lot of messages in the message queue that will be processed before my Timer callback.
How should I do it to keep the Waveform display updating at fixed intervals with no interruptions?