Repository navigation
fix: show older data instead of black while zooming - #566
Merged
Merged
Conversation
The spectrogram drew every column not decoded yet at a new zoom black: a centered zoom out collapsed to the playhead and refilled, a rolling zoom cleared its history, and a zoom out showed black beside the scaled canvas. Its missing columns are now transparent, over the canvas the new one replaced and a reserve of the ring's columns around the view, both placed at the times of their columns and drawn on workers. The waveform's per-channel lanes have no overview, so a zoom out while playing, drawn in tiles without a cache to hold it, showed empty lanes until the detail came. Tiles now hold the view as a cache does, and the detail the view has stands in where the overview cannot. Closes #542.
A session reset while a zoom was pending counted as the zoom's restart, so a track change or seek then kept the canvas before it and the ring's columns for the reserve, and a rolling view could show the track before under the next one. A reset now counts only when it is of the same track, with no seek or track change reported since the zoom was asked for, and in rolling mode starting at the playhead. A seek or track change drops both layers and the reserve being drawn, and the layers carry their track and validity in both modes. Sparse waveform envelopes were held from each point's middle to the next, half a point late, and left the first and last points' ends empty. Each point now covers the pixels whose middles are in its frames. The reserve is drawn at no more than the plot's logical width.
…nuations A zoom's restart was told from other resets by how far its start was from the playhead, so a restart whose first columns came late dropped the rolling history that only the backdrop and the reserve held. A reset now counts as the zoom's when its hop is the zoom asked for or one sent since, of the track the zoom was asked of, with the clock's epoch unchanged, so that any seek, however small, breaks it. The clock's track change dropped both layers, and their track was checked in rolling mode too, so a gapless or Repeat-One continuation, which the rolling canvas goes on across, lost the history they held. Rolling layers now follow the canvas's rule: they go on across a continuation, which also carries a pending zoom's track and epoch over, and only a reset that is not the zoom's drops them. Their times are counted from a stream origin that takes up the continuation's offset when a reset ends it, so that they stay where their times are.
A zoom's restart of a gapless successor can land after the successor's data and before the clock's new track. The reset cleared the pending continuation without the previous track's length, so the history the layers keep behind the playhead sat a track's length off. The restart now keeps the continuation pending and counts the session's times from the successor's start, at the previous track's end: its length, or where the restart's first column is at the playhead. The previous track plays on before that start until the clock changes tracks, and the handoff then has the playhead follow the successor's clock, as the restarted columns do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #542.
While zooming, both plots briefly drew the background ("no data") where older data could have stood in until the new zoom's data arrived. Frame sequences recorded from a GL window under a headless KWin (each rendered frame read back) showed where the black came from.
Where the black came from
Spectrogram
Waveform
What changed
Spectrogram (
SpectrogramItem)staleCanvasAlignmentLockedalready uses), so they follow the preview, scrolling and playback:Waveform (
WaveformEditorItem)Docs:
docs/SHORTCUTS.mddescribes what the plots now show while zooming.Tests
spectrogramZoomShowsOlderDataUntilTheNewArrives(centered and rolling): wheel steps out, data for them, a step in and back to 1. Each frame is checked through its scene-graph nodes (canvas, backdrop and reserve, with the canvas's alpha): no column that showed data shows the floor in the next frame, and the backdrop stands in wherever the canvas lacks columns. It fails without the reserve, and without the backdrop.waveformEditorPerChannelZoomShowsOlderDetailUntilTheNewArrives: in the per-channel view, a reset and a zoom in past the detail's points keep the wave in both lanes. It fails without the fix.waveformEditorZoomOutWhilePlayingHoldsTheTiledView: while playing in tiles, a zoom out is held with no empty lane columns, then shows when its detail arrives. It fails without the fix../scripts/run-tests.sh --ui-only: 102 of 102 passed, with no warnings. Rust is unchanged.Frame sequences
Recorded under a headless KWin (OpenGL), with each frame of the plot read back while zooming by wheel steps and Reset Zoom, in rolling and centered mode, against the fixture library. Counts are frames in which columns that showed data turned to the background, before → after:
(*) What remains is legitimately empty: zoomed out past where this run's rolling history begins (nothing was ever decoded there), the track's fade-out at its end, and single columns at the playhead.
Strips are not attached; they show only the fixture library.
Review round 1
spectrogramTrackChangeDuringAZoomShowsNothingOfTheTrackBefore(the clock arriving first, and the data arriving first).waveformEditorSparseDetailCoversEachPointsFrames(alternating loud and silent buckets, slices that start and end inside buckets).Review round 2
Zoom restarts are recognised by identity, with no distance thresholds. A reset counts as the zoom's restart when:
epochhasn't changed since then.A UI seek calls
holdAt(), which always bumps the epoch, so any seek counts as a break, however small. The 1.5 s and 0.75 s checks are gone, and the clock no longer drops the layers.Gapless and Repeat-One continuations keep the layers. Rolling layers follow the main canvas's rule: a data chunk with a new token and no reset continues the history. Only a reset that isn't the zoom's restart drops them. A continuation also carries a pending zoom's track (data side) and clock epoch (
continueGaplessLocked) over to the successor. Layer times are counted from a stream origin, which absorbsm_gaplessPositionOffsetwhenever a reset clears it, so the layers stay correctly placed after a later zoom restart. Centered layers still check the track.Tests:
spectrogramLateZoomDataKeepsTheRollingHistory: an advancing clock, with the zoom's data 2.5 s late.spectrogramSmallSeekDuringAZoomBreaksTheHistory: a 0.2 s seek while a zoom is pending.spectrogramGaplessContinuationKeepsTheRollingHistory: gapless and Repeat-One, with the clock first and the data first. History is kept, and placement is checked after a zoom restart of the successor.spectrogramTrackChangeDuringAZoomShowsNothingOfTheTrackBeforestill passes. All the new tests fail against round 1, and the placement check also fails without the stream origin.