use XML state to store processors in mixer (strips) and fixup crash caused by missing...
[ardour.git] / libs / ardour / ardour / playlist.h
index 103e95929e2a7d347aece186d3440dd2f4884a63..55947a84a5779ac85494f50729c7812a26c83c5c 100644 (file)
 #include <pbd/statefuldestructible.h> 
 
 #include <ardour/ardour.h>
+#include <ardour/session_object.h>
 #include <ardour/crossfade_compare.h>
 #include <ardour/location.h>
+#include <ardour/data_type.h>
 
 namespace ARDOUR  {
 
 class Session;
 class Region;
 
-class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_from_this<Playlist> {
+class Playlist : public SessionObject, public boost::enable_shared_from_this<Playlist> {
   public:
        typedef list<boost::shared_ptr<Region> >    RegionList;
 
-       Playlist (Session&, const XMLNode&, bool hidden = false);
-       Playlist (Session&, string name, bool hidden = false);
+       Playlist (Session&, const XMLNode&, DataType type, bool hidden = false);
+       Playlist (Session&, string name, DataType type, bool hidden = false);
        Playlist (boost::shared_ptr<const Playlist>, string name, bool hidden = false);
        Playlist (boost::shared_ptr<const Playlist>, nframes_t start, nframes_t cnt, string name, bool hidden = false);
 
@@ -66,8 +68,9 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
        void release();
        bool used () const { return _refcnt != 0; }
 
-       std::string name() const { return _name; }
-       void set_name (std::string str);
+       bool set_name (const string& str);
+
+       const DataType& data_type() const { return _type; }
 
        bool frozen() const { return _frozen; }
        void set_frozen (bool yn);
@@ -122,15 +125,11 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
        void freeze ();
        void thaw ();
 
-       void raise_region (boost::shared_ptr<Region>);
-       void lower_region (boost::shared_ptr<Region>);
        void raise_region_to_top (boost::shared_ptr<Region>);
        void lower_region_to_bottom (boost::shared_ptr<Region>);
 
        uint32_t read_data_count() const { return _read_data_count; }
 
-       Session& session() { return _session; }
-
        const PBD::ID& get_orig_diskstream_id () const { return _orig_diskstream_id; }
        void set_orig_diskstream_id (const PBD::ID& did) { _orig_diskstream_id = did; }  
 
@@ -169,8 +168,7 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 
        RegionList       regions;  /* the current list of regions in the playlist */
        std::set<boost::shared_ptr<Region> > all_regions; /* all regions ever added to this playlist */
-       string          _name;
-       Session&        _session;
+       DataType        _type;
        mutable gint    block_notifications;
        mutable gint    ignore_state_changes;
        mutable Glib::Mutex region_lock;
@@ -182,6 +180,7 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
        bool             save_on_thaw;
        string           last_save_reason;
        uint32_t         in_set_state;
+       bool             first_set_state;
        bool            _hidden;
        bool            _splicing;
        bool            _nudging;
@@ -260,8 +259,6 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
        boost::shared_ptr<Playlist> cut (nframes_t start, nframes_t cnt, bool result_is_hidden);
        boost::shared_ptr<Playlist> copy (nframes_t start, nframes_t cnt, bool result_is_hidden);
 
-
-       int move_region_to_layer (layer_t, boost::shared_ptr<Region> r, int dir);
        void relayer ();
        
        void unset_freeze_parent (Playlist*);