mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Remove unused MIDI regions as well as audio ones
(#3793). git-svn-id: svn://localhost/ardour2/branches/3.0@10620 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6822b37c7f
commit
301ed17f95
1 changed files with 3 additions and 9 deletions
|
|
@ -2663,16 +2663,10 @@ Session::cleanup_regions ()
|
||||||
|
|
||||||
for (RegionFactory::RegionMap::const_iterator i = regions.begin(); i != regions.end(); ++i) {
|
for (RegionFactory::RegionMap::const_iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||||
|
|
||||||
boost::shared_ptr<AudioRegion> audio_region = boost::dynamic_pointer_cast<AudioRegion>( i->second);
|
uint32_t used = playlists->region_use_count (i->second);
|
||||||
|
|
||||||
if (!audio_region) {
|
if (used == 0 && !i->second->automatic ()) {
|
||||||
continue;
|
RegionFactory::map_remove (i->second);
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t used = playlists->region_use_count (audio_region);
|
|
||||||
|
|
||||||
if (used == 0 && !audio_region->automatic()) {
|
|
||||||
RegionFactory::map_remove(i->second);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue