Skip to main content

Crate edit

Crate edit 

Source
Expand description

edit — the pure, serializable non-destructive edit model that powers the Screen recorder’s editor (milestone M-EDIT).

§The segment-list design

An EditProject is the serialized source of truth for one editing session. Following the design proven by Cap’s project::configuration, the edit is encoded as lists of lightweight value types, not a mutated copy of the media:

  • TimelineSegments — an ordered list of slices of the source recording. Trim adjusts a slice’s source_start / source_end; split replaces one slice with two adjacent ones; speed changes a slice’s timescale. The project’s video is the ordered concatenation of its segments.
  • ZoomSegments — cinematic punch-in regions on the project timeline, each a zoom amount at an ZoomMode target. At the render boundary (ED.16) each compiles to a keyframed transform.
  • BackgroundConfig / CursorConfig / CropRect / AspectRatio — the “cinematic framing” layer (wallpaper, padding, corner radius, shadow, cursor smoothing, crop/reframe).

Nothing here touches a GPU or a media pipeline. The renderer (wisp) and the encoder (media / GStreamer) consume this model at preview + export time, re-deriving every frame from the lists. That keeps editing non-destructive (the source file is never rewritten) and keeps this crate exhaustively unit-testable on any machine.

§Time model

Project time is frame-indexed at a fixed EditProject::project_fps. EditProject::source_time walks the segment list applying each segment’s timescale to map a project frame to the source frame the renderer should decode. See segment for the arithmetic.

Re-exports§

pub use clip::ClipRef;
pub use history::History;
pub use ops::EditError;
pub use ops::EditOp;
pub use ops::TrimEdge;
pub use project::DEFAULT_PROJECT_FPS;
pub use project::EditProject;
pub use project::SCHEMA_VERSION;
pub use segment::Frame;
pub use segment::TimelineSegment;
pub use style::AspectRatio;
pub use style::AutoZoomConfig;
pub use style::BackgroundConfig;
pub use style::BackgroundSource;
pub use style::CropRect;
pub use style::CursorConfig;
pub use telemetry::ClickEvent;
pub use telemetry::CursorSample;
pub use zoom::EditEase;
pub use zoom::ZoomId;
pub use zoom::ZoomMode;
pub use zoom::ZoomSegment;

Modules§

clip
Reference to the source recording an EditProject edits.
history
Undo / redo for the edit model.
ops
Edit operations and the invariants they preserve.
persist
Project persistence — the .screenproj file format (ED.23 / M-EDIT).
project
EditProject — the top-level, serializable edit document and the project↔source frame mapping built on top of the segment list.
segment
Timeline segments — the ordered list that encodes trim, split, and speed, plus the project↔source frame arithmetic.
style
The cinematic framing layer — background, cursor, crop, and aspect.
telemetry
Click telemetry → auto-zoom regions (ED.17 / M-EDIT).
zoom
Zoom regions — cinematic punch-ins on the project timeline.
zoom_anim
The zoom engine — a ZoomSegment as a pure function of the frame.