//! Render preview: pre-render a stretch of the timeline so playback over it reads //! frames instead of compositing them (`engine::render_cache`). One render at a time. use engine::render_cache; use serde_json::{json, Value}; use crate::parse::{session_end, session_fps}; use crate::server::{opt_bool, tri, Reply, Server, Tool}; use crate::tools::export::parse_range; pub fn tools() -> Vec { vec![Tool { name: "render_preview", description: "Pre-render part of the timeline into the render cache, so playback over it reads finished frames instead of compositing them: use it over heavy sections (stacked effects, titles over video, colour, speed, multicam) that drop frames live. `range` is \"all\" (the default, the whole timeline) or {from, to} as export takes it. The render runs in the background; project_status shows its progress and the cached ranges. Any edit inside a cached range drops that render, and playback composes live again there. `cancel: true` stops the render running now and removes its partial file. `clear: true` deletes every cached render file on disk (finished or half written) and says how many went; it is refused while a render is running. One render runs at a time. The sound is not rendered: the live mix always plays.", schema, run: render_preview, }] } fn schema() -> Value { json!({ "type": "object", "properties": { "range": { "type": ["string", "object"], "description": "\"all\" for the whole timeline (the default), or {\"from\": \"