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
impl Timeline
Sourcepub fn new(size: Size, rate: FrameRate) -> TimelineBuilder
pub fn new(size: Size, rate: FrameRate) -> TimelineBuilder
Starts a timeline; invalid dimensions or rates are reported by build.
Sourcepub fn try_new(size: Size, rate: FrameRate) -> Result<TimelineBuilder>
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.
Sourcepub fn to_builder(&self) -> TimelineBuilder
pub fn to_builder(&self) -> TimelineBuilder
Reopens this timeline for further edits. Audio resolved by
resolve_audio is dropped and must be resolved again.
Sourcepub fn frame_rate(&self) -> FrameRate
pub fn frame_rate(&self) -> FrameRate
Frame grid used for all schedule boundary adjustments.
Sourcepub fn background(&self) -> Option<Color>
pub fn background(&self) -> Option<Color>
Background below every track, if any.
Sourcepub fn duration(&self) -> Duration
pub fn duration(&self) -> Duration
Final duration: the explicit value, or the end of the tracks and audio, 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 soundtrack(&self) -> &Soundtrack
pub fn soundtrack(&self) -> &Soundtrack
Audio clips, buses and master settings declared on this timeline.
Sourcepub fn diagnostics(&self) -> &Diagnostics
pub fn diagnostics(&self) -> &Diagnostics
Structured warnings, without stderr side effects.
Sourcepub fn resolve_audio(
&self,
resolve: impl FnMut(&AudioClip) -> Result<AudioClip>,
) -> Result<ResolvedAudio>
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.
Sourcepub fn visual(&self) -> TimelineVisual
pub fn visual(&self) -> TimelineVisual
Wraps this timeline as a picture-only Scene, for embedding where audio
must not follow, for example SceneContext::embed.
Sourcepub fn render(&self, context: &SceneContext<'_>) -> Node
pub fn render(&self, context: &SceneContext<'_>) -> Node
Builds one snapshot without retaining previous-frame state. Times at or after
duration produce nothing.
Sourcepub fn render_until(&self, context: &SceneContext<'_>, end: Duration) -> Node
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.