Fix save/reload of pan automation.
authorCarl Hetherington <carl@carlh.net>
Sat, 18 Sep 2010 20:01:36 +0000 (20:01 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 18 Sep 2010 20:01:36 +0000 (20:01 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7798 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/automatable.h
libs/ardour/automatable.cc
libs/ardour/panner.cc
libs/ardour/processor.cc
libs/ardour/route.cc

index 469025c69310e84d59ea95a81947200ffef1fefe..f90f1dec4867fd781e9e5a5129118c7aa99b0a96 100644 (file)
@@ -93,8 +93,8 @@ public:
 
        typedef Evoral::ControlSet::Controls Controls;
 
-       int set_automation_state (const XMLNode&, Evoral::Parameter default_param);
-       XMLNode& get_automation_state();
+       int set_automation_xml_state (const XMLNode&, Evoral::Parameter default_param);
+       XMLNode& get_automation_xml_state();
        
   protected:
        Session& _a_session;
index 0c28eb95e01332655ec255c47c0c34a02a69b40f..4de2e89b412e6c972479012ace282f00459c705b 100644 (file)
@@ -224,7 +224,7 @@ Automatable::mark_automation_visible (Evoral::Parameter what, bool yn)
  * pass that type and it will be used for the untyped AutomationList found.
  */
 int
-Automatable::set_automation_state (const XMLNode& node, Evoral::Parameter legacy_param)
+Automatable::set_automation_xml_state (const XMLNode& node, Evoral::Parameter legacy_param)
 {
        Glib::Mutex::Lock lm (control_lock());
 
@@ -272,7 +272,7 @@ Automatable::set_automation_state (const XMLNode& node, Evoral::Parameter legacy
                        }
 
                } else {
-                       error << "Expected AutomationList node, got '" << (*niter)->name() << endmsg;
+                       error << "Expected AutomationList node, got '" << (*niter)->name() << "'" << endmsg;
                }
        }
 
@@ -282,7 +282,7 @@ Automatable::set_automation_state (const XMLNode& node, Evoral::Parameter legacy
 }
 
 XMLNode&
-Automatable::get_automation_state ()
+Automatable::get_automation_xml_state ()
 {
        Glib::Mutex::Lock lm (control_lock());
        XMLNode* node = new XMLNode (X_("Automation"));
index 3f6b23672ab1b8e1da5cda40edb1162d82bb7fab..5b33eaf1f559cbaf8c7349377ce7aaff5ae4c40c 100644 (file)
@@ -183,7 +183,7 @@ StreamPanner::set_state (const XMLNode& node, int /*version*/)
        if ((prop = node.property (X_("mono")))) {
                set_mono (string_is_affirmative (prop->value()));
        }
-       
+
        return 0;
 }
 
@@ -1153,6 +1153,7 @@ Panner::state (bool full)
                node->add_child_nocopy ((*i)->state (full));
        }
 
+       node->add_child_nocopy (get_automation_xml_state ());
 
        return *node;
 }
@@ -1259,6 +1260,12 @@ Panner::set_state (const XMLNode& node, int version)
                automation_path = Glib::build_filename(_session.automation_dir(), prop->value ());
        }
 
+       for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
+               if ((*niter)->name() == X_("Automation")) {
+                       set_automation_xml_state (**niter, Evoral::Parameter (PanAutomation));
+               }
+       }
+       
        return 0;
 }
 
index 555dff5092e2a4ec015e47b7105939336bbcc4a5..86f63d5a2f66ce7402b76c26dbd8f816be072efe 100644 (file)
@@ -107,7 +107,7 @@ Processor::state (bool full_state)
        }
 
        if (full_state) {
-               XMLNode& automation = Automatable::get_automation_state();
+               XMLNode& automation = Automatable::get_automation_xml_state();
                if (!automation.children().empty()
                                || !automation.properties().empty()
                                || !_visible_controls.empty()) {
@@ -197,7 +197,7 @@ Processor::set_state (const XMLNode& node, int version)
                        if ((prop = (*niter)->property ("path")) != 0) {
                                old_set_automation_state (*(*niter));
                        } else {
-                               set_automation_state (*(*niter), Evoral::Parameter(PluginAutomation));
+                               set_automation_xml_state (*(*niter), Evoral::Parameter(PluginAutomation));
                        }
 
                        if ((prop = (*niter)->property ("visible")) != 0) {
index 81d822e7494a898dd5a19765278fa6395d804a13..880db63c7dec87d2503d3715494ef5414989ebd1 100644 (file)
@@ -2163,7 +2163,7 @@ Route::_set_state_2X (const XMLNode& node, int version)
                                        _main_outs->panner()->set_state(*io_child, version);
                                } else if (io_child->name() == X_("Automation")) {
                                        /* IO's automation is for the fader */
-                                       _amp->set_automation_state (*io_child, Evoral::Parameter (GainAutomation));
+                                       _amp->set_automation_xml_state (*io_child, Evoral::Parameter (GainAutomation));
                                }
                        }
                }