pub struct Channel<'device>(/* private fields */);
Expand description
A mixing channel for playing a MixChunk
.
Implementations§
source§impl<'device> Channel<'device>
impl<'device> Channel<'device>
sourcepub fn volume(&self) -> u32
pub fn volume(&self) -> u32
Returns the output volume of the channel. The volume is in 0..=128
.
sourcepub fn set_volume(&self, volume: u32)
pub fn set_volume(&self, volume: u32)
Sets the output volume of the channel. The volume is clamped to 0..=128
.
sourcepub fn play(self, chunk: &MixChunk<'_>, options: PlayOptions) -> Result<Self>
pub fn play(self, chunk: &MixChunk<'_>, options: PlayOptions) -> Result<Self>
Starts to play a chunk.
sourcepub fn play_fade_in(
self,
chunk: &MixChunk<'_>,
fade_in: u32,
options: PlayOptions
) -> Result<Self>
pub fn play_fade_in( self, chunk: &MixChunk<'_>, fade_in: u32, options: PlayOptions ) -> Result<Self>
Starts to play a chunk with fade-in time in milliseconds.
sourcepub fn pause(&'device mut self) -> Option<Pauser<'device>>
pub fn pause(&'device mut self) -> Option<Pauser<'device>>
Pauses playing and returns the Pauser
, or None
if it is free.
sourcepub fn fade_out(&self, fade_out: u32) -> usize
pub fn fade_out(&self, fade_out: u32) -> usize
Fade out playing on the channel in milliseconds. And returns the numbers of channels that is fading out.
sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Returns whether the channel is playing.
sourcepub fn playing_chunk(&self) -> Option<MixChunk<'_>>
pub fn playing_chunk(&self) -> Option<MixChunk<'_>>
Returns the playing chunk if exists.
Trait Implementations§
source§impl<'device> EffectAttachExt for Channel<'device>
impl<'device> EffectAttachExt for Channel<'device>
source§impl<'device> PartialEq for Channel<'device>
impl<'device> PartialEq for Channel<'device>
impl<'device> Eq for Channel<'device>
impl<'device> StructuralPartialEq for Channel<'device>
Auto Trait Implementations§
impl<'device> !RefUnwindSafe for Channel<'device>
impl<'device> !Send for Channel<'device>
impl<'device> !Sync for Channel<'device>
impl<'device> Unpin for Channel<'device>
impl<'device> !UnwindSafe for Channel<'device>
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