diff options
author | Carl Hetherington <carl@carlh.net> | 2011-09-05 23:38:18 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-09-05 23:38:18 +0000 |
commit | 24a38b8b08914636c5fd81646460cc083df5ecb9 (patch) | |
tree | 966dd1cb907e5b1e8acbf263b3a23c79c1faa2bc /libs/ardour/session_playlists.cc | |
parent | e3692bf3dab4dc7d9a80ca79f98830cc7f1c0793 (diff) |
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
Diffstat (limited to 'libs/ardour/session_playlists.cc')
-rw-r--r-- | libs/ardour/session_playlists.cc | 21 |
1 files changed, 20 insertions, 1 deletions
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<boost::shared_ptr<Playlist> > & list) } void -SessionPlaylists::get (vector<boost::shared_ptr<Playlist> >& s) +SessionPlaylists::get (vector<boost::shared_ptr<Playlist> >& s) const { Glib::Mutex::Lock lm (lock); @@ -450,3 +451,21 @@ SessionPlaylists::region_use_count (boost::shared_ptr<Region> region) const return cnt; } + +/** @return list of Playlists that are associated with a track */ +vector<boost::shared_ptr<Playlist> > +SessionPlaylists::playlists_for_track (boost::shared_ptr<Track> tr) const +{ + vector<boost::shared_ptr<Playlist> > pl; + get (pl); + + vector<boost::shared_ptr<Playlist> > pl_tr; + + for (vector<boost::shared_ptr<Playlist> >::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; +} |