//! MIDI backend trait for polling raw MIDI messages.
//!
//! Similar in spirit to [`crate::audio_io`] for audio, `MidiBackend`
//! provides a uniform interface for receiving MIDI data from hardware
//! or virtual devices.
//!
//! Implementations:
//! - `AlsaSeqBackend` (behind `alsa` feature)
//! - `PipewireMidiBackend` (behind `pipewire` feature, planned)
use crateIoResult;
use crateMidiMessage;
/// Generic MIDI input backend.
///
/// # Lifecycle
///
/// 1. Construct the backend with device-specific configuration
/// 2. Call `poll()` at regular intervals (10–20 ms)
/// 3. Drop the backend to close the device
///
/// `poll()` may block briefly (with a timeout) to wait for events.
/// This trait is intended for use on a dedicated non-RT thread — not
/// the audio callback.