20 #ifndef __ardour_midi_state_tracker_h__
21 #define __ardour_midi_state_tracker_h__
23 #include <glibmm/threads.h>
28 template <
typename T>
class EventSink;
44 void track (
const uint8_t* evbuf);
45 void add (uint8_t note, uint8_t chn);
46 void remove (uint8_t note, uint8_t chn);
50 void dump (std::ostream&);
52 bool empty()
const {
return _on == 0; }
53 uint16_t
on()
const {
return _on; }
54 bool active (uint8_t note, uint8_t channel) {
55 return _active_notes[(channel*128)+note] > 0;
58 template<
typename Time>
64 uint8_t _active_notes[128*16];
71 #endif // __ardour_midi_state_tracker_h__
void track(const Evoral::Event< Time > &ev)
const uint8_t * buffer() const
bool active(uint8_t note, uint8_t channel)