pub struct Track {
pub id: u64,
pub name: String,
pub kind: TrackKind,
pub muted: bool,
pub solo: bool,
pub height: f32,
pub clips: Vec<Clip>,
pub transitions: Vec<Transition>,
pub bus: u64,
}Fields§
§id: u64§name: String§kind: TrackKind§muted: boolAudio: muted. Video: hidden (the “V” visibility toggle).
solo: bool§height: f32UI height in points.
clips: Vec<Clip>§transitions: Vec<Transition>§bus: u64Audio tracks: the bus every clip feeds unless the clip overrides it (0 = Main).
Implementations§
Source§impl Track
impl Track
pub fn new(id: u64, kind: TrackKind, name: impl Into<String>) -> Self
pub fn sort(&mut self)
pub fn end(&self) -> f64
Sourcepub fn fits(&self, start: f64, dur: f64, ignore: &[u64]) -> bool
pub fn fits(&self, start: f64, dur: f64, ignore: &[u64]) -> bool
True if [start, start+dur) is free on this track, ignoring clips in ignore.
Sourcepub fn left_of(&self, right: &Clip) -> Option<&Clip>
pub fn left_of(&self, right: &Clip) -> Option<&Clip>
The clip ending exactly where right starts (the left side of that cut).
Sourcepub fn transition_clips(
&self,
tr: &Transition,
) -> Option<(Option<&Clip>, Option<&Clip>)>
pub fn transition_clips( &self, tr: &Transition, ) -> Option<(Option<&Clip>, Option<&Clip>)>
The (left, right) sides of a transition, if it is still valid. Edge transitions have one side
missing: In blends nothing → clip (no left), Out blends clip → nothing (no right).
Sourcepub fn transition_at(
&self,
t: f64,
) -> Option<(&Transition, Option<&Clip>, Option<&Clip>)>
pub fn transition_at( &self, t: f64, ) -> Option<(&Transition, Option<&Clip>, Option<&Clip>)>
The transition playing at timeline time t (clamped window), with its clips.
Sourcepub fn prune_transitions(&mut self)
pub fn prune_transitions(&mut self)
Drop transitions whose clips no longer abut (edge transitions only need their clip to exist).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Track
impl<'de> Deserialize<'de> for Track
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Track
impl RefUnwindSafe for Track
impl Send for Track
impl Sync for Track
impl Unpin for Track
impl UnwindSafe for Track
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more