use crate::byte_iter::ByteIter;
use crate::error::LibResult;
use crate::scribe::Scribe;
use std::io::{Read, Write};
#[derive(Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Hash)]
pub struct SysexEvent {
t: SysexEventType,
data: Vec<u8>,
}
impl SysexEvent {
pub fn new(t: SysexEventType, data: Vec<u8>) -> Self {
Self { t, data }
}
pub fn sysex_type(&self) -> &SysexEventType {
&self.t
}
pub fn data(&self) -> &[u8] {
&self.data
}
pub(crate) fn parse<R: Read>(_first_byte: u8, _r: &mut ByteIter<R>) -> LibResult<Self> {
noimpl!("SysexEvent::parse")
}
pub(crate) fn write<W: Write>(&self, _w: &mut Scribe<W>) -> LibResult<()> {
noimpl!("SysexEvent::write")
}
}
#[repr(u8)]
#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash, Default)]
pub enum SysexEventType {
#[default]
F0 = 0xf0,
F7 = 0xf7,
}