summaryrefslogtreecommitdiff
path: root/libs/ardour/source.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-11-19 16:45:16 +0000
committerDavid Robillard <d@drobilla.net>2006-11-19 16:45:16 +0000
commitef6b25432d9c46d71b08c0f7d5f2686df428c4e8 (patch)
tree9b30d87b6670aadce365c9b112321dd674a0bab4 /libs/ardour/source.cc
parentaf105afe6cde5b0088647cea7d5e4e3314f8478b (diff)
Merged with trunk R1141
git-svn-id: svn://localhost/ardour2/branches/midi@1142 d708f5d6-7413-0410-9779-e7cbd77b26cf
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 86ca0c55f2..8f0afd3507 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"
@@ -51,6 +52,7 @@ Source::Source (Session& s, string name, DataType type)
_name = name;
_timestamp = 0;
_length = 0;
+ _in_use = 0;
}
Source::Source (Session& s, const XMLNode& node)
@@ -59,6 +61,7 @@ Source::Source (Session& s, const XMLNode& node)
{
_timestamp = 0;
_length = 0;
+ _in_use = 0;
if (set_state (node) || _type == DataType::NIL) {
throw failed_constructor();
@@ -127,3 +130,24 @@ Source::update_length (jack_nframes_t pos, jack_nframes_t cnt)
}
}
+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();
+}