diff options
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r-- | libs/ardour/playlist.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 325ef27a18..0d743a5c9d 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -75,6 +75,7 @@ Playlist::Playlist (Session& sess, string nom, DataType type, bool hide) , _type(type) { init (hide); + first_set_state = false; _name = nom; } @@ -113,6 +114,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, boo _edit_mode = other->_edit_mode; in_set_state = 0; + first_set_state = false; in_flush = false; in_partition = false; subcnt = 0; @@ -185,6 +187,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, nframes_t start, nf } in_set_state--; + first_set_state = false; /* this constructor does NOT notify others (session) */ } @@ -225,6 +228,7 @@ Playlist::init (bool hide) g_atomic_int_set (&ignore_state_changes, 0); pending_modified = false; pending_length = false; + first_set_state = true; _refcnt = 0; _hidden = hide; _splicing = false; @@ -515,10 +519,10 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, nframes_t posit old_length = _get_maximum_extent(); } - if (!in_set_state) { + if (!first_set_state) { boost::shared_ptr<Playlist> foo (shared_from_this()); region->set_playlist (boost::weak_ptr<Playlist>(foo)); - } + } region->set_position (position, this); @@ -581,6 +585,11 @@ Playlist::remove_region_internal (boost::shared_ptr<Region>region) old_length = _get_maximum_extent(); } + if (!in_set_state) { + /* unset playlist */ + region->set_playlist (boost::weak_ptr<Playlist>()); + } + for (i = regions.begin(); i != regions.end(); ++i) { if (*i == region) { @@ -1182,6 +1191,14 @@ Playlist::region_changed (Change what_changed, boost::shared_ptr<Region> region) } void +Playlist::drop_regions () +{ + RegionLock rl (this); + regions.clear (); + all_regions.clear (); +} + +void Playlist::clear (bool with_signals) { { @@ -1412,7 +1429,7 @@ Playlist::set_state (const XMLNode& node) } in_set_state--; - + first_set_state = false; return 0; } |