pub trait PreviewEngine: FrameSource {
// Required methods
fn engine_version(&self) -> String;
fn scenes(&self) -> Vec<SceneInfo>;
fn markers(&self) -> Vec<MarkerInfo>;
fn metas(&self) -> Vec<(String, Meta)>;
fn edit(&mut self, edit: MetaEdit) -> Result<Vec<(String, Meta)>, String>;
fn pick(&mut self, frame: u32, x: f64, y: f64) -> Option<u32>;
fn tree(&mut self, frame: u32) -> Vec<NodeInfo>;
fn inspect(
&mut self,
frame: u32,
node: u32,
) -> Option<(Vec<SignalValue>, [f64; 8])>;
fn waveform(&mut self, buckets: usize) -> Option<Vec<f32>>;
// Provided methods
fn audio_clips(&self) -> Vec<AudioClipInfo> { ... }
fn audio_pcm(&mut self) -> Option<(u32, Vec<i16>)> { ... }
}Expand description
What the preview needs from an engine, on top of drawing frames
(FrameSource). Implemented by oxframe::PreviewAdapter.
Required Methods§
Sourcefn engine_version(&self) -> String
fn engine_version(&self) -> String
Version string sent in Ready.
Sourcefn markers(&self) -> Vec<MarkerInfo>
fn markers(&self) -> Vec<MarkerInfo>
Markers of all scenes.
Sourcefn metas(&self) -> Vec<(String, Meta)>
fn metas(&self) -> Vec<(String, Meta)>
Meta of every scene (sent on Ready so the editor knows eases and
tunables).
Sourcefn edit(&mut self, edit: MetaEdit) -> Result<Vec<(String, Meta)>, String>
fn edit(&mut self, edit: MetaEdit) -> Result<Vec<(String, Meta)>, String>
Applies an edit, re-simulates, persists the meta; returns changed
metas as (scene, meta).
§Errors
A message for the editor if the edit is invalid or saving failed.
Sourcefn pick(&mut self, frame: u32, x: f64, y: f64) -> Option<u32>
fn pick(&mut self, frame: u32, x: f64, y: f64) -> Option<u32>
Hit-test at frame pixels (top-left origin, project size).
Provided Methods§
Sourcefn audio_clips(&self) -> Vec<AudioClipInfo>
fn audio_clips(&self) -> Vec<AudioClipInfo>
Sound effects, for the timeline bars.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".