Skip to main content

Timeline

Struct Timeline 

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

Immutable, validated multi-track timeline with integer frame-aligned intervals.

Created by TimelineBuilder::build; a built timeline never changes. 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: FrameRate) -> TimelineBuilder

Starts a timeline; invalid dimensions or rates are reported by build.

Source

pub fn try_new(size: Size, rate: FrameRate) -> Result<TimelineBuilder>

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

Source

pub fn to_builder(&self) -> TimelineBuilder

Reopens this timeline for further edits. Audio resolved by resolve_audio is dropped and must be resolved again.

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 background(&self) -> Option<Color>

Background below every track, if any.

Source

pub fn duration(&self) -> Duration

Final duration: the explicit value, or the end of the tracks and audio, 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 soundtrack(&self) -> &Soundtrack

Audio clips, buses and master settings declared on this timeline.

Source

pub fn diagnostics(&self) -> &Diagnostics

Structured warnings, without stderr side effects.

Source

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

Resolves the soundtrack’s clips at an I/O boundary, for example by reading files. The timeline itself is unchanged; the result carries the clips and the output duration they require.

Source

pub fn visual(&self) -> TimelineVisual

Wraps this timeline as a picture-only Scene, for embedding where audio must not follow, for example SceneContext::embed.

Source

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

Builds one snapshot without retaining previous-frame state. Times at or after duration produce nothing.

Source

pub fn render_until(&self, context: &SceneContext<'_>, end: Duration) -> Node

Like render but keeps drawing until end, for exports whose resolved audio outlasts the picture.

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

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.