pub fn read_vtime(reader: &mut dyn Read) -> Result<u64,SMFError> {
        let mut res: u64 = 0;
        let mut i = 0;
        let cont_mask = 0x80;
        let val_mask = 0x7F;
        loop {
            i+=1;
            if i > 9 {
                return Err(SMFError::InvalidSMFFile("Variable length value too long"));
            }
            let next = read_byte(reader)?;
            res |= next as u64 & val_mask;
            if (next & cont_mask) == 0 {
                break;
            }
            res = res << 7;
        }
        Ok(res)
    }
/// Read a variable sized value from the reader.
/// This is usually used for the times of midi events but is used elsewhere as well.
Read a variable sized value from the reader.
This is usually used for the times of midi events but is used elsewhere as well.
Read a variable sized value from the reader . This is usually used for the times of midi events but is used elsewhere as well .
pub fn read_vtime(reader: &mut dyn Read) -> Result<u64,SMFError> {
        let mut res: u64 = 0;
        let mut i = 0;
        let cont_mask = 0x80;
        let val_mask = 0x7F;
        loop {
            i+=1;
            if i > 9 {
                return Err(SMFError::InvalidSMFFile("Variable length value too long"));
            }
            let next = read_byte(reader)?;
            res |= next as u64 & val_mask;
            if (next & cont_mask) == 0 {
                break;
            }
            res = res << 7;
        }
        Ok(res)
    }
pub fn read_vtime ( reader : & mut dyn Read ) -> Result < u64 , SMFError > { let mut res : u64 = 0 ; let mut i = 0 ; let cont_mask = 0x80 ; let val_mask = 0x7F ; loop { i += 1 ; if i > 9 { return Err ( SMFError :: InvalidSMFFile ( " " ) ) ; } let next = read_byte ( reader ) ? ; res |= next as u64 & val_mask ; if ( next & cont_mask ) == 0 { break ; } res = res << 7 ; } Ok ( res ) }
Read a variable sized value from the reader.
Read a variable sized value from the reader .
reader
&mut dyn Read
reader
&mut dyn Read