From 64c2328a8a6cf79eb56a24ad6bdd93375bde4d32 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 25 Feb 2014 18:48:08 +0100 Subject: option to en/dis-able VST plugin discovery on startup --- gtk2_ardour/rc_option_editor.cc | 38 +++++++++++++++++++++++------- libs/ardour/ardour/rc_configuration_vars.h | 1 + libs/ardour/globals.cc | 2 +- libs/ardour/plugin_manager.cc | 4 ++-- 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index badf35a79a..0331597fac 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -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, + _("When enabled 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, - _("When enabled a popup window details plugin-scan.")); + _("When enabled 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(); } diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index c94c570560..5a46d32445 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -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 */ diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 71d65a60f3..359f960f30 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -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 diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index fc27a34255..532cc0bed4 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -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 -- cgit v1.2.3