Module app

Source
Expand description

The application: owns the project, undo stack, settings, player, dockable layout and wires the panels together. Non-blocking windows (Settings, Retime, Export, Save Template, Save Profile, export/convert progress) are plain egui::Windows โ€” the editor stays usable while they are open. Also executes MCP tool calls against the live project (one undo step per mutating call).

Structsยง

App
Compress ๐Ÿ”’
Compressโ€ฆ window state: what to shrink, how hard, and where the result goes.
LibPreview ๐Ÿ”’
The libraryโ€™s own preview player: a file, its own decoder/audio pipeline, and the duration/fps a transport needs (an assetโ€™s own probed values, since this project is a synthetic single-clip one).
McpJob ๐Ÿ”’
A blocking MCP tool job (export.video / media.convert): the reply is sent when the job finishes.

Enumsยง

ExportKind ๐Ÿ”’

Constantsยง

LAYOUT_STEP ๐Ÿ”’
Marker in the undo stack for โ€œa pane was dragged somewhere elseโ€. The arrangement itself lives in Layoutโ€™s own (much shorter) history โ€” this only keeps Ctrl+Z stepping back in the right order. ponytail: once the layout history has scrolled past its 20 entries the marker undoes nothing; deepen the layout stack if that ever bites.
MEDIA_EXTS ๐Ÿ”’
MUTATING_TOOLS ๐Ÿ”’
Tools whose success means โ€œone undo step + after_editโ€ (media.import pushes its own undo).
PROJECT_EXT ๐Ÿ”’
STOCK ๐Ÿ”’
The embedded stock picture, already decoded: assets/bubble.webp converted once to raw RGBA at card size, because nothing in the binary can decode a webp (no image crate, and ffmpeg may be missing).
STOCK_H ๐Ÿ”’
STOCK_W ๐Ÿ”’

Functionsยง

GetCursorPosโš 
add_mask ๐Ÿ”’
Give the clipโ€™s last effect a mask, or the clip itself when it has no effects. False = there is one already, or the clip is audio (a mask shapes pixels, and audio has none).
anim_of ๐Ÿ”’
The animated property name of a clip: inspector labels or โ€œ: โ€.
apply_clip_fields ๐Ÿ”’
Apply clip.set fields to a clip (everything except speed/reverse, which the caller routes through Project::set_speed so neighbour collisions are respected).
apply_mask_fields ๐Ÿ”’
arg_bool ๐Ÿ”’
arg_f64 ๐Ÿ”’
arg_ids ๐Ÿ”’
arg_str ๐Ÿ”’
arg_u64 ๐Ÿ”’
base64 ๐Ÿ”’
Standard base64 (RFC 4648, with padding) โ€” for the render.frame PNG data url. Tool path, not hot.
clamp_canvas ๐Ÿ”’
preview_max_width applied to a canvas size, keeping the aspect ratio. Must match Player::set_canvas, or the GPU renders at a different shape than the player decodes at.
color_arg ๐Ÿ”’
converted_path ๐Ÿ”’
Where โ€œConvert Toโ€ฆโ€ writes: <stem>_converted.<ext> next to the source, uniquified so a convert can never overwrite the source itself or a file already on disk (possibly one the timeline is using).
effect_thumb_key ๐Ÿ”’
Cache key of one effect thumbnail: kind, source image and size. Changing the stock image (or the grid size) invalidates every thumbnail; two different effects never share a key.
effect_thumb_source ๐Ÿ”’
The picture the effect thumbnails are rendered from: the userโ€™s stock image, else the embedded one.
frame_render_size ๐Ÿ”’
Render size for an image export: downscales are rendered straight at the target (the compositorโ€™s Scaler does the filtering), upscales are rendered at project size and enlarged by ffmpeg with the chosen resize flag โ€” rendering a 4K frame from a 1080p timeline gains nothing but time.
guarded ๐Ÿ”’
Run something that may panic (GPU driver, pre-render, a panel widget) without taking the editor down โ€” same policy as the decoder threads. None = it panicked. ponytail: the panic message goes to the default hook (stderr); the caller toasts and degrades.
job_window ๐Ÿ”’
Non-blocking progress window for background jobs (conversions, downloads): one row per job with a progress bar and Cancel. Draws nothing when there are no jobs.
mask_shape ๐Ÿ”’
mask_slot ๐Ÿ”’
The mask slot of a clip, or of one of its effects (effect = index in the effect stack).
node_kind ๐Ÿ”’
โ€œBlurโ€ / โ€œColorโ€ / โ€œBlendโ€ / โ€œCombineโ€ / โ€œMergeโ€ / โ€œMatteโ€ / โ€œMaskโ€ / โ€œTextโ€ / โ€œInputโ€ โ†’ a node kind.
parse_ease ๐Ÿ”’
โ€œLinearโ€ | โ€œEaseInโ€ | โ€ฆ | โ€œcubic-bezier(x1,y1,x2,y2)โ€
preview_canvas ๐Ÿ”’
Preview render size for a pane of canvas px at quality percent (25..100). Zero stays zero (nothing to render), and the aspect ratio is kept.
push_undo_json ๐Ÿ”’
Push an undo snapshot (capped) and clear the redo history.
relocate_assets ๐Ÿ”’
Moved/renamed sources: re-point assets to project_dir/<file name> when that exists (a silent black preview is the alternative); returns the paths that are still missing.
req ๐Ÿ”’
scrub_time ๐Ÿ”’
Time a library preview scrub-bar click/drag at fractional position frac (0..1 across the bar, unclamped so a drag past either end still reads as 0 or duration) seeks to.
step_time ๐Ÿ”’
Time the library previewโ€™s โ€œstep back/forward one frameโ€ buttons seek to.
timeline_is_empty ๐Ÿ”’
Nothing to save/export: the MAIN timeline is empty. Project::is_empty() only sees the open sequence, and main_stash is Some exactly while one is open โ€” so this is export_project().is_empty() without the clone.
write_image ๐Ÿ”’
Write one rendered frame as PNG / JPG / WebP through ffmpeg (raw RGBA on stdin), resizing to opts.size with opts.resize when the render came out at a different size.