gled-protocol 2.31.2

What gled's user interfaces and its engine send each other
Documentation
//! MIDI tools of the interface that run in the engine: the monitor of
//! incoming traffic and the test outputs for configuring controllers.

use serde::{Deserialize, Serialize};

/// Something that happened on a MIDI port.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct MidiMonitorEvent {
    pub timestamp_ms: u128,
    pub port_name: String,
    pub label: String,
    pub bytes: Vec<u8>,
}

/// Test output for MIDI controllers, from the interface to the MIDI runtime.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum TestCommand {
    /// Send a MIDI test output: (status, data1, value)
    SendOutput { status: u8, data1: u8, value: u8 },
    /// Clear a MIDI test output by (status, data1)
    ClearOutput { status: u8, data1: u8 },
    /// Set the test device port name
    SetTestDevice { port_name: String },
    /// Unset test device (stop all test sending)
    UnsetTestDevice,
}