bool MIDIFileReadMultiTrack::mf_metamisc ( MIDIClockTime time, int type, int len, unsigned char *data ) // funcVRM { // code for all miscellaneous meta events MIDITimedMessage msg; msg.SetTime ( time ); msg.SetStatus( META_EVENT ); msg.SetByte1( type ); if ( len <= 5 ) { if ( len > 0 ) msg.SetByte2( data[0] ); if ( len > 1 ) msg.SetByte3( data[1] ); if ( len > 2 ) msg.SetByte4( data[2] ); if ( len > 3 ) msg.SetByte5( data[3] ); if ( len > 4 ) msg.SetByte6( data[4] ); } // else msg add to track, but do'nt write to output midifile! msg.SetDataLength( len ); return AddEventToMultiTrack ( msg, 0, cur_track ); }
bool MIDIFileReadMultiTrack::mf_eot ( MIDIClockTime time ) // VRM { MIDITimedMessage msg; msg.SetStatus ( META_EVENT ); msg.SetMetaType ( META_END_OF_TRACK ); // VRM msg.SetTime ( time ); msg.SetDataLength( 0 ); // VRM return AddEventToMultiTrack ( msg, 0, cur_track ); // VRM }
void MIDIFileReadMultiTrack::mf_eot ( MIDIClockTime time ) { MIDITimedMessage msg; msg.SetStatus ( META_EVENT ); msg.SetMetaType ( META_END_OF_TRACK ); msg.SetTime ( time ); AddEventToMultiTrack ( msg, 0, cur_track ); }
bool MIDIFileReadMultiTrack::mf_text ( MIDIClockTime time, int type, int len, unsigned char *s ) // VRM { MIDITimedMessage msg; msg.SetStatus ( META_EVENT ); msg.SetMetaType ( ( uchar ) type ); // remember - MF_META_* id codes match META_* codes msg.SetTime ( time ); MIDISystemExclusive sysex( len ); // VRM for ( int i = 0; i < len; ++i ) { sysex.PutSysByte ( s[i] ); // VRM } msg.SetDataLength( 0 ); // VRM // variable data length don't saved to data_length return AddEventToMultiTrack ( msg, &sysex, cur_track ); // VRM }
void MIDIFileReadMultiTrack::mf_text ( MIDIClockTime time, int type, int len, unsigned char *s ) { MIDITimedMessage msg; msg.SetStatus ( META_EVENT ); msg.SetMetaType ( ( uchar ) type ); // remember - MF_*_TEXT* id codes match META_*_TEXT codes msg.SetTime ( time ); MIDISystemExclusive *sysex = new MIDISystemExclusive ( len ); for ( int i=0; i<len; ++i ) { sysex->PutSysByte ( s[i] ); } AddEventToMultiTrack ( msg, sysex, cur_track ); }