summaryrefslogtreecommitdiff
path: root/libs/ardour/amp.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-11-27 17:41:43 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-11-27 17:41:43 +0000
commitf3a833e38e669d3194652ddba40fa10377ff750a (patch)
treeaad359972ea39a46b2123884e1d2af70ebee6920 /libs/ardour/amp.cc
parent2bd721d1ccb35a095d7e2b35f069abc14b79ed30 (diff)
changes associated with save/restore of AutomationControl id's
git-svn-id: svn://localhost/ardour2/branches/3.0@8109 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/amp.cc')
-rw-r--r--libs/ardour/amp.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc
index 1486353ca0..7f0b397703 100644
--- a/libs/ardour/amp.cc
+++ b/libs/ardour/amp.cc
@@ -34,6 +34,7 @@
#include "i18n.h"
using namespace ARDOUR;
+using namespace PBD;
Amp::Amp (Session& s)
: Processor(s, "Amp")
@@ -388,10 +389,7 @@ Amp::state (bool full_state)
{
XMLNode& node (Processor::state (full_state));
node.add_property("type", "amp");
-
- char buf[32];
- snprintf (buf, sizeof (buf), "%2.12f", _gain_control->get_value());
- node.add_property("gain", buf);
+ node.add_child_nocopy (_gain_control->get_state());
return node;
}
@@ -399,19 +397,14 @@ Amp::state (bool full_state)
int
Amp::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLNode* gain_node;
Processor::set_state (node, version);
- prop = node.property ("gain");
-
- if (prop) {
- gain_t val;
-
- if (sscanf (prop->value().c_str(), "%f", &val) == 1) {
- _gain_control->set_value (val);
- }
- }
+ if ((gain_node = node.child (Controllable::xml_node_name.c_str())) != 0) {
+ _gain_control->set_state (*gain_node, version);
+ }
+
return 0;
}