Phonations/Joker — pull request #281 by tlecomte (2014-10-11 17:40:06+00:00)
Title: Fix no vsync

Dear Martin,

I have moved to a different computer (a Windows laptop) and found that Joker was running way too fast... This came from the fact that V-sync was not enabled on this machine, so the paint events were happening faster than the screen refresh rate (actually twice as fast given the logic in PhGraphicView), but Joker uses the screen refresh rate to compute the time spent between these events to update the clock time.

This PR addresses this situation by using a QElapsedTimer to compute how much the internal clock should advance instead of using systematically a screen refresh period. A QElapsedTimer has all the characteristics that are needed : it is precise, monotonic and never overflow (on most systems).

This also has the advantage of handling dropped frames even in the case where V-sync is enabled. These dropped frames would cause the clock to run slower than expected.

I also took this PR as an opportunity to remove PhClock::tick as you suggested.

I hope you will like this change.

Best regards,

Timothée