summaryrefslogtreecommitdiff
path: root/libs/ardour/session_playlists.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-28 15:05:48 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-28 15:05:56 -0400
commit54d5f36311d041ce3d5fa3e6ed14fde30bcb70b7 (patch)
tree8bb084f1feea765dd33de4ace30c0c1030da40fc /libs/ardour/session_playlists.cc
parentdbb26485df31bbf3bd0aeb83e3e01d42e25fbd07 (diff)
changes in logic used by source cleanup to avoid endless recursion in sessions with deeply nested/recursive compound regions.
This also fixes some potentially dangerous cleanup logic related to two sources with the same name (but different paths)
Diffstat (limited to 'libs/ardour/session_playlists.cc')
-rw-r--r--libs/ardour/session_playlists.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc
index 649d42902b..c2e0461546 100644
--- a/libs/ardour/session_playlists.cc
+++ b/libs/ardour/session_playlists.cc
@@ -260,6 +260,7 @@ SessionPlaylists::source_use_count (boost::shared_ptr<const Source> src) const
{
uint32_t count = 0;
+ cerr << "\t\tcheck " << playlists.size() << " playlists\n";
for (List::const_iterator p = playlists.begin(); p != playlists.end(); ++p) {
if ((*p)->uses_source (src)) {
++count;
@@ -267,6 +268,7 @@ SessionPlaylists::source_use_count (boost::shared_ptr<const Source> src) const
}
}
+ cerr << "\t\tcheck " << playlists.size() << " unused playlists\n";
for (List::const_iterator p = unused_playlists.begin(); p != unused_playlists.end(); ++p) {
if ((*p)->uses_source (src)) {
++count;
@@ -500,3 +502,20 @@ SessionPlaylists::playlists_for_track (boost::shared_ptr<Track> tr) const
return pl_tr;
}
+
+void
+SessionPlaylists::foreach (boost::function<void(boost::shared_ptr<const Playlist>)> functor)
+{
+ Glib::Threads::Mutex::Lock lm (lock);
+ for (List::iterator i = playlists.begin(); i != playlists.end(); i++) {
+ if (!(*i)->hidden()) {
+ functor (*i);
+ }
+ }
+ for (List::iterator i = unused_playlists.begin(); i != unused_playlists.end(); i++) {
+ if (!(*i)->hidden()) {
+ functor (*i);
+ }
+ }
+}
+