Move a few declarations to first use.
[ardour.git] / gtk2_ardour / generic_pluginui.cc
index f7110740eeeb0e6b30851ab88b995a971fe2bdc1..52e583a4f8b82af447e65fa4d3df1f298b2299ec 100644 (file)
@@ -127,11 +127,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
 
        pi->ActiveChanged.connect (active_connection, invalidator (*this), boost::bind (&GenericPluginUI::processor_active_changed, this, boost::weak_ptr<Processor>(pi)), gui_context());
 
-       if (!pi->active()) {
-               bypass_button.set_active_state (Gtkmm2ext::Active);
-       } else {
-               bypass_button.unset_active_state ();
-       }
+       bypass_button.set_active (!pi->active());
 
        prefheight = 0;
        build ();
@@ -443,9 +439,8 @@ GenericPluginUI::automation_state_changed (ControlUI* cui)
 
        // don't lock to avoid deadlock because we're triggered by
        // AutomationControl::Changed() while the automation lock is taken
-       switch (insert->get_parameter_automation_state (cui->parameter())
-                       & (Off|Play|Touch|Write)) {
-       case Off:
+       switch (insert->get_parameter_automation_state (cui->parameter()) & (ARDOUR::Off|Play|Touch|Write)) {
+       case ARDOUR::Off:
                cui->automate_button.set_label (S_("Automation|Manual"));
                break;
        case Play:
@@ -698,7 +693,7 @@ GenericPluginUI::astate_clicked (ControlUI* cui, uint32_t /*port*/)
 
        items.clear ();
        items.push_back (MenuElem (S_("Automation|Manual"),
-                                  sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Off, cui)));
+                                  sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) ARDOUR::Off, cui)));
        items.push_back (MenuElem (_("Play"),
                                   sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Play, cui)));
        items.push_back (MenuElem (_("Write"),