strip no-longer used code related to plugin parameter state
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Aug 2010 19:27:41 +0000 (19:27 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Aug 2010 19:27:41 +0000 (19:27 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7688 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/plugin_insert.h
libs/ardour/plugin_insert.cc

index 1fcce61f39ae0ae28eb7e38c2aa58d95dcd5babf..3b76d2588f3b98fcb302e08952e64a996b6acf58 100644 (file)
@@ -135,7 +135,6 @@ class PluginInsert : public Processor
 
        void set_automatable ();
        void control_list_automation_state_changed (Evoral::Parameter, AutoState);
-       void set_parameter_state (const XMLNode& node, int version);
        void set_parameter_state_2X (const XMLNode& node, int version);
 
        int32_t count_for_configuration (ChanCount in, ChanCount out) const;
index 108a7e03aa25b37866d0b159c29e894bfc0ae8d4..7174963ca8a287f8424c53268a316c4769f3fdd3 100644 (file)
@@ -789,6 +789,10 @@ PluginInsert::set_state(const XMLNode& node, int version)
 
        if (version < 3000) {
 
+                /* Only 2.X sessions need a call to set_parameter_state() - in 3.X and above
+                   this is all handled by Automatable
+                */
+
                for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
                        if ((*niter)->name() == "Redirect") {
                                /* XXX do we need to tackle placement? i think not (pd; oct 16 2009) */
@@ -797,11 +801,7 @@ PluginInsert::set_state(const XMLNode& node, int version)
                        }
                }
                
-               // set_parameter_state_2X (node, version);
-               
-       } else {
-
-               // set_parameter_state (node, version);
+               set_parameter_state_2X (node, version);
        }
 
        // The name of the PluginInsert comes from the plugin, nothing else
@@ -817,66 +817,6 @@ PluginInsert::set_state(const XMLNode& node, int version)
        return 0;
 }
 
-void
-PluginInsert::set_parameter_state (const XMLNode& node, int version)
-{
-       XMLNodeList nlist = node.children();
-       XMLNodeIterator niter;
-
-       for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-               
-               if ((*niter)->name() != port_automation_node_name) {
-                       continue;
-               }
-               
-               XMLNodeList cnodes;
-               XMLProperty *cprop;
-               XMLNodeConstIterator iter;
-               XMLNode *child;
-               const char *port;
-               uint32_t port_id;
-
-               cnodes = (*niter)->children ("AutomationList");
-
-               for (iter = cnodes.begin(); iter != cnodes.end(); ++iter) {
-
-                       child = *iter;
-
-                       /* XXX this code knows way too much about the internal details of an AutomationList state node */
-
-                       if ((cprop = child->property("automation-id")) != 0) {
-                               port = cprop->value().c_str();
-                       } else {
-                               warning << _("PluginInsert: Auto: no plugin parameter number seen") << endmsg;
-                               continue;
-                       }
-
-                       if (sscanf (port, "parameter-%" PRIu32, &port_id) != 1) {
-                               warning << _("PluginInsert: Auto: no parameter number found") << endmsg;
-                               continue;
-                       }
-
-                       if (port_id >= _plugins[0]->parameter_count()) {
-                               warning << _("PluginInsert: Auto: plugin parameter out of range") << endmsg;
-                               continue;
-                       }
-
-                       boost::shared_ptr<AutomationControl> c = boost::dynamic_pointer_cast<AutomationControl>(
-                                       control(Evoral::Parameter(PluginAutomation, 0, port_id), true));
-
-                       if (c) {
-                               c->alist()->set_state (*child, version);
-                       } else {
-                               error << string_compose (_("PluginInsert: automatable control %1 not found - ignored"), port_id) << endmsg;
-                       }
-               }
-
-               /* done */
-               
-               break;
-       }
-}
-
 void
 PluginInsert::set_parameter_state_2X (const XMLNode& node, int version)
 {