2 Copyright (C) 2000-2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 $Id: midiregion.h 733 2006-08-01 17:19:38Z drobilla $
21 #ifndef __ardour_midi_region_h__
22 #define __ardour_midi_region_h__
26 #include <pbd/fastlog.h>
29 #include <ardour/ardour.h>
30 #include <ardour/region.h>
31 #include <ardour/gain.h>
32 #include <ardour/logcurve.h>
33 #include <ardour/export.h>
46 class MidiRegion : public Region
51 boost::shared_ptr<MidiSource> midi_source (uint32_t n=0) const;
53 nframes_t read_at (MidiRingBuffer& dst,
57 nframes_t read_frames = 0,
58 nframes_t skip_frames = 0) const;
60 nframes_t master_read_at (MidiRingBuffer& dst,
63 uint32_t chan_n=0) const;
65 XMLNode& state (bool);
66 int set_state (const XMLNode&);
68 int separate_by_channel (ARDOUR::Session&, vector<MidiRegion*>&) const;
70 UndoAction get_memento() const;
73 friend class RegionFactory;
75 MidiRegion (boost::shared_ptr<MidiSource>, nframes_t start, nframes_t length);
76 MidiRegion (boost::shared_ptr<MidiSource>, nframes_t start, nframes_t length, const string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags);
77 MidiRegion (SourceList &, nframes_t start, nframes_t length, const string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags);
78 MidiRegion (boost::shared_ptr<const MidiRegion>, nframes_t start, nframes_t length, const string& name, layer_t = 0, Region::Flag flags = Region::DefaultFlags);
79 MidiRegion (boost::shared_ptr<const MidiRegion>);
80 MidiRegion (boost::shared_ptr<MidiSource>, const XMLNode&);
81 MidiRegion (SourceList &, const XMLNode&);
84 friend class Playlist;
87 nframes_t _read_at (const SourceList&, MidiRingBuffer& dst,
91 nframes_t read_frames = 0,
92 nframes_t skip_frames = 0) const;
94 void recompute_at_start ();
95 void recompute_at_end ();
98 } /* namespace ARDOUR */
101 #endif /* __ardour_midi_region_h__ */