option to en/dis-able VST plugin discovery on startup
authorRobin Gareus <robin@gareus.org>
Tue, 25 Feb 2014 17:48:08 +0000 (18:48 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 25 Feb 2014 18:17:04 +0000 (19:17 +0100)
gtk2_ardour/rc_option_editor.cc
libs/ardour/ardour/rc_configuration_vars.h
libs/ardour/globals.cc
libs/ardour/plugin_manager.cc

index badf35a79a6930ed6ebead93f16de725b8356ae1..0331597faca33581f800e012539bb502fd0ca732 100644 (file)
@@ -999,27 +999,34 @@ public:
        PluginOptions (RCConfiguration* c)
                : _rc_config (c)
                , _display_plugin_scan_progress (_("Display Plugin Scan Progress"))
+               , _discover_vst_on_start (_("Scan for new VST Plugin on Application Start"))
        {
                Table* t = manage (new Table (2, 6));
                t->set_spacings (4);
                Button* b;
 
+               b = manage (new Button (_("Refresh Plugin List")));
+               b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::refresh_clicked));
+               t->attach (*b, 0, 2, 0, 1, FILL);
+
                b = manage (new Button (_("Clear VST Cache")));
                b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::clear_vst_cache_clicked));
-               t->attach (*b, 0, 2, 0, 1, FILL);
+               t->attach (*b, 0, 2, 1, 2, FILL);
 
                b = manage (new Button (_("Clear VST Blacklist")));
                b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::clear_vst_blacklist_clicked));
-               t->attach (*b, 0, 2, 1, 2, FILL);
-
-               b = manage (new Button (_("Refresh Plugin List")));
-               b->signal_clicked().connect (sigc::mem_fun (*this, &PluginOptions::refresh_clicked));
                t->attach (*b, 0, 2, 2, 3, FILL);
 
-               t->attach (_display_plugin_scan_progress, 0, 2, 3, 4);
+               t->attach (_discover_vst_on_start, 0, 2, 3, 4);
+               _discover_vst_on_start.signal_toggled().connect (sigc::mem_fun (*this, &PluginOptions::discover_vst_on_start_toggled));
+               Gtkmm2ext::UI::instance()->set_tip (_discover_vst_on_start,
+                                           _("<b>When enabled</b> VST plugins are searched and tested on application start. When disabled they a Refresh will have to be tiggered manually"));
+
+               t->attach (_display_plugin_scan_progress, 0, 2, 4, 5);
                _display_plugin_scan_progress.signal_toggled().connect (sigc::mem_fun (*this, &PluginOptions::display_plugin_scan_progress_toggled));
                Gtkmm2ext::UI::instance()->set_tip (_display_plugin_scan_progress,
-                                           _("<b>When enabled</b> a popup window details plugin-scan."));
+                                           _("<b>When enabled</b> display a popup window showing plugin scan progress."));
+
 
                _box->pack_start (*t,true,true);
        }
@@ -1029,19 +1036,32 @@ public:
                        bool const x = _rc_config->get_show_plugin_scan_window();
                        _display_plugin_scan_progress.set_active (x);
                }
+               else if (p == "discover-vst-on-start") {
+                       bool const x = _rc_config->get_discover_vst_on_start();
+                       _discover_vst_on_start.set_active (x);
+               }
        }
+
        void set_state_from_config () {
                parameter_changed ("show-plugin-scan-window");
+               parameter_changed ("discover-vst-on-start");
        }
 
 private:
        RCConfiguration* _rc_config;
        CheckButton _display_plugin_scan_progress;
+       CheckButton _discover_vst_on_start;
 
        void display_plugin_scan_progress_toggled () {
-               bool const x = _display_plugin_scan_progress.get_active ();
-               _rc_config->set_show_plugin_scan_window (x);
+               bool const x = _display_plugin_scan_progress.get_active();
+               _rc_config->set_show_plugin_scan_window(x);
+       }
+
+       void discover_vst_on_start_toggled () {
+               bool const x = _discover_vst_on_start.get_active();
+               _rc_config->set_discover_vst_on_start(x);
        }
+
        void clear_vst_cache_clicked () {
                PluginManager::instance().clear_vst_cache();
        }
index c94c5705600835e77c46292c84e4cb3bc60b8f86..5a46d32445fa96fc8d439f838ccab1c98b278117 100644 (file)
@@ -205,6 +205,7 @@ CONFIG_VARIABLE (bool, use_plugin_own_gui, "use-plugin-own-gui", true)
 CONFIG_VARIABLE (bool, use_windows_vst, "use-windows-vst", true)
 CONFIG_VARIABLE (bool, use_lxvst, "use-lxvst", true)
 CONFIG_VARIABLE (bool, show_plugin_scan_window, "show-plugin-scan-window", true)
+CONFIG_VARIABLE (bool, discover_vst_on_start, "discover-vst-on-start", false)
 
 /* denormal management */
 
index 71d65a60f37a317f7024a614907b28be72bd6385..359f960f30a1187a7384228cabbb5b3e51827806 100644 (file)
@@ -364,7 +364,7 @@ ARDOUR::init_post_engine ()
 
        /* find plugins */
 
-       ARDOUR::PluginManager::instance().refresh ();
+       ARDOUR::PluginManager::instance().refresh (!Config->get_discover_vst_on_start());
 }
 
 void
index fc27a34255eb45a33c628247f53086623ccdfc30..532cc0bed4b181e4cc84cf60ab4f657f5532c216 100644 (file)
@@ -195,13 +195,13 @@ PluginManager::refresh (bool cache_only)
 #endif
 #ifdef WINDOWS_VST_SUPPORT
        if (Config->get_use_windows_vst()) {
-               windows_vst_refresh ();
+               windows_vst_refresh (cache_only);
        }
 #endif // WINDOWS_VST_SUPPORT
 
 #ifdef LXVST_SUPPORT
        if(Config->get_use_lxvst()) {
-               lxvst_refresh();
+               lxvst_refresh(cache_only);
        }
 #endif //Native linuxVST SUPPORT