Skip to main content

Module editor_command

Module editor_command 

Source
Expand description

open_in_editor — the Record→Edit handoff command (ED.5 / M-EDIT).

Probes a finished recording’s metadata and builds a fresh, untouched [edit::EditProject] (one full-length real-time segment) for the editor UI to load. The heavy lifting — the edit model itself — lives in the pure edit crate; this is the thin Tauri wrapper.

Structs§

EditorExportState
Shared state for the editor export command (ED.22): a cooperative cancel flag plus a single-run guard so a second export can’t un-cancel the first and race the same output file.
ExportProgress 🔒
editor-export-progress event payload.
ExportRunGuard 🔒
RAII guard releasing the single-export slot when an export finishes (on any return path, including error/panic).
RecordingEntry
A recording in the library: its file path, display name, and whether a saved .screenproj sits beside it.

Functions§

edited_export_path
Derive the export output path for source + format: alongside the recordings folder, named <source-stem>-edited.<ext> so it never clobbers the source recording. Pure (no I/O) for testability.
editor_export
Export the edited project to an .mp4, streaming editor-export-progress events and honoring editor_export_cancel. Returns the output path.
editor_export_cancel
Request cancellation of an in-flight editor_export.
editor_load_project
Load an editor project from a .screenproj path.
editor_save_project
Save project to its .screenproj (beside the source recording); returns the written path.
fps_round 🔒
Round a reported (possibly fractional / NTSC) frame rate to a whole fps, clamped to at least 1. Non-finite / non-positive rates fall back to 30.
list_recordings
List the recordings in the user’s output folder (newest first). Returns an empty list if the folder can’t be read.
open_in_editor
Open a finished recording in the editor: probe it with gst-discoverer-1.0 and return a default [EditProject] (the recording, untouched, ready to edit).
project_from_metadata
Build a default editor project from a recording’s probed metadata.
recording_entries
Build library entries from a directory listing: each .mp4 becomes an entry, newest first (lexical-descending on the timestamped filename), flagged if a sibling .screenproj is present. Pure (no I/O).
screenproj_path
The .screenproj path for a source recording: the source path with its extension swapped, so the project file sits beside the recording. Pure.