-
Pl
chevron_right
Michael Calabrese: Pitivi Timeline Ruler | Standalone Beta Progress
news.movim.eu / PlanetGnome • 1 day ago • 1 minute
Hello GNOME, This is a progress report on the Pitivi Timeline Ruler Rust rewrite.
Progress
We are rewriting the Pitivi Ruler in Rust and gtk4 snapshot logic to improve performance and memory safety. At its current stage the ruler is being constructed as a standalone widget in a personal repo that can be found here:
GTK_DEBUG=interactive cargo run --example sandbox
Any feedback on the code is greatly appreciated!
Structure
I am structuring this around rendering a single interval of ticks between two major ticks once, then stamping that across the duration of the project, as seen in
draw_single_interval()
.
With the ticks stamped across the timeline I am then rendering a cache of Pango labels for the timestamps that are stamped across the visible window. I made the decision to use a BTreeMap for the cache for ease of iterating chronologically through the stamps and for dropping out-of-bounds keys. The logic for this cache handling primarily lives in
update_label_cache()
.
After some feedback from members of the video editing community, I made the decision that minor ticks should always be clean multiples of frames in the time period. This logic is implemented in
calculate_minor_divisions()
.
Next Steps
The primary goal I am focusing on next is implementing the gesture handling, including click and drag actions. Once gestures are implemented I am going to begin moving a lot of the math to traits so that I can write a mock_env and a live_env to start writing some unit testing.