summaryrefslogtreecommitdiff
path: root/libs/ardour
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
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')
-rw-r--r--libs/ardour/amp.cc21
-rw-r--r--libs/ardour/audio_track.cc9
-rw-r--r--libs/ardour/audio_track_importer.cc4
-rw-r--r--libs/ardour/automation_control.cc2
-rw-r--r--libs/ardour/midi_track.cc9
-rw-r--r--libs/ardour/panner.cc2
-rw-r--r--libs/ardour/route.cc17
7 files changed, 29 insertions, 35 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;
}
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc
index 90813715b0..554c89df44 100644
--- a/libs/ardour/audio_track.cc
+++ b/libs/ardour/audio_track.cc
@@ -230,10 +230,11 @@ AudioTrack::_set_state (const XMLNode& node, int version, bool call_base)
for (niter = nlist.begin(); niter != nlist.end(); ++niter){
child = *niter;
- if (child->name() == X_("recenable")) {
- _rec_enable_control->set_state (*child, version);
- _session.add_controllable (_rec_enable_control);
- }
+ if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
+ if (prop->value() == X_("recenable")) {
+ _rec_enable_control->set_state (*child, version);
+ }
+ }
}
if (version >= 3000) {
diff --git a/libs/ardour/audio_track_importer.cc b/libs/ardour/audio_track_importer.cc
index c5a584a7f4..b29384b201 100644
--- a/libs/ardour/audio_track_importer.cc
+++ b/libs/ardour/audio_track_importer.cc
@@ -91,7 +91,7 @@ AudioTrackImporter::AudioTrackImporter (XMLTree const & source,
throw failed_constructor();
}
- XMLNodeList const & controllables = node.children ("Controllable");
+ XMLNodeList const & controllables = node.children (Controllable::xml_node_name);
for (XMLNodeList::const_iterator it = controllables.begin(); it != controllables.end(); ++it) {
parse_controllable (**it);
}
@@ -197,7 +197,7 @@ AudioTrackImporter::parse_io ()
return false;
}
- XMLNodeList const & controllables = io->children ("Controllable");
+ XMLNodeList const & controllables = io->children (Controllable::xml_node_name);
for (XMLNodeList::const_iterator it = controllables.begin(); it != controllables.end(); ++it) {
parse_controllable (**it);
}
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc
index 2989d82818..d18a018e26 100644
--- a/libs/ardour/automation_control.cc
+++ b/libs/ardour/automation_control.cc
@@ -34,7 +34,7 @@ AutomationControl::AutomationControl(
const Evoral::Parameter& parameter,
boost::shared_ptr<ARDOUR::AutomationList> list,
const string& name)
- : Controllable((name != "") ? name : EventTypeMap::instance().to_symbol(parameter))
+ : Controllable (name.empty() ? EventTypeMap::instance().to_symbol(parameter) : name)
, Evoral::Control(parameter, list)
, _session(session)
{
diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc
index 452e3038bd..e31fae9141 100644
--- a/libs/ardour/midi_track.cc
+++ b/libs/ardour/midi_track.cc
@@ -159,10 +159,11 @@ MidiTrack::_set_state (const XMLNode& node, int version, bool call_base)
for (niter = nlist.begin(); niter != nlist.end(); ++niter){
child = *niter;
- if (child->name() == X_("recenable")) {
- _rec_enable_control->set_state (*child, version);
- _session.add_controllable (_rec_enable_control);
- }
+ if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
+ if (prop->value() == X_("recenable")) {
+ _rec_enable_control->set_state (*child, version);
+ }
+ }
}
if (version >= 3000) {
diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc
index 67aae8c86b..ae70f75941 100644
--- a/libs/ardour/panner.cc
+++ b/libs/ardour/panner.cc
@@ -535,7 +535,7 @@ EqualPowerStereoPanner::set_state (const XMLNode& node, int version)
for (XMLNodeConstIterator iter = node.children().begin(); iter != node.children().end(); ++iter) {
- if ((*iter)->name() == X_("Controllable")) {
+ if ((*iter)->name() == Controllable::xml_node_name) {
if ((prop = (*iter)->property("name")) != 0 && prop->value() == "panner") {
_control->set_state (**iter, version);
}
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 97b1402d30..1e0edc2077 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -1832,6 +1832,7 @@ Route::state(bool full_state)
node->add_child_nocopy (_input->state (full_state));
node->add_child_nocopy (_output->state (full_state));
node->add_child_nocopy (_solo_control->get_state ());
+ node->add_child_nocopy (_mute_control->get_state ());
node->add_child_nocopy (_mute_master->get_state ());
XMLNode* remote_control_node = new XMLNode (X_("RemoteControl"));
@@ -2013,11 +2014,9 @@ Route::_set_state (const XMLNode& node, int version, bool /*call_base*/)
_extra_xml = new XMLNode (*child);
- } else if (child->name() == X_("Controllable") && (prop = child->property("name")) != 0) {
-
+ } else if (child->name() == Controllable::xml_node_name && (prop = child->property("name")) != 0) {
if (prop->value() == "solo") {
_solo_control->set_state (*child, version);
- _session.add_controllable (_solo_control);
}
} else if (child->name() == X_("RemoteControl")) {
@@ -2264,13 +2263,13 @@ Route::_set_state_2X (const XMLNode& node, int version)
_extra_xml = new XMLNode (*child);
- } else if (child->name() == X_("Controllable") && (prop = child->property("name")) != 0) {
-
- if (prop->value() == "solo") {
+ } else if (child->name() == Controllable::xml_node_name && (prop = child->property("name")) != 0) {
+ if (prop->value() == X_("solo")) {
_solo_control->set_state (*child, version);
- _session.add_controllable (_solo_control);
- }
-
+ } else if (prop->value() == X_("mute")) {
+ _mute_control->set_state (*child, version);
+ }
+
} else if (child->name() == X_("RemoteControl")) {
if ((prop = child->property (X_("id"))) != 0) {
int32_t x;