components/prboom/mmus2mid.c
//
// MidiEvent()
//
// Constructs a MIDI event code, and writes it to the current MIDI track
// unless its the same as the last event code and compressio is enabled
// in which case nothing is written.
//
// Passed the Allegro MIDI structure, the midi event code, the current
// MIDI channel number, the current MIDI track number, and whether compression
// (running status) is enabled.
//
// Returns the new event code if successful, 0 if a memory allocation error
//
MidiEvent()
Constructs a MIDI event code, and writes it to the current MIDI track
unless its the same as the last event code and compressio is enabled
in which case nothing is written.

Passed the Allegro MIDI structure, the midi event code, the current
MIDI channel number, the current MIDI track number, and whether compression
(running status) is enabled.

Returns the new event code if successful, 0 if a memory allocation error
MidiEvent () Constructs a MIDI event code and writes it to the current MIDI track unless its the same as the last event code and compressio is enabled in which case nothing is written . Passed the Allegro MIDI structure the midi event code the current MIDI channel number the current MIDI track number and whether compression ( running status ) is enabled . Returns the new event code if successful 0 if a memory allocation error
static UBYTE MidiEvent(MIDI *mididata,UBYTE midicode,UBYTE MIDIchannel,
        UBYTE MIDItrack,int nocomp)
{
  UBYTE newevent;
  newevent = midicode | MIDIchannel;
  if ((newevent != track[MIDItrack].lastEvt) || nocomp)
  {
    if (TWriteByte(mididata,MIDItrack, newevent))
      return 0;                                    
    track[MIDItrack].lastEvt = newevent;
  }
  return newevent;
}
static UBYTE MidiEvent ( MIDI * mididata , UBYTE midicode , UBYTE MIDIchannel , UBYTE MIDItrack , int nocomp ) { UBYTE newevent ; newevent = midicode | MIDIchannel ; if ( ( newevent != track [ MIDItrack ] . lastEvt ) || nocomp ) { if ( TWriteByte ( mididata , MIDItrack , newevent ) ) return 0 ; track [ MIDItrack ] . lastEvt = newevent ; } return newevent ; }
MidiEvent()
Constructs a MIDI event code, and writes it to the current MIDI track
unless its the same as the last event code and compressio is enabled
in which case nothing is written.
MidiEvent () Constructs a MIDI event code and writes it to the current MIDI track unless its the same as the last event code and compressio is enabled in which case nothing is written .
// indicates MEMALLOC error