Skip to main content

Timeline

Struct Timeline 

Source
pub struct Timeline { /* private fields */ }
Expand description

multi-track timeline with integer frame-aligned intervals.

Authoring builders retain diagnostics; try_* variants report immediately. Empty timelines last zero ticks; trailing gaps contribute duration. An explicit duration clips or extends all tracks without retiming their scenes. This is the canonical root Timeline. Nested output clips the child viewport before centered contain mapping into its parent’s design space; child frame rate does not retime parent ticks.

Implementations§

Source§

impl Timeline

Source

pub fn new(size: Size, rate: impl Into<FrameRate>) -> Self

Creates an authoring timeline; invalid dimensions/rates are reported by validate().

Source

pub fn validate(&self) -> Result<()>

Validates every retained authoring diagnostic and nested scene before execution.

Source

pub fn track(self, build: impl FnOnce(TrackBuilder) -> TrackBuilder) -> Self

Constructs one track while accumulating all invalid operations.

Source

pub fn audio(self, clip: AudioClip) -> Self

Adds timeline audio, deferring validation failures to execution.

Source

pub fn master(self, master: Master) -> Self

Sets optional master processing, shared by preview and export.

Source

pub fn audio_bus(self, bus: AudioBus) -> Self

Declares a named offline submix before the master.

Source

pub fn audio_master(&self) -> Master

Immutable master settings at the audio execution boundary.

Source

pub fn audio_buses(&self) -> &[AudioBus]

Declared submixes in deterministic insertion order.

Source

pub fn duration(self, duration: Duration) -> Self

Overrides output duration, deferring validation failures to execution.

Source

pub fn try_new(size: Size, rate: impl Into<FrameRate>) -> Result<Self>

Creates a timeline without discovering fonts, devices or encoders. Rates above one frame per tick cannot define a distinct frame grid.

Source

pub fn background(self, color: Color) -> Self

Adds a full-design background below every track; alpha is retained.

Source

pub fn try_audio(self, clip: AudioClip) -> Result<Self>

Adds audio without snapping its placement to the video grid. Audio extends inferred output to the next frame boundary, never trims its tail.

Source

pub fn try_track( self, build: impl FnOnce(TrackBuilder) -> Result<TrackBuilder>, ) -> Result<Self>

Atomically builds one track; all tracks together admit at most 16384 clips, 256 tracks and 65536 frame-adjustment warnings per snapshot.

Source

pub fn try_duration(self, duration: Duration) -> Result<Self>

Overrides total duration on the nearest frame grid; zero is intentionally empty.

Source

pub fn size(&self) -> Size

Logical timeline viewport; supply this to composition rendering.

Source

pub fn frame_rate(&self) -> FrameRate

Frame grid used for all schedule boundary adjustments.

Source

pub fn total_duration(&self) -> Duration

Finite inferred/overridden duration, independent of any parent clip duration.

Source

pub fn frame_count(&self) -> u64

Exact output frame count. Existing Composition needs checked u32 conversion.

Source

pub fn tracks(&self) -> &[Track]

Immutable tracks in bottom-to-top paint order.

Source

pub fn adjustments(&self) -> &[BoundaryAdjustment]

Accumulated structured boundary warnings, without stderr side effects.

Source

pub fn resolve_audio( &self, resolve: impl FnMut(&AudioClip) -> Result<AudioClip>, ) -> Result<Self>

Resolves flattened audio at an I/O boundary while preserving visual scene clocks.

Trait Implementations§

Source§

impl Clone for Timeline

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Timeline

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Scene for Timeline

Source§

fn audio_composition(&self) -> Option<&Timeline>

Optional nested timeline ownership, preserved when its audio is relocated.
Source§

fn validate(&self) -> Result<()>

Validates deferred authoring errors without evaluating a frame.
Source§

fn duration(&self) -> Option<Duration>

Natural finite duration, or None when a caller must provide one.
Source§

fn audio_clips(&self) -> Result<Vec<AudioClip>>

Returns pure audio metadata for precomposition/export, not playback. Default scenes are silent; callers must preserve local clip coordinates.
Source§

fn render(&self, context: &SceneContext<'_>) -> Node

Builds one snapshot without retaining previous-frame state.
Source§

fn with_duration(self, duration: Duration) -> WithDuration<Self>
where Self: Sized,

Overrides clip metadata without retiming or clamping the callback. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.