pub fn next_event(reader: &mut dyn Read) -> Result<MetaEvent, MetaError> {
        let command =
            match MetaCommand::from_u8(read_byte(reader)?) {
                Some(c) => {c},
                None => MetaCommand::Unknown,
            };
        let len = match SMFReader::read_vtime(reader) {
            Ok(t) => { t }
            Err(_) => { return Err(MetaError::OtherErr("Couldn't read time for meta command")); }
        };
        let mut data = Vec::new();
        read_amount(reader,&mut data,len as usize)?;
        Ok(MetaEvent{
            command: command,
            length: len,
            data: data
        })
    }
/// Extract the next meta event from a reader
Extract the next meta event from a reader
Extract the next meta event from a reader
pub fn next_event(reader: &mut dyn Read) -> Result<MetaEvent, MetaError> {
        let command =
            match MetaCommand::from_u8(read_byte(reader)?) {
                Some(c) => {c},
                None => MetaCommand::Unknown,
            };
        let len = match SMFReader::read_vtime(reader) {
            Ok(t) => { t }
            Err(_) => { return Err(MetaError::OtherErr("Couldn't read time for meta command")); }
        };
        let mut data = Vec::new();
        read_amount(reader,&mut data,len as usize)?;
        Ok(MetaEvent{
            command: command,
            length: len,
            data: data
        })
    }
pub fn next_event ( reader : & mut dyn Read ) -> Result < MetaEvent , MetaError > { let command = match MetaCommand :: from_u8 ( read_byte ( reader ) ? ) { Some ( c ) => { c } , None => MetaCommand :: Unknown , } ; let len = match SMFReader :: read_vtime ( reader ) { Ok ( t ) => { t } Err ( _ ) => { return Err ( MetaError :: OtherErr ( " " ) ) ; } } ; let mut data = Vec :: new ( ) ; read_amount ( reader , & mut data , len as usize ) ? ; Ok ( MetaEvent { command : command , length : len , data : data } ) }
Extract the next meta event from a reader
Extract the next meta event from a reader
reader
&mut dyn Read
reader
&mut dyn Read