midi_msg/system_exclusive/
show_control.rs

1use crate::parse_error::*;
2use alloc::vec::Vec;
3
4#[derive(Debug, Clone, PartialEq, Eq)]
5/// A MIDI Show Control command.
6/// Used by [`UniversalRealTimeMsg::ShowControl`](crate::UniversalRealTimeMsg::ShowControl).
7///
8/// Unimplemented, though the `Unimplemented` value can be used to
9/// represent the commands not supported here.
10///
11/// As defined in MIDI Show Control 1.1.1 (RP002/RP014)
12pub enum ShowControlMsg {
13    /// Used to represent all unimplemented MSC messages.
14    /// Is inherently not guaranteed to be a valid message.
15    Unimplemented(Vec<u8>),
16}
17
18impl ShowControlMsg {
19    pub(crate) fn extend_midi(&self, v: &mut Vec<u8>) {
20        match self {
21            Self::Unimplemented(d) => v.extend_from_slice(d),
22        }
23    }
24
25    #[allow(dead_code)]
26    pub(crate) fn from_midi(_m: &[u8]) -> Result<(Self, usize), ParseError> {
27        Err(ParseError::NotImplemented("ShowControlMsg"))
28    }
29}
30
31#[cfg(test)]
32mod tests {
33    // use super::*;
34
35    #[test]
36    fn serialize_show_control_msg() {
37        // TODO
38    }
39}