13
0

Add convenience methods (mainly for scripting)

This commit is contained in:
Robin Gareus 2019-03-19 05:27:17 +01:00
parent c09c7bab52
commit 1f7db60389
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 30 additions and 0 deletions

View File

@ -61,6 +61,8 @@ public:
boost::shared_ptr<Crossfade> find_crossfade (const PBD::ID &);
void sync_all_regions_with_regions ();
std::vector<boost::shared_ptr<Playlist> > playlists_for_track (boost::shared_ptr<Track>) const;
std::vector<boost::shared_ptr<Playlist> > get_used () const;
std::vector<boost::shared_ptr<Playlist> > get_unused () const;
uint32_t n_playlists() const;
private:

View File

@ -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