13
0

failsafe AU scanning part one:

Don’t scan for AU plugins unless users explicitly starts a
plugin scan. Disable automatic scanning if Ardour crashes
during AU plugin discovery.
This commit is contained in:
Robin Gareus 2014-11-12 03:54:18 +01:00
parent aa9dda2c6a
commit 1bc04ae351
3 changed files with 20 additions and 7 deletions

View File

@ -127,7 +127,7 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable {
void add_lxvst_presets ();
void add_presets (std::string domain);
void au_refresh ();
void au_refresh (bool cache_only = false);
void lv2_refresh ();

View File

@ -211,6 +211,7 @@ CONFIG_VARIABLE (bool, use_lxvst, "use-lxvst", true)
CONFIG_VARIABLE (bool, show_plugin_scan_window, "show-plugin-scan-window", false)
CONFIG_VARIABLE (bool, discover_vst_on_start, "discover-vst-on-start", false)
CONFIG_VARIABLE (int, vst_scan_timeout, "vst-scan-timeout", 600) /* deciseconds, per plugin, <= 0 no timeout */
CONFIG_VARIABLE (bool, discover_audio_units, "discover-audio-units", false)
/* custom user plugin paths */
CONFIG_VARIABLE (std::string, plugin_path_vst, "plugin-path-vst", "@default@")

View File

@ -243,7 +243,7 @@ PluginManager::refresh (bool cache_only)
#ifdef AUDIOUNIT_SUPPORT
BootMessage (_("Scanning AU Plugins"));
au_refresh ();
au_refresh (cache_only);
#endif
BootMessage (_("Plugin Scan Complete..."));
@ -604,11 +604,23 @@ PluginManager::lv2_refresh ()
#ifdef AUDIOUNIT_SUPPORT
void
PluginManager::au_refresh ()
PluginManager::au_refresh (bool cache_only)
{
DEBUG_TRACE (DEBUG::PluginManager, "AU: refresh\n");
if (cache_only && !Config->get_discover_audio_units ()) {
return;
}
delete _au_plugin_info;
// disable automatic scan in case we crash
Config->set_discover_audio_units (false);
Config->save_state();
_au_plugin_info = AUPluginInfo::discover();
// successful scan re-enabled automatic discovery
Config->set_discover_audio_units (true);
Config->save_state();
}
#endif
@ -1050,9 +1062,9 @@ ARDOUR::PluginInfoList&
PluginManager::au_plugin_info ()
{
#ifdef AUDIOUNIT_SUPPORT
assert(_au_plugin_info);
return *_au_plugin_info;
#else
return _empty_plugin_info;
if (_au_plugin_info) {
return *_au_plugin_info;
}
#endif
return _empty_plugin_info;
}