Skip to main content

Module editor_edits

Module editor_edits 

Source
Expand description

Timeline editing — split + undo/redo (ED.11 / M-EDIT).

The razor on the bench and the trim bin. A split divides the clip under the playhead into two segments; undo/redo walk the trim bin so nothing is ever lost. The heavy lifting is the (proptest-verified) [edit::History] from ED.2 — this module is the thin layer that runs an edit against that history and syncs the result into the reactive project signal the timeline reads.

Split is duration-preserving, so the playhead clock needs no update. Duration-changing edits (ripple delete, trim) land next and use EditorPlayer::set_duration.

Functions§

add_zoom_at_cursor
Like add_zoom_default but punches in on the cursor at the playhead — the manual “zoom into the cursor” action. The target is the cursor’s position at at from the project’s captured track ([EditProject::zoom_cursor_target]), falling back to centre when no track was captured (so it degrades to the same result as add_zoom_default).
add_zoom_default
Add a default ~1.5 s zoom (1.6× centre) starting at project frame at, clamped to the timeline. No-op if the window would be empty. AddZoom assigns the region a fresh id.
apply_logged 🔒
Apply an op to the history, logging a rejection rather than silently dropping it. A stale-id / out-of-range op is a legitimate no-op (e.g. a RemoveZoom whose target was already removed across an undo), but a swallowed Err is invisible — surfacing it to the console keeps wiring regressions debuggable.
redo
Redo the last undone edit.
remove_zoom
Remove the zoom region with the given id.
resolve_history
Reuse the existing edit history if it belongs to current (same source clip), otherwise start fresh. A different source path means a different clip was opened, so the old undo stack no longer applies. Pure.
ripple_delete_selected
Ripple-delete the selected clip — remove it and close the gap (the downstream clips slide left; the timeline shortens).
run 🔒
Run edit against the project’s persistent history, then sync the project signal to the result. history carries the undo/redo stacks across calls.
set_aspect
Set the output aspect ratio (reframes the export canvas).
set_background
Set the background framing config (backdrop + padding / radius / shadow).
set_crop
Set the crop rectangle (a full-frame rect clears the crop). The op sanitizes the rect to a valid in-frame sub-rect.
set_cursor
Set the cursor styling config (size / smoothing / ripples / etc.).
set_speed
Set segment index’s playback speed (timescale). This changes the project length, so run re-syncs the backend clock via SetDuration.
set_zoom_ease
Retune the easing curve of the zoom with the given id (ED.13 dopesheet).
split_at
Split the clip under the playhead into two (the razor).
undo
Undo the last edit (the trim bin — nothing is lost).