pub struct Follower { /* private fields */ }Expand description
One clip’s position, measured on a shared master.
Play, pause, and seek are the clip’s own; the time between them is the master’s. Following a stopped master — an audio device that is paused or gone — freezes the clip where it is, which is the only thing a picture following a sound can sensibly do.
Implementations§
Source§impl Follower
impl Follower
Sourcepub fn new(master: SharedClock) -> Self
pub fn new(master: SharedClock) -> Self
Paused, at zero.
Sourcepub fn starting_at(master: SharedClock, master_position: Duration) -> Self
pub fn starting_at(master: SharedClock, master_position: Duration) -> Self
Running, with the clip’s zero at master_position on the master — in
the past, so the clip is already some way in, or in the future, so it
waits. See is_due.
Sourcepub fn master(&self) -> &SharedClock
pub fn master(&self) -> &SharedClock
The master this follows.
Sourcepub fn seek(&mut self, position: Duration)
pub fn seek(&mut self, position: Duration)
Moves to a position. Keeps running if it was running.
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Whether the clip itself is playing, whatever the master is doing.
Sourcepub fn is_due(&self) -> bool
pub fn is_due(&self) -> bool
Whether the clip has reached its start: false only for a clip made
with starting_at a point the master has not
got to yet.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Follower
impl !UnwindSafe for Follower
impl Freeze for Follower
impl Send for Follower
impl Sync for Follower
impl Unpin for Follower
impl UnsafeUnpin for Follower
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