InputDevice

Trait InputDevice 

Source
pub trait InputDevice {
    type Message;

    const MIDI_CONNECTION_NAME: &'static str;
    const MIDI_DEVICE_KEYWORD: &'static str;

    // Required method
    fn decode_message(timestamp: u64, data: &[u8]) -> Self::Message;

    // Provided methods
    fn from_port<F>(
        midi_input: MidiInput,
        port: &MidiInputPort,
        user_callback: F,
    ) -> Result<InputDeviceHandler, MidiError>
       where F: FnMut(Self::Message) + Send + 'static { ... }
    fn from_port_polling(
        midi_input: MidiInput,
        port: &MidiInputPort,
    ) -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
       where Self::Message: Send + 'static { ... }
    fn guess<F>(user_callback: F) -> Result<InputDeviceHandler, MidiError>
       where F: FnMut(Self::Message) + Send + 'static { ... }
    fn guess_polling(    ) -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
       where Self::Message: Send + 'static { ... }
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn decode_message(timestamp: u64, data: &[u8]) -> Self::Message

Provided Methods§

Source

fn from_port<F>( midi_input: MidiInput, port: &MidiInputPort, user_callback: F, ) -> Result<InputDeviceHandler, MidiError>
where F: FnMut(Self::Message) + Send + 'static,

Source

fn from_port_polling( midi_input: MidiInput, port: &MidiInputPort, ) -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
where Self::Message: Send + 'static,

Source

fn guess<F>(user_callback: F) -> Result<InputDeviceHandler, MidiError>
where F: FnMut(Self::Message) + Send + 'static,

Search the midi devices and choose the first midi device matching the wanted Launchpad type.

Source

fn guess_polling() -> Result<InputDeviceHandlerPolling<Self::Message>, MidiError>
where Self::Message: Send + 'static,

Search the midi devices and choose the first midi device matching the wanted Launchpad type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl InputDevice for launchy::launch_control::Input

Source§

const MIDI_CONNECTION_NAME: &'static str = "Launchy Launch Control input"

Source§

const MIDI_DEVICE_KEYWORD: &'static str = "Launch Control"

Source§

type Message = Message

Source§

impl InputDevice for launchy::launchpad_mini::Input

Source§

const MIDI_DEVICE_KEYWORD: &'static str = "Launchpad Mini"

Source§

const MIDI_CONNECTION_NAME: &'static str = "Launchy Mini Input"

Source§

type Message = Message

Source§

impl InputDevice for launchy::launchpad_mini_mk3::Input

Source§

const MIDI_DEVICE_KEYWORD: &'static str = "Launchpad Mini MK3 LPMiniMK3 MIDI"

Source§

const MIDI_CONNECTION_NAME: &'static str = "Launchy Mini Mk3 Input"

Source§

type Message = Message

Source§

impl InputDevice for launchy::launchpad_mk2::Input

Source§

const MIDI_DEVICE_KEYWORD: &'static str = "Launchpad MK2"

Source§

const MIDI_CONNECTION_NAME: &'static str = "Launchy Mk2 Input"

Source§

type Message = Message

Source§

impl InputDevice for launchy::launchpad_s::Input

Source§

const MIDI_CONNECTION_NAME: &'static str = "Launchy S input"

Source§

const MIDI_DEVICE_KEYWORD: &'static str = "Launchpad S"

Source§

type Message = Message