better design for range plays that leaves the range play button able to play the...
[ardour.git] / libs / pbd / controllable.cc
index 039eb43e3ab633594f9b20eb071c2a5e0e736790..6a0028668b67fffce6db2355eb6bfceca69192e9 100644 (file)
@@ -28,6 +28,8 @@ using namespace PBD;
 sigc::signal<void,Controllable*> Controllable::Destroyed;
 sigc::signal<bool,Controllable*> Controllable::StartLearning;
 sigc::signal<void,Controllable*> Controllable::StopLearning;
+sigc::signal<void,Controllable*,int,int> Controllable::CreateBinding;
+sigc::signal<void,Controllable*> Controllable::DeleteBinding;
 
 Glib::Mutex* Controllable::registry_lock = 0;
 Controllable::Controllables Controllable::registry;
@@ -42,6 +44,31 @@ Controllable::Controllable (std::string name)
        add ();
 }
 
+Controllable::Controllable (const XMLNode& node)
+{
+       const XMLProperty* prop = node.property (X_("name"));
+
+       if (!prop) {
+               fatal << string_compose (_("programming error: %1"), "Controllable (XMLNode&) constructor called without name property")
+                     << endmsg;
+               /*NOTREACHED*/
+       }
+
+       _name = prop->value ();
+
+       prop = node.property (X_("id"));
+
+       if (!prop) {
+               fatal << string_compose (_("programming error: %1"), "Controllable (XMLNode&) constructor called without id property")
+                     << endmsg;
+               /*NOTREACHED*/
+       }
+       
+       _id = prop->value();
+       
+       add ();
+}
+
 void
 Controllable::add ()
 {