pub fn next_message_running_status(stat: u8, databyte: u8, reader: &mut dyn Read) -> Result<MidiMessage, MidiError> {
        let mut ret:Vec<u8> = Vec::with_capacity(3);
        ret.push(stat);
        ret.push(databyte);
        match MidiMessage::data_bytes(stat) {
            0 => { panic!("Can't have zero length message with running status"); }
            1 => { } // already read it
            2 => { ret.push(read_byte(reader)?); } // only need one more byte
            -1 => { return Err(MidiError::OtherErr("Don't handle variable sized yet")); }
            -2 => { return Err(MidiError::OtherErr("Running status not permitted with meta and sysex event")); }
            _ =>  { return Err(MidiError::InvalidStatus(stat)); }
        }
        Ok(MidiMessage{data: ret})
    }
/// Get the next midi message from the reader given that there's a running
/// status of `stat` and that in place of a status was read `databyte`
Get the next midi message from the reader given that there's a running
status of `stat` and that in place of a status was read `databyte`
Get the next midi message from the reader given that there ' s a running status of ` stat ` and that in place of a status was read ` databyte `
pub fn next_message_running_status(stat: u8, databyte: u8, reader: &mut dyn Read) -> Result<MidiMessage, MidiError> {
        let mut ret:Vec<u8> = Vec::with_capacity(3);
        ret.push(stat);
        ret.push(databyte);
        match MidiMessage::data_bytes(stat) {
            0 => { panic!("Can't have zero length message with running status"); }
            1 => { } // already read it
            2 => { ret.push(read_byte(reader)?); } // only need one more byte
            -1 => { return Err(MidiError::OtherErr("Don't handle variable sized yet")); }
            -2 => { return Err(MidiError::OtherErr("Running status not permitted with meta and sysex event")); }
            _ =>  { return Err(MidiError::InvalidStatus(stat)); }
        }
        Ok(MidiMessage{data: ret})
    }
pub fn next_message_running_status ( stat : u8 , databyte : u8 , reader : & mut dyn Read ) -> Result < MidiMessage , MidiError > { let mut ret : Vec < u8 > = Vec :: with_capacity ( 3 ) ; ret . push ( stat ) ; ret . push ( databyte ) ; match MidiMessage :: data_bytes ( stat ) { 0 => { panic ! ( " " ) ; } 1 => { } // already read it 2 => { ret . push ( read_byte ( reader ) ? ) ; } // only need one more byte - 1 => { return Err ( MidiError :: OtherErr ( " " ) ) ; } - 2 => { return Err ( MidiError :: OtherErr ( " " ) ) ; } _ => { return Err ( MidiError :: InvalidStatus ( stat ) ) ; } } Ok ( MidiMessage { data : ret } ) }
Get the next midi message from the reader given that there's a running
status of `stat` and that in place of a status was read `databyte`
Get the next midi message from the reader given that there ' s a running status of ` stat ` and that in place of a status was read ` databyte `
stat
u8
databyte
u8
reader
&mut dyn Read
stat
u8
databyte
u8
reader
&mut dyn Read