pub struct PlaybackClock { /* private fields */ }Expand description
Wall-clock playback clock with pause accounting, for driving lookups
into a PlaybackTimeline while audio plays through an external
player (the caller owns the audio device; this is just the stopwatch).
Implementations§
Source§impl PlaybackClock
impl PlaybackClock
Sourcepub fn start(speed: f32) -> Self
pub fn start(speed: f32) -> Self
Start counting playback time now. speed is informational here —
the clock counts playback wall time (post-tempo); pair it with a
timeline built with the same speed.
pub fn is_paused(&self) -> bool
Sourcepub fn elapsed_playback_secs(&self) -> f32
pub fn elapsed_playback_secs(&self) -> f32
Elapsed playback seconds since start (or the last
seek), excluding paused time.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlaybackClock
impl RefUnwindSafe for PlaybackClock
impl Send for PlaybackClock
impl Sync for PlaybackClock
impl Unpin for PlaybackClock
impl UnsafeUnpin for PlaybackClock
impl UnwindSafe for PlaybackClock
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