pub(crate) fn read_channel(&mut self, data: &[u8], seek: &mut usize) -> usize { //TODO: fixme for writing
        let index          = read_int(data, seek) - 1;
        let effect_channel = read_int(data, seek) - 1;
        if 0 <= index && index < self.channels.len().to_i32().unwrap() {
            if  self.channels[index.to_usize().unwrap()].instrument < 0 {self.channels[index.to_usize().unwrap()].instrument = 0;}
            if !self.channels[index.to_usize().unwrap()].is_percussion_channel() {self.channels[index.to_usize().unwrap()].effect_channel =  effect_channel.to_u8().unwrap();}
        }
        index.to_usize().unwrap()
    }
/// Read MIDI channel. MIDI channel in Guitar Pro is represented by two integers. First is zero-based number of channel, second is zero-based number of channel used for effects.
Read MIDI channel. MIDI channel in Guitar Pro is represented by two integers. First is zero-based number of channel, second is zero-based number of channel used for effects.
Read MIDI channel . MIDI channel in Guitar Pro is represented by two integers . First is zero - based number of channel second is zero - based number of channel used for effects .
pub(crate) fn read_channel(&mut self, data: &[u8], seek: &mut usize) -> usize { //TODO: fixme for writing
        let index          = read_int(data, seek) - 1;
        let effect_channel = read_int(data, seek) - 1;
        if 0 <= index && index < self.channels.len().to_i32().unwrap() {
            if  self.channels[index.to_usize().unwrap()].instrument < 0 {self.channels[index.to_usize().unwrap()].instrument = 0;}
            if !self.channels[index.to_usize().unwrap()].is_percussion_channel() {self.channels[index.to_usize().unwrap()].effect_channel =  effect_channel.to_u8().unwrap();}
        }
        index.to_usize().unwrap()
    }
pub ( crate ) fn read_channel ( & mut self , data : & [ u8 ] , seek : & mut usize ) -> usize { //TODO: fixme for writing let index = read_int ( data , seek ) - 1 ; let effect_channel = read_int ( data , seek ) - 1 ; if 0 <= index && index < self . channels . len ( ) . to_i32 ( ) . unwrap ( ) { if self . channels [ index . to_usize ( ) . unwrap ( ) ] . instrument < 0 { self . channels [ index . to_usize ( ) . unwrap ( ) ] . instrument = 0 ; } if ! self . channels [ index . to_usize ( ) . unwrap ( ) ] . is_percussion_channel ( ) { self . channels [ index . to_usize ( ) . unwrap ( ) ] . effect_channel = effect_channel . to_u8 ( ) . unwrap ( ) ; } } index . to_usize ( ) . unwrap ( ) }
Read MIDI channel.
Read MIDI channel .
&mut self
data
&[u8]
seek
&mut usize
&mut self
data
&[u8]
seek
&mut usize