Remove unused punch+preroll API
[ardour.git] / libs / ardour / ardour / midi_state_tracker.h
index a77ffdada33c28a910d799337bfe51be3055d257..48f9837f94435f83ebcd3fabe8359b6c3f4ad2ac 100644 (file)
@@ -20,6 +20,9 @@
 #ifndef __ardour_midi_state_tracker_h__
 #define __ardour_midi_state_tracker_h__
 
+#include <glibmm/threads.h>
+
+#include "temporal/beats.h"
 #include "ardour/midi_buffer.h"
 
 namespace Evoral {
@@ -38,12 +41,13 @@ class LIBARDOUR_API MidiStateTracker
 public:
        MidiStateTracker();
 
-       void track (const MidiBuffer::iterator& from, const MidiBuffer::iterator& to);
+       void track (const MidiBuffer::const_iterator& from, const MidiBuffer::const_iterator& to);
+       void track (const uint8_t* evbuf);
        void add (uint8_t note, uint8_t chn);
        void remove (uint8_t note, uint8_t chn);
-       void resolve_notes (MidiBuffer& buffer, framepos_t time);
-       void resolve_notes (Evoral::EventSink<framepos_t>& buffer, framepos_t time);
-       void resolve_notes (MidiSource& src, Evoral::MusicalTime time);
+       void resolve_notes (MidiBuffer& buffer, samplepos_t time);
+       void resolve_notes (Evoral::EventSink<samplepos_t>& buffer, samplepos_t time);
+       void resolve_notes (MidiSource& src, const Glib::Threads::Mutex::Lock& lock, Temporal::Beats time);
        void dump (std::ostream&);
        void reset ();
        bool empty() const { return _on == 0; }
@@ -54,19 +58,7 @@ public:
 
        template<typename Time>
        void track (const Evoral::Event<Time>& ev) {
-               const uint8_t type = ev.buffer()[0] & 0xF0;
-               const uint8_t chan = ev.buffer()[0] & 0x0F;
-               switch (type) {
-               case MIDI_CTL_ALL_NOTES_OFF:
-                       reset();
-                       break;
-               case MIDI_CMD_NOTE_ON:
-                       add(ev.buffer()[1], chan);
-                       break;
-               case MIDI_CMD_NOTE_OFF:
-                       remove(ev.buffer()[1], chan);
-                       break;
-               }
+               track (ev.buffer());
        }
 
 private: