2 Copyright (C) 2008 Paul Davis
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2 of the License, or (at your option)
10 This program is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_midi_state_tracker_h__
21 #define __ardour_midi_state_tracker_h__
25 #include <ardour/midi_buffer.h>
31 /** Tracks played notes, so they can be resolved in potential stuck note
32 * situations (e.g. looping, transport stop, etc).
34 class MidiStateTracker
39 bool track (const MidiBuffer::iterator& from, const MidiBuffer::iterator& to);
40 void resolve_notes (MidiBuffer& buffer, nframes_t time);
43 void track_note_onoffs(const Evoral::MIDIEvent<MidiBuffer::TimeType>& event);
45 std::bitset<128*16> _active_notes;
51 #endif // __ardour_midi_state_tracker_h__