pub struct MpeNoteAllocator { /* private fields */ }Expand description
Rotating (round-robin) allocator of member channels to active notes.
Implementations§
Source§impl MpeNoteAllocator
impl MpeNoteAllocator
Sourcepub fn allocate(&mut self, note: u8) -> Result<u8, AudioError>
pub fn allocate(&mut self, note: u8) -> Result<u8, AudioError>
Allocate a member channel for note, rotating from the current cursor.
Returns the assigned channel index. Errors with
AudioError::BackendUnavailable if every member channel is occupied.
Sourcepub fn release(&mut self, note: u8) -> Option<u8>
pub fn release(&mut self, note: u8) -> Option<u8>
Release the channel currently holding note. Returns the freed channel,
or None if the note was not active.
Sourcepub fn note_on_channel(&self, channel: u8) -> Option<u8>
pub fn note_on_channel(&self, channel: u8) -> Option<u8>
The note currently sounding on channel, if any.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Number of member channels currently occupied.
Trait Implementations§
Source§impl Clone for MpeNoteAllocator
impl Clone for MpeNoteAllocator
Auto Trait Implementations§
impl Freeze for MpeNoteAllocator
impl RefUnwindSafe for MpeNoteAllocator
impl Send for MpeNoteAllocator
impl Sync for MpeNoteAllocator
impl Unpin for MpeNoteAllocator
impl UnsafeUnpin for MpeNoteAllocator
impl UnwindSafe for MpeNoteAllocator
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