From 5afe60f0e3e726dbf3bb13944d723a86a3cfde0d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 12 Jun 2011 22:17:29 +0000 Subject: [PATCH] fix restore of Pannable state from XML (regression in alpha6) git-svn-id: svn://localhost/ardour2/branches/3.0@9717 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/pannable.cc | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/libs/ardour/pannable.cc b/libs/ardour/pannable.cc index e020c19451..6dbb5005c2 100644 --- a/libs/ardour/pannable.cc +++ b/libs/ardour/pannable.cc @@ -209,16 +209,25 @@ Pannable::set_state (const XMLNode& root, int version) XMLNodeConstIterator niter; for (niter = nlist.begin(); niter != nlist.end(); ++niter) { - if ((*niter)->name() == pan_azimuth_control->name()) { - pan_azimuth_control->set_state (**niter, version); - } else if ((*niter)->name() == pan_width_control->name()) { - pan_width_control->set_state (**niter, version); - } else if ((*niter)->name() == pan_elevation_control->name()) { - pan_elevation_control->set_state (**niter, version); - } else if ((*niter)->name() == pan_frontback_control->name()) { - pan_frontback_control->set_state (**niter, version); - } else if ((*niter)->name() == pan_lfe_control->name()) { - pan_lfe_control->set_state (**niter, version); + if ((*niter)->name() == Controllable::xml_node_name) { + const XMLProperty* prop = (*niter)->property (X_("name")); + + if (!prop) { + continue; + } + + if (prop->value() == pan_azimuth_control->name()) { + pan_azimuth_control->set_state (**niter, version); + } else if (prop->value() == pan_width_control->name()) { + pan_width_control->set_state (**niter, version); + } else if (prop->value() == pan_elevation_control->name()) { + pan_elevation_control->set_state (**niter, version); + } else if (prop->value() == pan_frontback_control->name()) { + pan_frontback_control->set_state (**niter, version); + } else if (prop->value() == pan_lfe_control->name()) { + pan_lfe_control->set_state (**niter, version); + } + } else if ((*niter)->name() == Automatable::xml_node_name) { set_automation_xml_state (**niter, PanAzimuthAutomation); }