/* Copyright (C) 2009 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __ardour_session_playlists_h__ #define __ardour_session_playlists_h__ #include #include #include #include #include #include #include "pbd/signals.h" class XMLNode; namespace PBD { class ID; } namespace ARDOUR { class Playlist; class Region; class Source; class Session; class Crossfade; class Track; class LIBARDOUR_API SessionPlaylists : public PBD::ScopedConnectionList { public: ~SessionPlaylists (); boost::shared_ptr by_name (std::string name); boost::shared_ptr by_id (const PBD::ID&); uint32_t source_use_count (boost::shared_ptr src) const; uint32_t region_use_count (boost::shared_ptr region) const; template void foreach (T *obj, void (T::*func)(boost::shared_ptr)); void foreach (boost::function)> functor, bool incl_unused = true); void get (std::vector >&) const; void unassigned (std::list > & list); void destroy_region (boost::shared_ptr); boost::shared_ptr find_crossfade (const PBD::ID &); void sync_all_regions_with_regions (); std::vector > playlists_for_track (boost::shared_ptr) const; uint32_t n_playlists() const; private: friend class Session; bool add (boost::shared_ptr); void remove (boost::shared_ptr); void remove_weak (boost::weak_ptr); void track (bool, boost::weak_ptr); void find_equivalent_playlist_regions (boost::shared_ptr, std::vector >& result); void update_after_tempo_map_change (); void add_state (XMLNode *, bool); bool maybe_delete_unused (boost::function)>); int load (Session &, const XMLNode&); int load_unused (Session &, const XMLNode&); boost::shared_ptr XMLPlaylistFactory (Session &, const XMLNode&); mutable Glib::Threads::Mutex lock; typedef std::set > List; List playlists; List unused_playlists; }; } #endif