Skip to main content

PreviewEngine

Trait PreviewEngine 

Source
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 slides(&self) -> Vec<SlideInfo> { ... }
    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§

Source

fn engine_version(&self) -> String

Version string sent in Ready.

Source

fn scenes(&self) -> Vec<SceneInfo>

Scenes with their first frame and length.

Source

fn markers(&self) -> Vec<MarkerInfo>

Markers of all scenes.

Source

fn metas(&self) -> Vec<(String, Meta)>

Meta of every scene (sent on Ready so the editor knows eases and tunables).

Source

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.

Source

fn pick(&mut self, frame: u32, x: f64, y: f64) -> Option<u32>

Hit-test at frame pixels (top-left origin, project size).

Source

fn tree(&mut self, frame: u32) -> Vec<NodeInfo>

Node tree of the scene at frame.

Source

fn inspect( &mut self, frame: u32, node: u32, ) -> Option<(Vec<SignalValue>, [f64; 8])>

Signal values and selection box (frame pixels) of a node.

Source

fn waveform(&mut self, buckets: usize) -> Option<Vec<f32>>

Audio peak envelope for the timeline, if the project has audio.

Provided Methods§

Source

fn audio_clips(&self) -> Vec<AudioClipInfo>

Sound effects, for the timeline bars.

Source

fn slides(&self) -> Vec<SlideInfo>

Stops for oxframe present.

Source

fn audio_pcm(&mut self) -> Option<(u32, Vec<i16>)>

Mixed preview audio: sample rate and mono s16le samples.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§