pub struct TimecodeSequence { /* private fields */ }Expand description
An ordered sequence of TimecodeRun entries representing a playlist or
edit decision list.
Implementations§
Source§impl TimecodeSequence
impl TimecodeSequence
Sourcepub fn push(&mut self, run: TimecodeRun)
pub fn push(&mut self, run: TimecodeRun)
Append a run to the sequence.
Sourcepub fn total_frames(&self) -> u64
pub fn total_frames(&self) -> u64
Total number of frames across all runs.
Sourcepub fn get(&self, index: usize) -> Option<&TimecodeRun>
pub fn get(&self, index: usize) -> Option<&TimecodeRun>
Get a run by index.
Sourcepub fn is_contiguous(&self, a_idx: usize, b_idx: usize) -> bool
pub fn is_contiguous(&self, a_idx: usize, b_idx: usize) -> bool
Check whether two adjacent runs are contiguous (end of run N + 1 == start of run N+1).
Sourcepub fn total_duration_secs(&self) -> f64
pub fn total_duration_secs(&self) -> f64
Return the total duration (seconds) of the whole sequence.
Sourcepub fn find_run_at_offset(&self, offset: u64) -> Option<(usize, u64)>
pub fn find_run_at_offset(&self, offset: u64) -> Option<(usize, u64)>
Find the run containing a given absolute frame offset into the sequence.
Returns (run_index, offset_within_run).
Sourcepub fn iter(&self) -> Iter<'_, TimecodeRun>
pub fn iter(&self) -> Iter<'_, TimecodeRun>
Return an iterator over all runs.
Sourcepub fn detect_gaps(&self) -> Vec<(usize, i64)>
pub fn detect_gaps(&self) -> Vec<(usize, i64)>
Detect gaps between adjacent runs and return the gap durations in frames.
Trait Implementations§
Source§impl Clone for TimecodeSequence
impl Clone for TimecodeSequence
Source§fn clone(&self) -> TimecodeSequence
fn clone(&self) -> TimecodeSequence
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TimecodeSequence
impl Debug for TimecodeSequence
Auto Trait Implementations§
impl Freeze for TimecodeSequence
impl RefUnwindSafe for TimecodeSequence
impl Send for TimecodeSequence
impl Sync for TimecodeSequence
impl Unpin for TimecodeSequence
impl UnsafeUnpin for TimecodeSequence
impl UnwindSafe for TimecodeSequence
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