Skip to main content

Session

vv_session::Session is an open document without any UI: the Project, its History, where it is saved, and the background jobs working on it. The editor window and the headless MCP server both drive the same type, so import, relink, export and editing behave identically in both.

session-hosts.png

Hosts

HostHow it holds the Session
Editor windowVenturiApp owns it and calls tick() every frame (project_io.rs). Its waker requests an egui repaint.
MCP editor hostA host thread of its own (vv-app/src/mcp_host.rs). Between two frames the Session sits in a shared slot that the MCP thread can borrow; the UI checks it out for each frame. Calls are answered even when the window is hidden and Wayland sends no frames.
Headless MCPvv-app mcp runs vv_mcp::run_headless, which owns the Session and wakes on its inbox.

State

Field / APIPurpose
project, historyPublic so callers can borrow them separately. Every change goes through the history, which is what tells a saved project from a modified one.
has_unsaved_changesHistory generation ≠ saved generation.
epochBumped whenever the project is replaced (open, new), since a new history restarts its generation at 0.
ChangeMark(epoch, generation): equal marks mean nothing changed. finish_save uses it to mark a background save as clean only if nothing changed meanwhile.
timeline_revisionA hash of one timeline's content, recomputed only after the project changed. It changes with edits to that timeline, not with edits elsewhere.
sync_timeline_mediaKeeps the media-pool entry of a timeline used as a compound clip in step with its content, once per history change.
complete_legacy_mediaFills media fields that older project files lack, by reading the files when the project is opened.