From 24a38b8b08914636c5fd81646460cc083df5ecb9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 5 Sep 2011 23:38:18 +0000 Subject: Add option to insert time on all a track's playlists (#4304). git-svn-id: svn://localhost/ardour2/branches/3.0@10054 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_playlists.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'libs/ardour/session_playlists.cc') diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index a5772c23e3..1e31801271 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -27,6 +27,7 @@ #include "ardour/playlist_factory.h" #include "ardour/session.h" #include "ardour/source.h" +#include "ardour/track.h" #include "i18n.h" using namespace std; @@ -219,7 +220,7 @@ SessionPlaylists::unassigned (std::list > & list) } void -SessionPlaylists::get (vector >& s) +SessionPlaylists::get (vector >& s) const { Glib::Mutex::Lock lm (lock); @@ -450,3 +451,21 @@ SessionPlaylists::region_use_count (boost::shared_ptr region) const return cnt; } + +/** @return list of Playlists that are associated with a track */ +vector > +SessionPlaylists::playlists_for_track (boost::shared_ptr tr) const +{ + vector > pl; + get (pl); + + vector > pl_tr; + + for (vector >::iterator i = pl.begin(); i != pl.end(); ++i) { + if (((*i)->get_orig_diskstream_id() == tr->diskstream_id()) || (tr->playlist()->id() == (*i)->id())) { + pl_tr.push_back (*i); + } + } + + return pl_tr; +} -- cgit v1.2.3