diff options
author | Robin Gareus <robin@gareus.org> | 2019-03-19 05:27:17 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-03-19 05:27:30 +0100 |
commit | 1f7db603891281c8ce426d7e400a132420a4af5b (patch) | |
tree | 112f6f8299e3b3a456e7d22053d9be3c5448284f /libs/ardour/session_playlists.cc | |
parent | c09c7bab525a63eda1d8a05228160f56b1c94683 (diff) |
Add convenience methods (mainly for scripting)
Diffstat (limited to 'libs/ardour/session_playlists.cc')
-rw-r--r-- | libs/ardour/session_playlists.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index 2f66cd61b2..d0468b981e 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -521,6 +521,34 @@ SessionPlaylists::region_use_count (boost::shared_ptr<Region> region) const return cnt; } +vector<boost::shared_ptr<Playlist> > +SessionPlaylists::get_used () const +{ + vector<boost::shared_ptr<Playlist> > pl; + + Glib::Threads::Mutex::Lock lm (lock); + + for (List::const_iterator i = playlists.begin(); i != playlists.end(); ++i) { + pl.push_back (*i); + } + + return pl; +} + +vector<boost::shared_ptr<Playlist> > +SessionPlaylists::get_unused () const +{ + vector<boost::shared_ptr<Playlist> > pl; + + Glib::Threads::Mutex::Lock lm (lock); + + for (List::const_iterator i = unused_playlists.begin(); i != unused_playlists.end(); ++i) { + pl.push_back (*i); + } + + return pl; +} + /** @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 |