#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);
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);
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; }
virtual bool destroy_region (boost::shared_ptr<Region>) = 0;
+ /* special case function used by UI selection objects, which have playlists that actually own the regions
+ within them.
+ */
+
+ void drop_regions ();
+
protected:
friend class Session;
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;
bool save_on_thaw;
string last_save_reason;
uint32_t in_set_state;
+ bool first_set_state;
bool _hidden;
bool _splicing;
bool _nudging;
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*);