projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
major fixes to automation editing
[ardour.git]
/
libs
/
ardour
/
source.cc
diff --git
a/libs/ardour/source.cc
b/libs/ardour/source.cc
index eebc64d46392a52804a9e36c02d28c8309d9499c..74ca0afcd4bb932fe36605762cd43a7d7fe85f43 100644
(file)
--- a/
libs/ardour/source.cc
+++ b/
libs/ardour/source.cc
@@
-34,6
+34,7
@@
#include <pbd/pthread_utils.h>
#include <ardour/source.h>
#include <pbd/pthread_utils.h>
#include <ardour/source.h>
+#include <ardour/playlist.h>
#include "i18n.h"
#include "i18n.h"
@@
-42,17
+43,19
@@
using std::max;
using namespace ARDOUR;
using namespace ARDOUR;
-Source::Source (string name)
+Source::Source (Session& s, string name)
+ : _session (s)
{
_name = name;
{
_name = name;
- _use_cnt = 0;
_timestamp = 0;
_timestamp = 0;
+ _in_use = 0;
}
}
-Source::Source (const XMLNode& node)
+Source::Source (Session& s, const XMLNode& node)
+ : _session (s)
{
{
- _use_cnt = 0;
_timestamp = 0;
_timestamp = 0;
+ _in_use = 0;
if (set_state (node)) {
throw failed_constructor();
if (set_state (node)) {
throw failed_constructor();
@@
-61,6
+64,7
@@
Source::Source (const XMLNode& node)
Source::~Source ()
{
Source::~Source ()
{
+ notify_callbacks ();
}
XMLNode&
}
XMLNode&
@@
-70,7
+74,7
@@
Source::get_state ()
char buf[64];
node->add_property ("name", _name);
char buf[64];
node->add_property ("name", _name);
- _id.print (buf);
+ _id.print (buf
, sizeof (buf)
);
node->add_property ("id", buf);
if (_timestamp != 0) {
node->add_property ("id", buf);
if (_timestamp != 0) {
@@
-106,14
+110,23
@@
Source::set_state (const XMLNode& node)
}
void
}
void
-Source::
use (
)
+Source::
add_playlist (Playlist* pl
)
{
{
- _
use_cnt++
;
+ _
playlists.insert (pl)
;
}
void
}
void
-Source::re
lease (
)
+Source::re
move_playlist (Playlist* pl
)
{
{
- if (_use_cnt) --_use_cnt;
+ std::set<Playlist*>::iterator x;
+
+ if ((x = _playlists.find (pl)) != _playlists.end()) {
+ _playlists.erase (x);
+ }
}
}
+uint32_t
+Source::used () const
+{
+ return _playlists.size();
+}