Skip to content

Honor snap settings in waveform: playhead snapping + shot-change toggle#11642

Merged
niksedk merged 1 commit into
mainfrom
fix/waveform-snap-honor-settings
Jun 15, 2026
Merged

Honor snap settings in waveform: playhead snapping + shot-change toggle#11642
niksedk merged 1 commit into
mainfrom
fix/waveform-snap-honor-settings

Conversation

@niksedk

@niksedk niksedk commented Jun 15, 2026

Copy link
Copy Markdown
Member

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:

  • Waveform single-click rounds the clicked position to the nearest frame before seeking/centering/pinning.
  • Next/previous frame stepping seeks to the previous/next frame boundary on the project frame grid, so stepping stays frame-aligned even when the playhead started off-grid.

Both are gated on Waveform.SnapToFrames and a valid frame rate; when off (or fps unavailable), behavior is unchanged — including mpv's native frame step. Extracted SetVideoPositionSeconds from MoveVideoPositionMs so 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.SnapToShotChanges was defined, shown in Settings, and saved/loaded, but never read by the waveform: AudioVisualizer.SnapToShotChanges was hardcoded to true and never assigned, so shot-change snapping was always on regardless of the checkbox. It now reads the setting directly (the same way SnapToFrames does), so the checkbox takes effect live. Shift-to-override is untouched.

🤖 Generated with Claude Code

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>
@niksedk niksedk merged commit e8a5c30 into main Jun 15, 2026
1 of 2 checks passed
@niksedk niksedk deleted the fix/waveform-snap-honor-settings branch June 15, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant