pub struct TimecodeScheduler { /* private fields */ }Expand description
Frame-accurate timecode playback scheduler.
Maintains an internal frame counter and fires registered triggers when playback passes their target timecode.
Implementations§
Source§impl TimecodeScheduler
impl TimecodeScheduler
Sourcepub fn new(rate: FrameRate, drop_frame: bool) -> Self
pub fn new(rate: FrameRate, drop_frame: bool) -> Self
Create a new scheduler, starting at 00:00:00:00.
Sourcepub fn current_timecode(&self) -> Option<Timecode>
pub fn current_timecode(&self) -> Option<Timecode>
Current timecode.
Returns None only if the frame count is somehow invalid.
Sourcepub fn advance_frames(&mut self, frames: u64) -> FiredTriggers
pub fn advance_frames(&mut self, frames: u64) -> FiredTriggers
Advance by frames frames and return any fired triggers.
Sourcepub fn register_trigger(
&mut self,
target: Timecode,
label: impl Into<String>,
one_shot: bool,
) -> TriggerId
pub fn register_trigger( &mut self, target: Timecode, label: impl Into<String>, one_shot: bool, ) -> TriggerId
Register a trigger at a target timecode.
Returns the TriggerId assigned.
Sourcepub fn unregister_trigger(&mut self, id: TriggerId)
pub fn unregister_trigger(&mut self, id: TriggerId)
Remove a trigger.
Sourcepub fn trigger_label(&self, id: TriggerId) -> Option<&str>
pub fn trigger_label(&self, id: TriggerId) -> Option<&str>
Get the label of a trigger.
Sourcepub fn trigger_count(&self) -> usize
pub fn trigger_count(&self) -> usize
Number of registered triggers.
Auto Trait Implementations§
impl Freeze for TimecodeScheduler
impl RefUnwindSafe for TimecodeScheduler
impl Send for TimecodeScheduler
impl Sync for TimecodeScheduler
impl Unpin for TimecodeScheduler
impl UnsafeUnpin for TimecodeScheduler
impl UnwindSafe for TimecodeScheduler
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> 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