PluginUI: only show "Reset" & Automation buttons if there are any controls
authorRobin Gareus <robin@gareus.org>
Fri, 8 Sep 2017 18:54:19 +0000 (20:54 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 8 Sep 2017 21:35:00 +0000 (23:35 +0200)
gtk2_ardour/au_pluginui.mm
gtk2_ardour/generic_pluginui.cc
gtk2_ardour/lv2_plugin_ui.cc
gtk2_ardour/vst_plugin_ui.cc

index d3c38d87d5de8138a70e824334a06972f7482ce8..00bbcbda1bc5f61ec7ce6a0b99792648617941bd 100644 (file)
@@ -420,7 +420,9 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
        smaller_hbox->pack_start (automation_mode_label, false, false);
        smaller_hbox->pack_start (automation_mode_selector, false, false);
 #endif
-       smaller_hbox->pack_start (reset_button, false, false);
+       if (insert->controls().size() > 0) {
+               smaller_hbox->pack_start (reset_button, false, false);
+       }
        smaller_hbox->pack_start (bypass_button, false, true);
 
        VBox* v1_box = manage (new VBox);
index dbb4d7f7568c0cda5a76b385b679787f8ac22857..3ab4aed76a24444cfc71fd71c7558c7d6e17c199 100644 (file)
@@ -88,9 +88,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
 
        HBox* constraint_hbox = manage (new HBox);
        HBox* smaller_hbox = manage (new HBox);
-       HBox* automation_hbox = manage (new HBox);
        smaller_hbox->set_spacing (4);
-       automation_hbox->set_spacing (6);
        Label* combo_label = manage (new Label (_("<span size=\"large\">Presets</span>")));
        combo_label->set_use_markup (true);
 
@@ -104,7 +102,9 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
        smaller_hbox->pack_start (add_button, false, false);
        smaller_hbox->pack_start (save_button, false, false);
        smaller_hbox->pack_start (delete_button, false, false);
-       smaller_hbox->pack_start (reset_button, false, false, 4);
+       if (pi->controls().size() > 0) {
+               smaller_hbox->pack_start (reset_button, false, false, 4);
+       }
        smaller_hbox->pack_start (bypass_button, false, true, 4);
 
        automation_manual_all_button.set_text(_("Manual"));
@@ -116,14 +116,6 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
        automation_touch_all_button.set_text(_("Touch"));
        automation_touch_all_button.set_name (X_("generic button"));
 
-       Label* l = manage (new Label (_("All Automation")));
-       l->set_alignment (1.0, 0.5);
-       automation_hbox->pack_start (*l, true, true);
-       automation_hbox->pack_start (automation_manual_all_button, false, false);
-       automation_hbox->pack_start (automation_play_all_button, false, false);
-       automation_hbox->pack_start (automation_write_all_button, false, false);
-       automation_hbox->pack_start (automation_touch_all_button, false, false);
-
        constraint_hbox->set_spacing (5);
        constraint_hbox->set_homogeneous (false);
 
@@ -136,7 +128,18 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
 
        v1_box->set_spacing (6);
        v1_box->pack_start (*smaller_hbox, false, true);
-       v1_box->pack_start (*automation_hbox, false, true);
+       if (pi->controls().size() > 0) {
+               HBox* automation_hbox = manage (new HBox);
+               automation_hbox->set_spacing (6);
+               Label* l = manage (new Label (_("All Automation")));
+               l->set_alignment (1.0, 0.5);
+               automation_hbox->pack_start (*l, true, true);
+               automation_hbox->pack_start (automation_manual_all_button, false, false);
+               automation_hbox->pack_start (automation_play_all_button, false, false);
+               automation_hbox->pack_start (automation_write_all_button, false, false);
+               automation_hbox->pack_start (automation_touch_all_button, false, false);
+               v1_box->pack_start (*automation_hbox, false, true);
+       }
        v2_box->pack_start (focus_button, false, true);
 
        main_contents.pack_start (settings_box, false, false);
index d7f6708d00d50d6186750100dc767933f08d974f..25fdf1ed7221008611641ed4f8097274c6393856 100644 (file)
@@ -235,7 +235,9 @@ LV2PluginUI::LV2PluginUI(boost::shared_ptr<PluginInsert> pi,
        _ardour_buttons_box.set_border_width (6);
        _ardour_buttons_box.pack_end (focus_button, false, false);
        _ardour_buttons_box.pack_end (bypass_button, false, false, 4);
-       _ardour_buttons_box.pack_end (reset_button, false, false, 4);
+       if (pi->controls().size() > 0) {
+               _ardour_buttons_box.pack_end (reset_button, false, false, 4);
+       }
        _ardour_buttons_box.pack_end (delete_button, false, false);
        _ardour_buttons_box.pack_end (save_button, false, false);
        _ardour_buttons_box.pack_end (add_button, false, false);
index 7d9e349466fcb2d32103dd01d43b840eec419cb2..fe6661960117d5ed4a5efc5870cb6001accb4817 100644 (file)
@@ -40,7 +40,9 @@ VSTPluginUI::VSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert> insert, boost:
        box->set_border_width (6);
        box->pack_end (focus_button, false, false);
        box->pack_end (bypass_button, false, false, 4);
-       box->pack_end (reset_button, false, false, 4);
+       if (insert->controls().size() > 0) {
+               box->pack_end (reset_button, false, false, 4);
+       }
        box->pack_end (delete_button, false, false);
        box->pack_end (save_button, false, false);
        box->pack_end (add_button, false, false);