Merge branch 'master' into cairocanvas
[ardour.git] / libs / ardour / ardour / audioplaylist.h
1 /*
2     Copyright (C) 2003 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __ardour_audio_playlist_h__
21 #define __ardour_audio_playlist_h__
22
23 #include <vector>
24 #include <list>
25
26 #include "ardour/ardour.h"
27 #include "ardour/playlist.h"
28
29 namespace ARDOUR  {
30
31 class Session;
32 class Region;
33 class AudioRegion;
34 class Source;
35
36 class AudioPlaylist;
37
38 class AudioPlaylist : public ARDOUR::Playlist
39 {
40 public:
41         AudioPlaylist (Session&, const XMLNode&, bool hidden = false);
42         AudioPlaylist (Session&, std::string name, bool hidden = false);
43         AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, std::string name, bool hidden = false);
44         AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false);
45
46         framecnt_t read (Sample *dst, Sample *mixdown, float *gain_buffer, framepos_t start, framecnt_t cnt, uint32_t chan_n=0);
47
48         bool destroy_region (boost::shared_ptr<Region>);
49
50 protected:
51
52         void pre_combine (std::vector<boost::shared_ptr<Region> >&);
53         void post_combine (std::vector<boost::shared_ptr<Region> >&, boost::shared_ptr<Region>);
54         void pre_uncombine (std::vector<boost::shared_ptr<Region> >&, boost::shared_ptr<Region>);
55
56 private:
57         int set_state (const XMLNode&, int version);
58         void dump () const;
59         bool region_changed (const PBD::PropertyChange&, boost::shared_ptr<Region>);
60         void source_offset_changed (boost::shared_ptr<AudioRegion>);
61         void load_legacy_crossfades (const XMLNode&, int version);
62 };
63
64 } /* namespace ARDOUR */
65
66 #endif  /* __ardour_audio_playlist_h__ */
67
68