2 Copyright (C) 2006 Paul Davis
3 Written by Dave Robillard, 2006
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_midi_playlist_h__
21 #define __ardour_midi_playlist_h__
26 #include "ardour/ardour.h"
27 #include "ardour/playlist.h"
28 #include "ardour/midi_state_tracker.h"
29 #include "evoral/Parameter.hpp"
38 template<typename T> class MidiRingBuffer;
40 class MidiPlaylist : public ARDOUR::Playlist
43 MidiPlaylist (Session&, const XMLNode&, bool hidden = false);
44 MidiPlaylist (Session&, std::string name, bool hidden = false);
45 MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, std::string name, bool hidden = false);
46 MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, nframes_t start, nframes_t cnt,
47 std::string name, bool hidden = false);
51 nframes_t read (MidiRingBuffer<nframes_t>& buf,
52 nframes_t start, nframes_t cnt, uint32_t chan_n=0);
54 int set_state (const XMLNode&, int version);
56 bool destroy_region (boost::shared_ptr<Region>);
58 void set_note_mode (NoteMode m) { _note_mode = m; }
60 std::set<Evoral::Parameter> contained_automation();
62 void clear_note_trackers ();
66 /* playlist "callbacks" */
68 void finalize_split_region (boost::shared_ptr<Region> original, boost::shared_ptr<Region> left, boost::shared_ptr<Region> right);
70 void check_dependents (boost::shared_ptr<Region> region, bool norefresh);
71 void refresh_dependents (boost::shared_ptr<Region> region);
72 void remove_dependents (boost::shared_ptr<Region> region);
77 bool region_changed (PBD::Change, boost::shared_ptr<Region>);
81 typedef std::map<Region*,MidiStateTracker*> NoteTrackers;
82 NoteTrackers _note_trackers;
86 } /* namespace ARDOUR */
88 #endif /* __ardour_midi_playlist_h__ */