New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Waveform Seekbar: now it slides #2138
Conversation
Update seekbar position for every pixel "elapsed", so update frequency is based on the seekbar width. TimeTracker was replaced by a custom solution.
Let's you change the render speed. Render for every X pixel elapsed
I don't like the approach.
My suggestion:
|
Hello, I didn't realize that it modifies the label update behavior as I was so focused on getting it to work with my non-existent GObject knowledge. :) The config option is more of a debug thing, so I can experiment with it without modifying code / restarting quodlibet (and stopping music in the process). So aside from the unnecessary label updates (which is clearly a bug) why is add_tick_callback a better option? The current solution calculates the exact time when a redraw is needed, also it recalculates the update frequency when you resize the window, so no unnecessary redraws. I didn't find any examples of add_tick_callback in the quodlibet source code, could you point me to some well designed implementations to get inspiration? |
ok, in the end if there is no value for the user it shouldn't be there.
I'm not sure what the exact differences are. It just looks easier since most of the update/timing stuff is handled by gtk this way, and you get called before each frame. If your time stuff works, there is no reason the switch I guess.
We've never done any animation in QL (there are some hacks in the osd plugin and the treeview DnD code, but that was coded before gtk+3.0 where this API didn't exist) |
Refactored the code to update the labels separately with the TimeTracker class, but it doesn't seem to affect the CPU usage much. The main performance bottleneck is that the whole waveform gets redrawn every time. My idea is to render the waveform only when needed (window resize, song change) and update the position with one of the following methods:
Examples: https://www.cairographics.org/operators/ The thing is: I don't know how performant Cairo compositing is. I'm going to run some isolated tests to see. If anybody can give me hints, please contact me. |
@knockoutMice Hi, are you still contributing on this ? |
Update seekbar position for every pixel "elapsed", so update frequency is based on the seekbar width. TimeTracker was replaced by a custom solution.