};
Playlist::Playlist (Session& sess, string nom, DataType type, bool hide)
- : _session (sess)
+ : SessionObject(sess, nom)
, _type(type)
{
init (hide);
}
Playlist::Playlist (Session& sess, const XMLNode& node, DataType type, bool hide)
- : _session (sess)
+ : SessionObject(sess, "unnamed playlist")
, _type(type)
{
const XMLProperty* prop = node.property("type");
}
Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, bool hide)
- : _name (namestr), _session (other->_session), _type(other->_type), _orig_diskstream_id(other->_orig_diskstream_id)
+ : SessionObject(other->_session, namestr), _type(other->_type), _orig_diskstream_id(other->_orig_diskstream_id)
{
init (hide);
}
Playlist::Playlist (boost::shared_ptr<const Playlist> other, nframes_t start, nframes_t cnt, string str, bool hide)
- : _name (str), _session (other->_session), _type(other->_type), _orig_diskstream_id(other->_orig_diskstream_id)
+ : SessionObject(other->_session, str), _type(other->_type), _orig_diskstream_id(other->_orig_diskstream_id)
{
RegionLock rlock2 (const_cast<Playlist*> (other.get()));
RegionLock rlock (const_cast<Playlist *> (this));
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
- if (!(*i)->is_dependent()) {
- newlist.push_back (RegionFactory::RegionFactory::create (*i));
- }
+ newlist.push_back (RegionFactory::RegionFactory::create (*i));
}
}
}
Playlist::Playlist (const Playlist& pl)
- : _session (pl._session)
+ : SessionObject(pl._session, pl._name)
, _type(pl.data_type())
{
fatal << _("playlist const copy constructor called") << endmsg;
}
Playlist::Playlist (Playlist& pl)
- : _session (pl._session)
+ : SessionObject(pl._session, pl._name)
, _type(pl.data_type())
{
fatal << _("playlist non-const copy constructor called") << endmsg;
/* GoingAway must be emitted by derived classes */
}
-void
-Playlist::set_name (string str)
+bool
+Playlist::set_name (const string& str)
{
/* in a typical situation, a playlist is being used
by one diskstream and also is referenced by the
*/
if (_refcnt > 2) {
- return;
+ return false;
+ } else {
+ return SessionObject::set_name(str);
}
-
- _name = str;
- NameChanged(); /* EMIT SIGNAL */
}
/***********************************************************************
child = *niter;
- if (child->name() == Region::node_name()) {
+ if (child->name() == "Region") {
if ((prop = child->property ("id")) == 0) {
error << _("region state node has no ID, ignored") << endmsg;
for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) {
- if ((*i)->is_dependent()) {
- /* handle dependent regions in a later pass */
- continue;
- }
-
/* find the lowest layer that this region can go on */
size_t j = layers.size();
while (j > 0) {
}
}
- /* second pass: set up layer numbers for all dependent regions */
-
- for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) {
-
- cerr << "pass 2, looking at " << (*i)->name() << " dep? " << (*i)->is_dependent() << endl;
-
- if ((*i)->is_dependent()) {
-
- size_t one_higher = (*i)->upper_layer() + 1;
-
- cerr << "Setting xfade to " << one_higher << endl;
-
- (*i)->set_layer (one_higher);
-
- if (one_higher < layers.size()) {
-
- /* find the layer list representing the next higher layer */
-
- vector<RegionList>::iterator x = layers.begin();
- for (size_t n = 0; n < one_higher; ++n) {
- ++x;
- }
-
- /* add a new layer list containing just the dependent region
- we set the layer for
- */
-
- layers.insert (x, RegionList());
- layers[one_higher].push_back (*i);
-
- /* move everything on higher layers one layer higher */
-
- for (size_t j = one_higher; j < layers.size(); ++j) {
- for (RegionList::iterator i = layers[j].begin(); i != layers[j].end(); ++i) {
- cerr << "Bumping " << (*i)->name() << " to " << j << endl;
- (*i)->set_layer (j);
- }
- }
- }
-
-
- }
- }
-
/* sending Modified means that various kinds of layering
models operate correctly at the GUI
level. slightly inefficient, but only slightly.