GenericUI: don't add all inputs to automation vector
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Thu, 28 Jul 2016 20:00:58 +0000 (22:00 +0200)
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Thu, 28 Jul 2016 21:21:09 +0000 (23:21 +0200)
That list is used to set the automation state of all automatable
controls when the global automation state is changed with the buttons at
the top of the generic UI window. The controls were added to the list
regardless of the automatable status, and some controls were even added
multiple times: once in build_control_ui() and once in build().

Since changing the state of non-automatable controls is wrong, only add
the control UI in build_control_ui() which already has the knowledge of
automatable or not.

gtk2_ardour/generic_pluginui.cc

index 77a2536b1adde1085f5b40b832e32afa41459c5d..0a1631736da548a7896086ced77515cdfd3c195c 100644 (file)
@@ -272,7 +272,6 @@ GenericPluginUI::build ()
                        }
 
                        control_uis.push_back(cui);
-                       input_controls_with_automation.push_back (cui);
                }
        }
 
@@ -835,8 +834,15 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
                        control_ui->automate_button.set_sensitive (false);
                        set_tooltip(control_ui->automate_button, _("This control cannot be automated"));
                } else {
-                       control_ui->automate_button.signal_clicked.connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::astate_clicked), control_ui));
-                       mcontrol->alist()->automation_state_changed.connect (control_connections, invalidator (*this), boost::bind (&GenericPluginUI::automation_state_changed, this, control_ui), gui_context());
+                       control_ui->automate_button.signal_clicked.connect (sigc::bind (
+                                               sigc::mem_fun(*this, &GenericPluginUI::astate_clicked),
+                                               control_ui));
+                       mcontrol->alist()->automation_state_changed.connect (
+                                       control_connections,
+                                       invalidator (*this),
+                                       boost::bind (&GenericPluginUI::automation_state_changed, this, control_ui),
+                                       gui_context());
+                       input_controls_with_automation.push_back (control_ui);
                }
 
                if (desc.toggled) {
@@ -850,7 +856,6 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
                automation_state_changed (control_ui);
 
                input_controls.push_back (control_ui);
-               input_controls_with_automation.push_back (control_ui);
 
        } else if (!is_input) {