Skip to main content

motion_core/authoring/timeline/
resolved.rs

1//! Soundtrack clips resolved at an I/O boundary.
2
3use crate::{AudioClip, Duration};
4
5/// A timeline's soundtrack after its clips were resolved, for example from files.
6///
7/// Produced by [`Timeline::resolve_audio`](super::Timeline::resolve_audio) and held by
8/// mixing, export and Studio next to the unchanged timeline.
9#[derive(Clone, Debug)]
10pub struct ResolvedAudio {
11    pub(super) clips: Vec<AudioClip>,
12    pub(super) duration: Duration,
13}
14
15impl ResolvedAudio {
16    /// Resolved clips in the order of the soundtrack.
17    pub fn clips(&self) -> &[AudioClip] {
18        &self.clips
19    }
20
21    /// Output duration needed to play every clip. Equals the timeline duration
22    /// unless that was inferred and a resolved clip is longer.
23    pub fn duration(&self) -> Duration {
24        self.duration
25    }
26}