diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-11-28 18:31:18 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-11-28 18:31:18 +0000 |
commit | 9b7a35cdc0d63d05d91f9deba294bcb7113a9106 (patch) | |
tree | 566657c72ba088461bdcd858402a01fab2738090 /libs/pbd/controllable.cc | |
parent | 422309880c0448d95c7be2cec43384b604fa427c (diff) |
more or less complete restoration of Controllable::_id from XML, with all that implies for MIDI bindings continuing to work across session reloads, and also that the controlled parameter is now set from Controllable::set_value() during session loading, not directly from its "own" XML value; still some funny stuff going on with Panners. This may have broken 2.X session loading in that panners may not be setup correctly
git-svn-id: svn://localhost/ardour2/branches/3.0@8117 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/controllable.cc')
-rw-r--r-- | libs/pbd/controllable.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/pbd/controllable.cc b/libs/pbd/controllable.cc index b79a523a00..0112ff2b1c 100644 --- a/libs/pbd/controllable.cc +++ b/libs/pbd/controllable.cc @@ -21,6 +21,7 @@ #include "pbd/enumwriter.h" #include "pbd/xml++.h" #include "pbd/error.h" +#include "pbd/locale_guard.h" #include "i18n.h" @@ -102,6 +103,7 @@ XMLNode& Controllable::get_state () { XMLNode* node = new XMLNode (xml_node_name); + LocaleGuard lg (X_("POSIX")); char buf[64]; node->add_property (X_("name"), _name); // not reloaded from XML state, just there to look at @@ -114,14 +116,15 @@ Controllable::get_state () return *node; } + int Controllable::set_state (const XMLNode& node, int /*version*/) { + LocaleGuard lg (X_("POSIX")); const XMLProperty* prop; if ((prop = node.property (X_("id"))) != 0) { _id = prop->value(); - return 0; } else { error << _("Controllable state node has no ID property") << endmsg; return -1; @@ -136,8 +139,10 @@ Controllable::set_state (const XMLNode& node, int /*version*/) if (sscanf (prop->value().c_str(), "%f", &val) == 1) { set_value (val); - } - } + } + } + + return 0; } void |