pub struct PlayerControl { /* private fields */ }Expand description
The control-thread side of a WaveformPlayer: cheap to clone, lock-free, every call takes effect at the start of the next block.
Implementations§
Source§impl PlayerControl
impl PlayerControl
Sourcepub fn play(&self)
pub fn play(&self)
Starts or resumes. After the end was reached it starts again from the beginning.
Sourcepub fn set_looping(&self, looping: bool)
pub fn set_looping(&self, looping: bool)
Wrap to the start at the end instead of finishing.
Sourcepub fn set_gain(&self, gain: f32)
pub fn set_gain(&self, gain: f32)
Linear gain applied to the output. Non-finite values are ignored; negative inverts.
pub fn is_playing(&self) -> bool
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
True once playback reached the end without looping. Cleared by play and seek.
Trait Implementations§
Auto Trait Implementations§
impl Forget for PlayerControl
impl Freeze for PlayerControl
impl Move for PlayerControl
impl RefUnwindSafe for PlayerControlwhere
Atomic<usize>: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
Atomic<u32>: RefUnwindSafe,
Atomic<u64>: RefUnwindSafe,
impl Send for PlayerControl
impl Sync for PlayerControl
impl Unpin for PlayerControl
impl UnsafeUnpin for PlayerControl
impl UnwindSafe for PlayerControlwhere
Arc<Shared>: UnwindSafe,
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