Fix incorrectly saved un-used playlists
[ardour.git] / libs / ardour / ardour / session_playlists.h
index 83dc8ee58c7cd12921876e93bd6d486dc36f92a8..865ad9ed3961bd7a0afe70945f1c84830ab89ba3 100644 (file)
@@ -44,7 +44,7 @@ class Session;
 class Crossfade;
 class Track;
 
-class SessionPlaylists : public PBD::ScopedConnectionList
+class LIBARDOUR_API SessionPlaylists : public PBD::ScopedConnectionList
 {
 public:
        ~SessionPlaylists ();
@@ -54,12 +54,16 @@ public:
        uint32_t source_use_count (boost::shared_ptr<const Source> src) const;
        uint32_t region_use_count (boost::shared_ptr<Region> region) const;
        template<class T> void foreach (T *obj, void (T::*func)(boost::shared_ptr<Playlist>));
+       void foreach (boost::function<void(boost::shared_ptr<const Playlist>)> functor, bool incl_unused = true);
        void get (std::vector<boost::shared_ptr<Playlist> >&) const;
        void unassigned (std::list<boost::shared_ptr<Playlist> > & list);
        void destroy_region (boost::shared_ptr<Region>);
        boost::shared_ptr<Crossfade> find_crossfade (const PBD::ID &);
        void sync_all_regions_with_regions ();
        std::vector<boost::shared_ptr<Playlist> > playlists_for_track (boost::shared_ptr<Track>) const;
+       std::vector<boost::shared_ptr<Playlist> > get_used () const;
+       std::vector<boost::shared_ptr<Playlist> > get_unused () const;
+       uint32_t n_playlists() const;
 
 private:
        friend class Session;
@@ -68,11 +72,11 @@ private:
        void remove (boost::shared_ptr<Playlist>);
        void remove_weak (boost::weak_ptr<Playlist>);
        void track (bool, boost::weak_ptr<Playlist>);
+       void update_tracking ();
 
-       uint32_t n_playlists() const;
        void find_equivalent_playlist_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >& result);
        void update_after_tempo_map_change ();
-       void add_state (XMLNode *, bool);
+       void add_state (XMLNode*, bool save_template, bool include_unused);
        bool maybe_delete_unused (boost::function<int(boost::shared_ptr<Playlist>)>);
        int load (Session &, const XMLNode&);
        int load_unused (Session &, const XMLNode&);