Merge branch 'master' into windows
[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 AudioRegion;
33 class Source;
34
35 class AudioPlaylist;
36
37 class AudioPlaylist : public ARDOUR::Playlist
38 {
39 public:
40         AudioPlaylist (Session&, const XMLNode&, bool hidden = false);
41         AudioPlaylist (Session&, std::string name, bool hidden = false);
42         AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, std::string name, bool hidden = false);
43         AudioPlaylist (boost::shared_ptr<const AudioPlaylist>, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false);
44
45         framecnt_t read (Sample *dst, Sample *mixdown, float *gain_buffer, framepos_t start, framecnt_t cnt, uint32_t chan_n=0);
46
47         bool destroy_region (boost::shared_ptr<Region>);
48
49 protected:
50
51         void pre_combine (std::vector<boost::shared_ptr<Region> >&);
52         void post_combine (std::vector<boost::shared_ptr<Region> >&, boost::shared_ptr<Region>);
53         void pre_uncombine (std::vector<boost::shared_ptr<Region> >&, boost::shared_ptr<Region>);
54
55 private:
56         int set_state (const XMLNode&, int version);
57         void dump () const;
58         bool region_changed (const PBD::PropertyChange&, boost::shared_ptr<Region>);
59         void source_offset_changed (boost::shared_ptr<AudioRegion>);
60         void load_legacy_crossfades (const XMLNode&, int version);
61 };
62
63 } /* namespace ARDOUR */
64
65 #endif  /* __ardour_audio_playlist_h__ */
66
67