3 Copyright (C) 2006 Paul Davis
4 Written by Dave Robillard, 2006
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __ardour_midi_model_h__
23 #define __ardour_midi_model_h__
25 #include <boost/utility.hpp>
26 #include <ardour/types.h>
27 #include <ardour/buffer.h>
31 /** A dynamically resizable collection of MIDI events, sorted by time
33 class MidiModel : public boost::noncopyable {
35 MidiModel(size_t size=0);
38 void clear() { _events.clear(); }
40 /** Resizes vector if necessary (NOT realtime safe) */
41 void append(const MidiBuffer& data);
43 /** Resizes vector if necessary (NOT realtime safe) */
44 void append(const MidiEvent& ev);
46 inline const MidiEvent& event_at(unsigned i) const { return _events[i]; }
48 inline size_t n_events() const { return _events.size(); }
51 std::vector<MidiEvent> _events;
54 } /* namespace ARDOUR */
56 #endif /* __ardour_midi_model_h__ */