pub struct MidiEngine { /* private fields */ }Expand description
Manages MIDI hardware connections and routes events.
Implementations§
Source§impl MidiEngine
impl MidiEngine
Sourcepub fn list_ports() -> Vec<String>
pub fn list_ports() -> Vec<String>
List available MIDI input port names.
Sourcepub fn connect_port(&mut self, port_index: usize) -> Result<(), String>
pub fn connect_port(&mut self, port_index: usize) -> Result<(), String>
Connect to a MIDI input port by index. Returns Ok(()) if connected, Err with message if failed.
Sourcepub fn connect_first(&mut self) -> Result<String, String>
pub fn connect_first(&mut self) -> Result<String, String>
Connect to the first available MIDI port.
Sourcepub fn router(&self) -> Arc<Mutex<MidiRouter>>
pub fn router(&self) -> Arc<Mutex<MidiRouter>>
Get a reference to the router for registering handlers.
Sourcepub fn advance_samples(&self, samples: u64)
pub fn advance_samples(&self, samples: u64)
Advance the sample counter (call once per audio buffer).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MidiEngine
impl !RefUnwindSafe for MidiEngine
impl Send for MidiEngine
impl !Sync for MidiEngine
impl Unpin for MidiEngine
impl UnsafeUnpin for MidiEngine
impl !UnwindSafe for MidiEngine
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