Skip to main content

TimelineBuilder

Struct TimelineBuilder 

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

Collects tracks, audio and settings, then builds a Timeline.

Fluent methods retain failures and report them all from build; try_* variants report immediately. Empty timelines last zero ticks; trailing gaps contribute duration. Without duration the timeline lasts until the end of its tracks and audio (including bus tails, rounded up to a frame); an explicit duration clips or extends the tracks without retiming their scenes.

Implementations§

Source§

impl TimelineBuilder

Source

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

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

Source

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

Constructs one track while accumulating all invalid operations.

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 audio(self, clip: AudioClip) -> Self

Adds timeline audio, deferring validation failures to build.

Source

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

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

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 duration(self, duration: Duration) -> Self

Overrides output duration, deferring validation failures to build.

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 build(self) -> Result<Timeline, ErrorReport>

Validates everything retained so far and freezes the timeline. All deferred failures, invalid audio settings and invalid nested scenes are reported together as one ErrorReport.

Trait Implementations§

Source§

impl Clone for TimelineBuilder

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 TimelineBuilder

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.