pub struct MidiAudioThreadHandler { /* private fields */ }
Expand description
Audio-thread side of MIDI handling.
Pops MIDI events from the the MIDI queue & collects them on a pre-allocated fixed capacity vector.
Implementations§
source§impl MidiAudioThreadHandler
impl MidiAudioThreadHandler
pub fn new(capacity: usize) -> Self
sourcepub fn buffer(&self) -> &Vec<MidiMessageEntry>
pub fn buffer(&self) -> &Vec<MidiMessageEntry>
Get a reference to the message buffer
sourcepub fn collect_midi_messages(
&mut self,
midi_message_queue: &MidiMessageQueue
) -> usize
pub fn collect_midi_messages( &mut self, midi_message_queue: &MidiMessageQueue ) -> usize
Push messages onto the buffer
This is real-time safe as long as MidiAudioThreadHandler::clear
is called on every tick.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MidiAudioThreadHandler
impl Send for MidiAudioThreadHandler
impl Sync for MidiAudioThreadHandler
impl Unpin for MidiAudioThreadHandler
impl UnwindSafe for MidiAudioThreadHandler
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