pub struct MidiRouter { /* private fields */ }Expand description
Routes MIDI events to registered handlers by channel.
Implementations§
Source§impl MidiRouter
impl MidiRouter
pub fn new() -> Self
Sourcepub fn register(&mut self, channel: u8, handler: MidiHandler)
pub fn register(&mut self, channel: u8, handler: MidiHandler)
Register a handler for a specific MIDI channel (0–15). Use channel 255 to receive events from all channels.
Sourcepub fn clear_channel(&mut self, channel: u8)
pub fn clear_channel(&mut self, channel: u8)
Remove all handlers for a channel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MidiRouter
impl !RefUnwindSafe for MidiRouter
impl Send for MidiRouter
impl Sync for MidiRouter
impl Unpin for MidiRouter
impl UnsafeUnpin for MidiRouter
impl !UnwindSafe for MidiRouter
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