Skip to main content

TimelineCollection

Trait TimelineCollection 

Source
pub trait TimelineCollection: Send {
    // Required methods
    fn timelines(&self) -> Vec<TimelineInfo>;
    fn build(
        &self,
        id: &str,
        t: TimelineTime,
        target: Resolution,
        residency: RasterResidency,
        ctx: &mut dyn RenderContext,
    ) -> Option<RasterImage>;

    // Provided methods
    fn arrangement(&self, _id: &str) -> Option<Arrangement> { ... }
    fn render_audio(
        &self,
        _id: &str,
        _rate: u32,
        _channels: u16,
    ) -> Option<AudioBuffer> { ... }
    fn render_audio_window(
        &self,
        _id: &str,
        _start: f64,
        _duration: f64,
        _rate: u32,
        _channels: u16,
    ) -> Option<AudioBuffer> { ... }
}
Expand description

A collection of timelines exported by one dynamic library.

Required Methods§

Source

fn timelines(&self) -> Vec<TimelineInfo>

Source

fn build( &self, id: &str, t: TimelineTime, target: Resolution, residency: RasterResidency, ctx: &mut dyn RenderContext, ) -> Option<RasterImage>

Builds a frame with the representation requested by its consumer.

Provided Methods§

Source

fn arrangement(&self, _id: &str) -> Option<Arrangement>

The resolved arrangement tree for id, for the live UI to introspect.

Defaulted to None so existing collections can migrate in stages (audit B.4): a collection that has not yet built a resolved tree simply returns nothing here.

Source

fn render_audio( &self, _id: &str, _rate: u32, _channels: u16, ) -> Option<AudioBuffer>

The block-rendered audio mix-down for id at rate / channels, for the live preview to mux into its video stream. None means the collection contributes no audio (the preview then muxes a silent track for a consistent A/V stream structure). Defaulted so collections migrate in stages, mirroring arrangement.

Source

fn render_audio_window( &self, _id: &str, _start: f64, _duration: f64, _rate: u32, _channels: u16, ) -> Option<AudioBuffer>

Block-rendered audio mix-down for [start, start + duration), used by the live preview when it encodes an individual cache segment. Custom collections must implement this explicitly to preview audio; falling back to the whole-track render_audio would reintroduce the per-segment full-timeline work this API avoids.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§