Skip to main content

TimecodeEventCapture

Struct TimecodeEventCapture 

Source
pub struct TimecodeEventCapture { /* private fields */ }
Expand description

Accumulates timecode events recorded during a production session.

Thread safety: TimecodeEventCapture is not Sync; wrap in a Mutex or RwLock if sharing across threads.

Implementations§

Source§

impl TimecodeEventCapture

Source

pub fn new() -> Self

Create an empty capture session.

Source

pub fn mark_in(&mut self, tc: Timecode)

Record a mark-in event at tc.

Also stores tc as the pending mark-in so that a subsequent mark_out can construct an EditRange.

Source

pub fn mark_out(&mut self, tc: Timecode) -> Option<EditRange>

Record a mark-out event at tc.

Returns the completed EditRange if a pending mark-in exists.

Source

pub fn cue(&mut self, tc: Timecode, label: impl Into<String>)

Record a cue trigger at tc with an optional label.

Source

pub fn custom( &mut self, tc: Timecode, name: impl Into<String>, label: impl Into<String>, payload: Option<String>, )

Record a custom event at tc.

Source

pub fn events(&self) -> &[TimecodeEvent]

Return a slice of all recorded events.

Source

pub fn mark_ins(&self) -> Vec<&TimecodeEvent>

Return only the mark-in events.

Source

pub fn mark_outs(&self) -> Vec<&TimecodeEvent>

Return only the mark-out events.

Source

pub fn edit_ranges(&self) -> Vec<EditRange>

Reconstruct all completed in/out ranges from the event log.

Pairs mark-in events with the next mark-out event that follows them.

Source

pub fn clear(&mut self)

Clear all events and reset pending mark-in state.

Source

pub fn len(&self) -> usize

Number of recorded events.

Source

pub fn is_empty(&self) -> bool

Whether no events have been recorded.

Trait Implementations§

Source§

impl Debug for TimecodeEventCapture

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TimecodeEventCapture

Source§

fn default() -> TimecodeEventCapture

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.