pub fn as_live_event(&self) -> Option<LiveEvent<'a>> {
        match self {
            TrackEventKind::Midi { channel, message } => Some(LiveEvent::Midi {
                channel: *channel,
                message: *message,
            }),
            TrackEventKind::SysEx(data) => {
                if data.last() == Some(&0xF7) {
                    let data_u7 = u7::slice_from_int(data);
                    if data_u7.len() == data.len() - 1 {
                        return Some(LiveEvent::Common(SystemCommon::SysEx(data_u7)));
                    }
                }
                None
            }
            TrackEventKind::Escape(_data) => None,
            TrackEventKind::Meta(_meta) => None,
        }
    }
/// Lossy conversion from a track event to a live event.
///
/// Only channel MIDI messages and not-split SysEx messages can be converted.
/// Meta messages and arbitrary escapes yield `None` when converted.
Lossy conversion from a track event to a live event.
Only channel MIDI messages and not-split SysEx messages can be converted.
Meta messages and arbitrary escapes yield `None` when converted.
Lossy conversion from a track event to a live event . Only channel MIDI messages and not - split SysEx messages can be converted . Meta messages and arbitrary escapes yield ` None ` when converted .
pub fn as_live_event(&self) -> Option<LiveEvent<'a>> {
        match self {
            TrackEventKind::Midi { channel, message } => Some(LiveEvent::Midi {
                channel: *channel,
                message: *message,
            }),
            TrackEventKind::SysEx(data) => {
                if data.last() == Some(&0xF7) {
                    let data_u7 = u7::slice_from_int(data);
                    if data_u7.len() == data.len() - 1 {
                        return Some(LiveEvent::Common(SystemCommon::SysEx(data_u7)));
                    }
                }
                None
            }
            TrackEventKind::Escape(_data) => None,
            TrackEventKind::Meta(_meta) => None,
        }
    }
pub fn as_live_event ( & self ) -> Option < LiveEvent < ' a > > { match self { TrackEventKind :: Midi { channel , message } => Some ( LiveEvent :: Midi { channel : * channel , message : * message , } ) , TrackEventKind :: SysEx ( data ) => { if data . last ( ) == Some ( & 0xF7 ) { let data_u7 = u7 :: slice_from_int ( data ) ; if data_u7 . len ( ) == data . len ( ) - 1 { return Some ( LiveEvent :: Common ( SystemCommon :: SysEx ( data_u7 ) ) ) ; } } None } TrackEventKind :: Escape ( _data ) => None , TrackEventKind :: Meta ( _meta ) => None , } }
Lossy conversion from a track event to a live event.
Lossy conversion from a track event to a live event .
&self
&self