X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Faudioplaylist.h;h=478d4872cdfe02afdd56503e3babc7a83b6a1871;hb=25ca45f3959d5838a9c637ecc8687511d835140b;hp=bd76c3028976456eeaf82c93403062c8c3758f4f;hpb=1a03f9440d11d74d291737d5b98e5624023860ac;p=ardour.git diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h index bd76c30289..478d4872cd 100644 --- a/libs/ardour/ardour/audioplaylist.h +++ b/libs/ardour/ardour/audioplaylist.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2003 Paul Davis + Copyright (C) 2003 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_audio_playlist_h__ @@ -24,8 +23,8 @@ #include #include -#include -#include +#include "ardour/ardour.h" +#include "ardour/playlist.h" namespace ARDOUR { @@ -34,83 +33,32 @@ class Region; class AudioRegion; class Source; +class AudioPlaylist; + class AudioPlaylist : public ARDOUR::Playlist { - public: - typedef std::list Crossfades; - - private: - - struct State : public ARDOUR::StateManager::State { - RegionList regions; - std::list region_states; - - Crossfades crossfades; - std::list crossfade_states; - - State (std::string why) : ARDOUR::StateManager::State (why) {} - ~State (); - }; - - public: +public: AudioPlaylist (Session&, const XMLNode&, bool hidden = false); - AudioPlaylist (Session&, string name, bool hidden = false); - AudioPlaylist (const AudioPlaylist&, string name, bool hidden = false); - AudioPlaylist (const AudioPlaylist&, jack_nframes_t start, jack_nframes_t cnt, string name, bool hidden = false); - - void clear (bool with_delete = false, bool with_save = true); - - jack_nframes_t read (Sample *dst, Sample *mixdown, float *gain_buffer, jack_nframes_t start, jack_nframes_t cnt, uint32_t chan_n=0); - - int set_state (const XMLNode&); - UndoAction get_memento() const; - - sigc::signal NewCrossfade; - - template void foreach_crossfade (T *t, void (T::*func)(Crossfade *)); - void crossfades_at (jack_nframes_t frame, Crossfades&); - - template void apply_to_history (T& obj, void (T::*method)(const ARDOUR::StateManager::StateMap&, state_id_t)) { - RegionLock rlock (this); - (obj.*method) (states, _current_state_id); - } - - bool destroy_region (Region*); - - void drop_all_states (); - - protected: - - /* state management */ - - StateManager::State* state_factory (std::string) const; - Change restore_state (StateManager::State&); - void send_state_change (Change); - - /* playlist "callbacks" */ - void notify_crossfade_added (Crossfade *); - void flush_notifications (); + AudioPlaylist (Session&, std::string name, bool hidden = false); + AudioPlaylist (boost::shared_ptr, std::string name, bool hidden = false); + AudioPlaylist (boost::shared_ptr, framepos_t start, framecnt_t cnt, std::string name, bool hidden = false); - void finalize_split_region (Region *orig, Region *left, Region *right); - - void refresh_dependents (Region& region); - void check_dependents (Region& region, bool norefresh); - void remove_dependents (Region& region); + framecnt_t read (Sample *dst, Sample *mixdown, float *gain_buffer, framepos_t start, framecnt_t cnt, uint32_t chan_n=0); - protected: - ~AudioPlaylist (); /* public should use unref() */ + bool destroy_region (boost::shared_ptr); - private: - Crossfades _crossfades; - Crossfades _pending_xfade_adds; +protected: - void crossfade_invalidated (Crossfade*); - XMLNode& state (bool full_state); - void dump () const; + void pre_combine (std::vector >&); + void post_combine (std::vector >&, boost::shared_ptr); + void pre_uncombine (std::vector >&, boost::shared_ptr); - bool region_changed (Change, Region*); - void crossfade_changed (Change); - void add_crossfade (Crossfade&); +private: + int set_state (const XMLNode&, int version); + void dump () const; + bool region_changed (const PBD::PropertyChange&, boost::shared_ptr); + void source_offset_changed (boost::shared_ptr); + void load_legacy_crossfades (const XMLNode&, int version); }; } /* namespace ARDOUR */