diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-09-26 20:07:49 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-09-26 20:07:49 +0000 |
commit | 0fe9b6310013549b509da2311b16c56e0b498d7d (patch) | |
tree | b4299400540a088893011965c7a23dc95d6d7162 /libs/pbd | |
parent | ddda6bc4f52e56983924a6ce4f41db4915972be8 (diff) |
retain controllable info for plugins
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2488 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/controllable.cc | 25 | ||||
-rw-r--r-- | libs/pbd/pbd/controllable.h | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/libs/pbd/controllable.cc b/libs/pbd/controllable.cc index 039eb43e3a..bf0f7f5c6d 100644 --- a/libs/pbd/controllable.cc +++ b/libs/pbd/controllable.cc @@ -42,6 +42,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 () { diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h index ed41af1be8..85f09726ca 100644 --- a/libs/pbd/pbd/controllable.h +++ b/libs/pbd/pbd/controllable.h @@ -35,6 +35,7 @@ namespace PBD { class Controllable : public PBD::StatefulDestructible { public: Controllable (std::string name); + Controllable (const XMLNode&); virtual ~Controllable() { Destroyed (this); } virtual void set_value (float) = 0; |