midisync.cpp
// Returns whether a NoteOn event has occurred on a given channel, and the note MIDI-code / velocity (should be called AFTER update)

Returns whether a NoteOn event has occurred on a given channel, and the note MIDI-code / velocity (should be called AFTER update)
Returns whether a NoteOn event has occurred on a given channel and the note MIDI - code / velocity ( should be called AFTER update )
bool MIDISong::IsNoteOn(uint32_t channel, uint8_t &note, uint8_t &velocity)
{
  if (channel >= m_tracks.size())
    return false;
  for (map<uint32_t, MIDIEvent*>::iterator iter = m_currentEvents.begin(); iter != m_currentEvents.end(); ++iter)
  {
    if ((*iter).first == channel)
    {
      note = (*iter).second->GetParam1();
      velocity = (*iter).second->GetParam2();
      return true;
    }      
  }
  return false;
}
bool MIDISong :: IsNoteOn ( uint32_t channel , uint8_t & note , uint8_t & velocity ) { if ( channel >= m_tracks . size ( ) ) return false ; for ( map < uint32_t , MIDIEvent * > :: iterator iter = m_currentEvents . begin ( ) ; iter != m_currentEvents . end ( ) ; ++ iter ) { if ( ( * iter ) . first == channel ) { note = ( * iter ) . second -> GetParam1 ( ) ; velocity = ( * iter ) . second -> GetParam2 ( ) ; return true ; } } return false ; }
Returns whether a NoteOn event has occurred on a given channel, and the note MIDI-code / velocity (should be called AFTER update)
Returns whether a NoteOn event has occurred on a given channel and the note MIDI - code / velocity ( should be called AFTER update )