2 Copyright (C) 2003 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.
21 #ifndef __ardour_audio_playlist_h__
22 #define __ardour_audio_playlist_h__
27 #include <ardour/ardour.h>
28 #include <ardour/playlist.h>
37 class AudioPlaylist : public ARDOUR::Playlist
40 typedef std::list<Crossfade*> Crossfades;
43 AudioPlaylist (Session&, const XMLNode&, bool hidden = false);
44 AudioPlaylist (Session&, string name, bool hidden = false);
45 AudioPlaylist (const AudioPlaylist&, string name, bool hidden = false);
46 AudioPlaylist (const AudioPlaylist&, nframes_t start, nframes_t cnt, string name, bool hidden = false);
48 void clear (bool with_signals=true);
50 nframes_t read (Sample *dst, Sample *mixdown, float *gain_buffer, nframes_t start, nframes_t cnt, uint32_t chan_n=0);
52 int set_state (const XMLNode&);
54 sigc::signal<void,Crossfade *> NewCrossfade;
56 template<class T> void foreach_crossfade (T *t, void (T::*func)(Crossfade *));
57 void crossfades_at (nframes_t frame, Crossfades&);
59 bool destroy_region (boost::shared_ptr<Region>);
63 /* playlist "callbacks" */
64 void notify_crossfade_added (Crossfade *);
65 void flush_notifications ();
67 void finalize_split_region (boost::shared_ptr<Region> orig, boost::shared_ptr<Region> left, boost::shared_ptr<Region> right);
69 void refresh_dependents (boost::shared_ptr<Region> region);
70 void check_dependents (boost::shared_ptr<Region> region, bool norefresh);
71 void remove_dependents (boost::shared_ptr<Region> region);
74 ~AudioPlaylist (); /* public should use unref() */
77 Crossfades _crossfades; /* xfades currently in use */
78 Crossfades _pending_xfade_adds;
80 void crossfade_invalidated (Crossfade*);
81 XMLNode& state (bool full_state);
84 bool region_changed (Change, boost::shared_ptr<Region>);
85 void crossfade_changed (Change);
86 void add_crossfade (Crossfade&);
88 void source_offset_changed (boost::shared_ptr<AudioRegion> region);
91 } /* namespace ARDOUR */
93 #endif /* __ardour_audio_playlist_h__ */