Honor snap settings in waveform: playhead snapping + shot-change toggle#11642
Merged
Conversation
Two related "snap to frames"/"snap to shot changes" fixes for the waveform/video playhead: - Snap to frames now also applies when clicking the waveform and when stepping one frame back/forward. A waveform single-click rounds the playhead to the nearest frame, and next/previous-frame stepping lands on the project frame grid (so stepping stays frame-aligned even from an off-grid position). Both are gated on Waveform.SnapToFrames and a valid frame rate; otherwise behavior (incl. mpv native frame step) is unchanged. Extracted SetVideoPositionSeconds from MoveVideoPositionMs so stepping can seek to a sub-millisecond-accurate frame boundary. - "Snap to shot changes" setting (Waveform.SnapToShotChanges) was ignored: the AudioVisualizer property was hardcoded to true and never assigned from settings, so shot-change snapping was always on. It now reads the setting directly (like SnapToFrames), so the checkbox takes effect live. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Two related waveform snapping fixes so the snap settings are actually honored for the video playhead.
Snap to frames — waveform click & frame stepping
When Snap to frames is on, the playhead now lands on a frame boundary in two more places:
Both are gated on
Waveform.SnapToFramesand a valid frame rate; when off (or fps unavailable), behavior is unchanged — including mpv's native frame step. ExtractedSetVideoPositionSecondsfromMoveVideoPositionMsso stepping can seek to a sub-millisecond-accurate frame boundary (matters for rates like 29.97 where a frame isn't a whole ms).Snap to shot changes — setting was ignored
Waveform.SnapToShotChangeswas defined, shown in Settings, and saved/loaded, but never read by the waveform:AudioVisualizer.SnapToShotChangeswas hardcoded totrueand never assigned, so shot-change snapping was always on regardless of the checkbox. It now reads the setting directly (the same waySnapToFramesdoes), so the checkbox takes effect live. Shift-to-override is untouched.🤖 Generated with Claude Code