From e1c82dfd857465cd5900f1bd626b3d651b7e7617 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 25 Feb 2014 14:51:53 +0100 Subject: [PATCH] prepare plugin list refresh w/o instantiate (using cache only) --- libs/ardour/ardour/plugin_manager.h | 14 +++++++------- libs/ardour/plugin_manager.cc | 28 +++++++++++++++------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index 0e5919095a..70d4a05912 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -50,7 +50,7 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { ARDOUR::PluginInfoList &lv2_plugin_info (); ARDOUR::PluginInfoList &au_plugin_info (); - void refresh (); + void refresh (bool cache_only = false); void cancel_plugin_scan(); void clear_vst_cache (); void clear_vst_blacklist (); @@ -112,8 +112,8 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { bool cancel_scan; void ladspa_refresh (); - void windows_vst_refresh (); - void lxvst_refresh (); + void windows_vst_refresh (bool cache_only = false); + void lxvst_refresh (bool cache_only = false); void add_lrdf_data (const std::string &path); void add_ladspa_presets (); @@ -125,11 +125,11 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { void lv2_refresh (); - int windows_vst_discover_from_path (std::string path); - int windows_vst_discover (std::string path); + int windows_vst_discover_from_path (std::string path, bool cache_only = false); + int windows_vst_discover (std::string path, bool cache_only = false); - int lxvst_discover_from_path (std::string path); - int lxvst_discover (std::string path); + int lxvst_discover_from_path (std::string path, bool cache_only = false); + int lxvst_discover (std::string path, bool cache_only = false); int ladspa_discover (std::string path); diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index cfdfc6af7f..1627d67664 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -176,7 +176,7 @@ PluginManager::~PluginManager() void -PluginManager::refresh () +PluginManager::refresh (bool cache_only) { DEBUG_TRACE (DEBUG::PluginManager, "PluginManager::refresh\n"); BootMessage (_("Discovering Plugins")); @@ -607,7 +607,7 @@ PluginManager::au_refresh () #ifdef WINDOWS_VST_SUPPORT void -PluginManager::windows_vst_refresh () +PluginManager::windows_vst_refresh (bool cache_only) { if (_windows_vst_plugin_info) { _windows_vst_plugin_info->clear (); @@ -619,7 +619,7 @@ PluginManager::windows_vst_refresh () windows_vst_path = "/usr/local/lib/vst:/usr/lib/vst"; } - windows_vst_discover_from_path (windows_vst_path); + windows_vst_discover_from_path (windows_vst_path, cache_only); } int @@ -641,7 +641,7 @@ static bool windows_vst_filter (const string& str, void * /*arg*/) } int -PluginManager::windows_vst_discover_from_path (string path) +PluginManager::windows_vst_discover_from_path (string path, bool cache_only) { PathScanner scanner; vector *plugin_objects; @@ -655,7 +655,7 @@ PluginManager::windows_vst_discover_from_path (string path) if (plugin_objects) { for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) { ARDOUR::PluginScanMessage(_("VST"), **x); - windows_vst_discover (**x); + windows_vst_discover (**x, cache_only); } vector_delete (plugin_objects); @@ -665,11 +665,12 @@ PluginManager::windows_vst_discover_from_path (string path) } int -PluginManager::windows_vst_discover (string path) +PluginManager::windows_vst_discover (string path, bool cache_only) { DEBUG_TRACE (DEBUG::PluginManager, string_compose ("windows_vst_discover '%1'\n", path)); - vector * finfos = vstfx_get_info_fst (const_cast (path.c_str())); + vector * finfos = vstfx_get_info_fst (const_cast (path.c_str()), + cache_only ? VST_SCAN_CACHE_ONLY : VST_SCAN_USE_APP); if (finfos->empty()) { DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Cannot get Windows VST information from '%1'\n", path)); @@ -739,7 +740,7 @@ PluginManager::windows_vst_discover (string path) #ifdef LXVST_SUPPORT void -PluginManager::lxvst_refresh () +PluginManager::lxvst_refresh (bool cache_only) { if (_lxvst_plugin_info) { _lxvst_plugin_info->clear (); @@ -753,7 +754,7 @@ PluginManager::lxvst_refresh () "/usr/lib/vst:/usr/local/lib/vst"; } - lxvst_discover_from_path (lxvst_path); + lxvst_discover_from_path (lxvst_path, cache_only); } int @@ -775,7 +776,7 @@ static bool lxvst_filter (const string& str, void *) } int -PluginManager::lxvst_discover_from_path (string path) +PluginManager::lxvst_discover_from_path (string path, bool cache_only) { PathScanner scanner; vector *plugin_objects; @@ -793,7 +794,7 @@ PluginManager::lxvst_discover_from_path (string path) if (plugin_objects) { for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) { ARDOUR::PluginScanMessage(_("LXVST"), **x); - lxvst_discover (**x); + lxvst_discover (**x, cache_only); } vector_delete (plugin_objects); @@ -803,11 +804,12 @@ PluginManager::lxvst_discover_from_path (string path) } int -PluginManager::lxvst_discover (string path) +PluginManager::lxvst_discover (string path, bool cache_only) { DEBUG_TRACE (DEBUG::PluginManager, string_compose ("checking apparent LXVST plugin at %1\n", path)); - vector * finfos = vstfx_get_info_lx (const_cast (path.c_str())); + vector * finfos = vstfx_get_info_lx (const_cast (path.c_str()), + cache_only ? VST_SCAN_CACHE_ONLY : VST_SCAN_USE_APP); if (finfos->empty()) { DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Cannot get Linux VST information from '%1'\n", path)); -- 2.30.2