21 #ifndef __ardour_midi_state_tracker_h__
22 #define __ardour_midi_state_tracker_h__
24 #include <glibmm/threads.h>
31 template <
typename T>
class EventSink;
32 template <
typename T>
class EventList;
48 virtual void track (
const uint8_t* evbuf);
49 virtual void dump (std::ostream&);
53 void add (uint8_t note, uint8_t chn);
54 void remove (uint8_t note, uint8_t chn);
61 bool empty()
const {
return _on == 0; }
62 uint16_t
on()
const {
return _on; }
63 bool active (uint8_t note, uint8_t channel) {
64 return _active_notes[(channel*128)+note] > 0;
67 template<
typename Time>
73 uint8_t _active_notes[128*16];
86 void track (
const uint8_t* evbuf);
96 uint16_t pressure[16];
97 uint8_t control[16][127];
void track(const Evoral::Event< Time > &ev)
void resolve_notes(MidiSource &src, const Source::WriterLock &lock, Temporal::Beats time)
void track(const MidiBuffer::const_iterator &from, const MidiBuffer::const_iterator &to)
virtual void dump(std::ostream &)
void push_notes(MidiBuffer &dst, samplepos_t time, bool reset, int cmd, int velocity)
void resolve_notes(MidiBuffer &buffer, samplepos_t time, bool reset=true)
virtual ~MidiNoteTracker()
void flush_notes(MidiBuffer &buffer, samplepos_t time, bool reset=true)
void resolve_notes(Evoral::EventSink< samplepos_t > &buffer, samplepos_t time)
void remove(uint8_t note, uint8_t chn)
bool active(uint8_t note, uint8_t channel)
virtual void track(const uint8_t *evbuf)
void add(uint8_t note, uint8_t chn)
void resolve_state(Evoral::EventSink< samplepos_t > &, Evoral::EventList< samplepos_t > const &, samplepos_t time, bool reset=true)
void track(const uint8_t *evbuf)
void dump(std::ostream &)
void flush(MidiBuffer &, samplepos_t, bool reset)
Glib::Threads::RWLock::WriterLock WriterLock
const uint8_t * buffer() const
Temporal::samplepos_t samplepos_t