implementation for "prefer inline over GUI"
authorRobin Gareus <robin@gareus.org>
Mon, 14 Mar 2016 23:27:03 +0000 (00:27 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 14 Mar 2016 23:27:03 +0000 (00:27 +0100)
gtk2_ardour/processor_box.cc
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/rc_option_editor.h

index 471fc5d463652c6deeebdff5d156df128e196aeb..f5a84ba878aeadf87187c1eec9093f3aacb8dad3 100644 (file)
@@ -2040,7 +2040,9 @@ ProcessorBox::use_plugins (const SelectedPlugins& plugins)
                        return true;
                        // XXX SHAREDPTR delete plugin here .. do we even need to care?
                } else if (plugins.size() == 1 && Config->get_open_gui_after_adding_plugin()) {
-                       if (_session->engine().connected () && processor_can_be_edited (processor)) {
+                       if (boost::dynamic_pointer_cast<PluginInsert>(processor)->plugin()->has_inline_display() && Config->get_prefer_inline_over_gui()) {
+                               ;
+                       } else if (_session->engine().connected () && processor_can_be_edited (processor)) {
                                if ((*p)->has_editor ()) {
                                        edit_processor (processor);
                                } else {
index 5e5e7ca7fb81e9b1cbb706f819d462471406e42e..736a1ab8b596437cc5b5942fcb3300471a05a9f3 100644 (file)
@@ -2912,11 +2912,19 @@ if (!Profile->get_mixbus()) {
 #ifdef LV2_SUPPORT
        add_option (_("Plugins"),
             new BoolOption (
-                    "show-inline-display-by-default,",
+                    "show-inline-display-by-default",
                     _("Show Plugin Inline Display on Mixerstrip by default"),
                     sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_inline_display_by_default),
                     sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_inline_display_by_default)
                     ));
+
+       _plugin_prefer_inline = new BoolOption (
+                       "prefer-inline-over-gui",
+                       _("Don't automatically open the plugin GUI when the plugin has an inline display mode"),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::get_prefer_inline_over_gui),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::set_prefer_inline_over_gui)
+                       );
+       add_option (_("Plugins"), _plugin_prefer_inline);
 #endif
 #endif
 
@@ -3242,6 +3250,10 @@ RCOptionEditor::parameter_changed (string const & p)
                bool const s = Config->get_send_ltc ();
                _ltc_send_continuously->set_sensitive (s);
                _ltc_volume_slider->set_sensitive (s);
+       } else if (p == "open-gui-after-adding-plugin" || p == "show-inline-display-by-default") {
+#ifdef LV2_SUPPORT
+               _plugin_prefer_inline->set_sensitive (Config->get_open_gui_after_adding_plugin() && Config->get_show_inline_display_by_default());
+#endif
        }
 }
 
index fe47fbbcd6148a4f3d85c8c8f68885d40733abc0..8a445ed49f516362be8a3a859ddf0fc3d8e3f979 100644 (file)
@@ -58,6 +58,7 @@ private:
        HSliderOption* _ltc_volume_slider;
        Gtk::Adjustment* _ltc_volume_adjustment;
        BoolOption* _ltc_send_continuously;
+       BoolOption* _plugin_prefer_inline;
 
        PBD::ScopedConnection parameter_change_connection;
        PBD::ScopedConnection engine_started_connection;