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
impl Timeline
Sourcepub fn new(size: Size, rate: impl Into<FrameRate>) -> Self
pub fn new(size: Size, rate: impl Into<FrameRate>) -> Self
Creates an authoring timeline; invalid dimensions/rates are reported by validate().
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validates every retained authoring diagnostic and nested scene before execution.
Sourcepub fn track(self, build: impl FnOnce(TrackBuilder) -> TrackBuilder) -> Self
pub fn track(self, build: impl FnOnce(TrackBuilder) -> TrackBuilder) -> Self
Constructs one track while accumulating all invalid operations.
Sourcepub fn audio(self, clip: AudioClip) -> Self
pub fn audio(self, clip: AudioClip) -> Self
Adds timeline audio, deferring validation failures to execution.
Sourcepub fn master(self, master: Master) -> Self
pub fn master(self, master: Master) -> Self
Sets optional master processing, shared by preview and export.
Sourcepub fn audio_bus(self, bus: AudioBus) -> Self
pub fn audio_bus(self, bus: AudioBus) -> Self
Declares a named offline submix before the master.
Sourcepub fn audio_master(&self) -> Master
pub fn audio_master(&self) -> Master
Immutable master settings at the audio execution boundary.
Sourcepub fn audio_buses(&self) -> &[AudioBus]
pub fn audio_buses(&self) -> &[AudioBus]
Declared submixes in deterministic insertion order.
Sourcepub fn duration(self, duration: Duration) -> Self
pub fn duration(self, duration: Duration) -> Self
Overrides output duration, deferring validation failures to execution.
Sourcepub fn try_new(size: Size, rate: impl Into<FrameRate>) -> Result<Self>
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.
Sourcepub fn background(self, color: Color) -> Self
pub fn background(self, color: Color) -> Self
Adds a full-design background below every track; alpha is retained.
Sourcepub fn try_audio(self, clip: AudioClip) -> Result<Self>
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.
Sourcepub fn try_track(
self,
build: impl FnOnce(TrackBuilder) -> Result<TrackBuilder>,
) -> Result<Self>
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.
Sourcepub fn try_duration(self, duration: Duration) -> Result<Self>
pub fn try_duration(self, duration: Duration) -> Result<Self>
Overrides total duration on the nearest frame grid; zero is intentionally empty.
Sourcepub fn frame_rate(&self) -> FrameRate
pub fn frame_rate(&self) -> FrameRate
Frame grid used for all schedule boundary adjustments.
Sourcepub fn total_duration(&self) -> Duration
pub fn total_duration(&self) -> Duration
Finite inferred/overridden duration, independent of any parent clip duration.
Sourcepub fn frame_count(&self) -> u64
pub fn frame_count(&self) -> u64
Exact output frame count. Existing Composition needs checked u32 conversion.
Sourcepub fn adjustments(&self) -> &[BoundaryAdjustment]
pub fn adjustments(&self) -> &[BoundaryAdjustment]
Accumulated structured boundary warnings, without stderr side effects.