pub struct PlaybackState {
pub playhead: f64,
pub playback_rate: f64,
pub playing: bool,
pub loop_mode: LoopMode,
pub start_delay: f64,
pub loop_delay: f64,
/* private fields */
}Fields§
§playhead: f64§playback_rate: f64§playing: bool§loop_mode: LoopMode§start_delay: f64Seconds to wait before the playhead moves when playback starts from the beginning or a seek. Resuming after a pause does not wait.
loop_delay: f64Seconds to hold at each end before looping.
Implementations§
Source§impl PlaybackState
impl PlaybackState
pub fn play(&mut self)
pub fn pause(&mut self)
pub fn stop(&mut self)
pub fn seek(&mut self, time: f64, duration: f64)
Sourcepub fn waiting(&self) -> f64
pub fn waiting(&self) -> f64
Seconds left before the playhead moves again: the start delay or a hold between loops.
pub fn tick(&mut self, delta_seconds: f64, duration: f64) -> bool
Sourcepub fn tick_spans(
&mut self,
delta_seconds: f64,
duration: f64,
visit: impl FnMut(PlaybackSpan),
) -> bool
pub fn tick_spans( &mut self, delta_seconds: f64, duration: f64, visit: impl FnMut(PlaybackSpan), ) -> bool
Advance like PlaybackState::tick, reporting each stretch of
timeline the playhead moves over; a tick that loops reports several.
Trait Implementations§
Source§impl Clone for PlaybackState
impl Clone for PlaybackState
Source§fn clone(&self) -> PlaybackState
fn clone(&self) -> PlaybackState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PlaybackState
Source§impl Debug for PlaybackState
impl Debug for PlaybackState
Source§impl Default for PlaybackState
impl Default for PlaybackState
Source§fn default() -> PlaybackState
fn default() -> PlaybackState
Returns the “default value” for a type. Read more
Source§impl PartialEq for PlaybackState
impl PartialEq for PlaybackState
impl StructuralPartialEq for PlaybackState
Auto Trait Implementations§
impl Forget for PlaybackState
impl Freeze for PlaybackState
impl Move for PlaybackState
impl RefUnwindSafe for PlaybackState
impl Send for PlaybackState
impl Sync for PlaybackState
impl Unpin for PlaybackState
impl UnsafeUnpin for PlaybackState
impl UnwindSafe for PlaybackState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.