diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-11-09 20:38:39 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-11-09 20:38:39 +0000 |
commit | 0c4c6e031a3624cfc74c2eef6e79527b7c49eca8 (patch) | |
tree | f2f9e7c1184723073075ff1ad4a3f023b1c51399 /libs/ardour/audio_playlist.cc | |
parent | f7ccc404b38946c89d74e9776226b8ab4f0f6a05 (diff) |
first pass on track mode switch; fixes to dangling region refs after capture; destroy region menu item removed; small fix to SConstruct for missing C++ case; playlist selection mechanism modified ; new Selection operation added (Add); handle crashing situation with align style change handling caused by recursion
git-svn-id: svn://localhost/ardour2/trunk@1099 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_playlist.cc')
-rw-r--r-- | libs/ardour/audio_playlist.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index 290907746b..5118aab684 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -624,12 +624,10 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region) { RegionLock rlock (this); - RegionList::iterator i; - RegionList::iterator tmp; - for (i = regions.begin(); i != regions.end(); ) { + for (RegionList::iterator i = regions.begin(); i != regions.end(); ) { - tmp = i; + RegionList::iterator tmp = i; ++tmp; if ((*i) == region) { @@ -639,6 +637,21 @@ AudioPlaylist::destroy_region (boost::shared_ptr<Region> region) i = tmp; } + + for (set<boost::shared_ptr<Region> >::iterator x = all_regions.begin(); x != all_regions.end(); ) { + + set<boost::shared_ptr<Region> >::iterator xtmp = x; + ++xtmp; + + if ((*x) == region) { + all_regions.erase (x); + changed = true; + } + + x = xtmp; + } + + region->set_playlist (0); } for (c = _crossfades.begin(); c != _crossfades.end(); ) { |