Struct rich_sdl2_rust::mixer::chunk::channel::ChannelGroup
source · pub struct ChannelGroup<'device> { /* private fields */ }
Expand description
A channel group, reserving some Channel
s.
Implementations§
source§impl<'device> ChannelGroup<'device>
impl<'device> ChannelGroup<'device>
sourcepub fn new(_device: &'device MixDevice<'device>, len: usize) -> Self
pub fn new(_device: &'device MixDevice<'device>, len: usize) -> Self
Constructs the new channel group.
sourcepub fn partition(self, left_len: usize) -> (Self, Self)
pub fn partition(self, left_len: usize) -> (Self, Self)
Partitions the group into two groups. The length of first element of tuple will be left_len
, and the other will be self.len - left_len
. And halts all the playing channel before doing it.
§Panics
Panics if self.len < left_len
.
sourcepub fn first_free(&self) -> Option<Channel<'_>>
pub fn first_free(&self) -> Option<Channel<'_>>
Returns the first free mixing channel if exists.
sourcepub fn oldest_playing(&self) -> Option<Channel<'_>>
pub fn oldest_playing(&self) -> Option<Channel<'_>>
Returns the oldest playing channel in the group.
sourcepub fn newest_playing(&self) -> Option<Channel<'_>>
pub fn newest_playing(&self) -> Option<Channel<'_>>
Returns the newest playing channel in the group.
sourcepub fn fade_out_all(&self, fade_out: u32) -> usize
pub fn fade_out_all(&self, fade_out: u32) -> usize
Fade out all the playing channel in milliseconds. And returns the numbers of channels that is fading out now.
Auto Trait Implementations§
impl<'device> !RefUnwindSafe for ChannelGroup<'device>
impl<'device> !Send for ChannelGroup<'device>
impl<'device> !Sync for ChannelGroup<'device>
impl<'device> Unpin for ChannelGroup<'device>
impl<'device> !UnwindSafe for ChannelGroup<'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