display results of a bounce in the region list
[ardour.git] / libs / ardour / source.cc
index 0d32ea4a216ec6134dbb93281819747bd24ec8c5..7ade8a8573fdd7db1187520cd62cd6b3c0057dfc 100644 (file)
@@ -42,17 +42,16 @@ using std::max;
 
 using namespace ARDOUR;
 
-Source::Source (string name)
+Source::Source (Session& s, string name)
+       : _session (s)
 {
        _name = name;
-       _id = ARDOUR::new_id();
-       _use_cnt = 0;
        _timestamp = 0;
 }
 
-Source::Source (const XMLNode& node) 
+Source::Source (Session& s, const XMLNode& node) 
+       : _session (s)
 {
-       _use_cnt = 0;
        _timestamp = 0;
 
        if (set_state (node)) {
@@ -62,6 +61,7 @@ Source::Source (const XMLNode& node)
 
 Source::~Source ()
 {
+       notify_callbacks ();
 }
 
 XMLNode&
@@ -71,7 +71,7 @@ Source::get_state ()
        char buf[64];
 
        node->add_property ("name", _name);
-       snprintf (buf, sizeof(buf)-1, "%" PRIu64, _id);
+       _id.print (buf, sizeof (buf));
        node->add_property ("id", buf);
 
        if (_timestamp != 0) {
@@ -94,7 +94,7 @@ Source::set_state (const XMLNode& node)
        }
        
        if ((prop = node.property ("id")) != 0) {
-               sscanf (prop->value().c_str(), "%" PRIu64, &_id);
+               _id = prop->value ();
        } else {
                return -1;
        }
@@ -106,15 +106,3 @@ Source::set_state (const XMLNode& node)
        return 0;
 }
 
-void
-Source::use ()
-{
-       _use_cnt++;
-}
-
-void
-Source::release ()
-{
-       if (_use_cnt) --_use_cnt;
-}
-