diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-01 21:54:54 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-01 21:54:54 +0000 |
commit | b37b23af97fbffbf789222f03247439324648ffb (patch) | |
tree | 743af65391e70da63e39f9e810be17c0db176d4c /libs/ardour/session_playlists.cc | |
parent | 3553ba71fa8c50c05c04e5e067e153e10e386456 (diff) |
improve, cleanup, rationalize Session::cleanup_sources() and supporting infrastructure
git-svn-id: svn://localhost/ardour2/branches/3.0@9015 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_playlists.cc')
-rw-r--r-- | libs/ardour/session_playlists.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index 66b4b53b67..1e5a276ad4 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -26,6 +26,7 @@ #include "ardour/region.h" #include "ardour/playlist_factory.h" #include "ardour/session.h" +#include "ardour/source.h" #include "i18n.h" using namespace std; @@ -246,18 +247,25 @@ uint32_t SessionPlaylists::source_use_count (boost::shared_ptr<const Source> src) const { uint32_t count = 0; + for (List::const_iterator p = playlists.begin(); p != playlists.end(); ++p) { - for (Playlist::RegionList::const_iterator r = (*p)->region_list().begin(); - r != (*p)->region_list().end(); ++r) { - if ((*r)->uses_source(src)) { - ++count; - break; - } - } + if ((*p)->uses_source (src)) { + ++count; + break; + } } return count; } +void +SessionPlaylists::sync_all_regions_with_regions () +{ + Glib::Mutex::Lock lm (lock); + + for (List::const_iterator p = playlists.begin(); p != playlists.end(); ++p) { + (*p)->sync_all_regions_with_regions (); + } +} void SessionPlaylists::update_after_tempo_map_change () |