From b37b23af97fbffbf789222f03247439324648ffb Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 1 Mar 2011 21:54:54 +0000 Subject: improve, cleanup, rationalize Session::cleanup_sources() and supporting infrastructure git-svn-id: svn://localhost/ardour2/branches/3.0@9015 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_playlists.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'libs/ardour/session_playlists.cc') 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 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 () -- cgit v1.2.3