ardour
midi_playlist.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006 Paul Davis
3  Author: David Robillard
4 
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.
9 
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.
14 
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.
18 */
19 
20 #ifndef __ardour_midi_playlist_h__
21 #define __ardour_midi_playlist_h__
22 
23 #include <vector>
24 #include <list>
25 
26 #include <boost/utility.hpp>
27 
28 #include "ardour/ardour.h"
29 #include "ardour/midi_model.h"
31 #include "ardour/note_fixer.h"
32 #include "ardour/playlist.h"
33 #include "evoral/Beats.hpp"
34 #include "evoral/Note.hpp"
35 #include "evoral/Parameter.hpp"
36 
37 namespace Evoral {
38 template<typename Time> class EventSink;
39 }
40 
41 namespace ARDOUR
42 {
43 
44 class BeatsFramesConverter;
45 class MidiChannelFilter;
46 class MidiRegion;
47 class Session;
48 class Source;
49 
50 template<typename T> class MidiRingBuffer;
51 
53 {
54 public:
55  MidiPlaylist (Session&, const XMLNode&, bool hidden = false);
56  MidiPlaylist (Session&, std::string name, bool hidden = false);
57  MidiPlaylist (boost::shared_ptr<const MidiPlaylist> other, std::string name, bool hidden = false);
58 
62  framecnt_t cnt,
63  std::string name,
64  bool hidden = false);
65 
66  ~MidiPlaylist ();
67 
79  framepos_t start,
80  framecnt_t cnt,
81  uint32_t chan_n = 0,
82  MidiChannelFilter* filter = NULL);
83 
84  int set_state (const XMLNode&, int version);
85 
86  bool destroy_region (boost::shared_ptr<Region>);
87 
88  void set_note_mode (NoteMode m) { _note_mode = m; }
89 
90  std::set<Evoral::Parameter> contained_automation();
91 
98  void region_edited(boost::shared_ptr<Region> region,
99  const MidiModel::NoteDiffCommand* cmd);
100 
102  void reset_note_trackers ();
103 
109  void resolve_note_trackers (Evoral::EventSink<framepos_t>& dst, framepos_t time);
110 
111 protected:
112  void remove_dependents (boost::shared_ptr<Region> region);
113 
114 private:
117 
118  struct RegionTracker : public boost::noncopyable {
121  };
122 
123  typedef std::map< Region*, boost::shared_ptr<RegionTracker> > NoteTrackers;
124 
125  void dump () const;
126 
127  NoteTrackers _note_trackers;
130 };
131 
132 } /* namespace ARDOUR */
133 
134 #endif /* __ardour_midi_playlist_h__ */
135 
136 
NoteMode
Definition: types.h:204
LIBARDOUR_API PBD::PropertyDescriptor< bool > hidden
Definition: route_group.h:50
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
Definition: region.cc:63
int64_t framecnt_t
Definition: types.h:76
NoteFixer fixer
Edit compensation.
Definition: amp.h:29
MidiStateTracker tracker
Active note tracker.
void set_note_mode(NoteMode m)
Definition: midi_playlist.h:88
int64_t framepos_t
Definition: types.h:66
#define LIBARDOUR_API
std::map< Region *, boost::shared_ptr< RegionTracker > > NoteTrackers
const char * name
Definition: xml++.h:95
Evoral::Note< Evoral::Beats > Note
NoteTrackers _note_trackers
Evoral::Event< framepos_t > Event