Struct audio_processor_standalone_midi::host::MidiHost
source · pub struct MidiHost { /* private fields */ }
Expand description
Host for MIDI messages, opens all ports & forwards them onto a lock-free queue the audio-thread can pop from.
The host will close all MIDI connections on drop.
Implementations§
source§impl MidiHost
impl MidiHost
sourcepub fn new(handle: &Handle, capacity: usize) -> Self
pub fn new(handle: &Handle, capacity: usize) -> Self
Create the host, linked to GC Handle
and with queue capacity
of messages.
sourcepub fn default_with_handle(handle: &Handle) -> Self
pub fn default_with_handle(handle: &Handle) -> Self
Create the host with default 100 capacity
sourcepub fn default_with_queue(handle: &Handle, queue: MidiMessageQueue) -> Self
pub fn default_with_queue(handle: &Handle, queue: MidiMessageQueue) -> Self
Build a MidiHost with a pre-built queue
sourcepub fn messages(&self) -> &MidiMessageQueue
pub fn messages(&self) -> &MidiMessageQueue
Get a reference to the message queue
sourcepub fn start_midi(&mut self) -> Result<(), MidiError>
pub fn start_midi(&mut self) -> Result<(), MidiError>
Start the MIDI connections
sourcepub fn virtual_port_name(&self) -> String
pub fn virtual_port_name(&self) -> String
For integration testing purposes MidiHost
starts a virtual input which it’ll also connect
into. This input contains the PID of the host process.
Generating this name dynamically avoids flakiness in integration tests.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MidiHost
impl Send for MidiHost
impl !Sync for MidiHost
impl Unpin for MidiHost
impl !UnwindSafe for MidiHost
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