summaryrefslogtreecommitdiff
path: root/libs/ardour/source.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/source.cc')
-rw-r--r--libs/ardour/source.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc
index 7ade8a8573..74ca0afcd4 100644
--- a/libs/ardour/source.cc
+++ b/libs/ardour/source.cc
@@ -34,6 +34,7 @@
#include <pbd/pthread_utils.h>
#include <ardour/source.h>
+#include <ardour/playlist.h>
#include "i18n.h"
@@ -47,12 +48,14 @@ Source::Source (Session& s, string name)
{
_name = name;
_timestamp = 0;
+ _in_use = 0;
}
Source::Source (Session& s, const XMLNode& node)
: _session (s)
{
_timestamp = 0;
+ _in_use = 0;
if (set_state (node)) {
throw failed_constructor();
@@ -106,3 +109,24 @@ Source::set_state (const XMLNode& node)
return 0;
}
+void
+Source::add_playlist (Playlist* pl)
+{
+ _playlists.insert (pl);
+}
+
+void
+Source::remove_playlist (Playlist* pl)
+{
+ std::set<Playlist*>::iterator x;
+
+ if ((x = _playlists.find (pl)) != _playlists.end()) {
+ _playlists.erase (x);
+ }
+}
+
+uint32_t
+Source::used () const
+{
+ return _playlists.size();
+}