diff options
author | Robin Gareus <robin@gareus.org> | 2015-02-28 15:51:06 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-02-28 15:52:28 +0100 |
commit | 380215a08c9a16fa763ccacea1510dcbc15946d4 (patch) | |
tree | 3da5ad7aa6d3bf3c32975f89d293a6407bfb9231 /libs/ardour | |
parent | c936c973b52ea4a98ebdcdbadbc87d80a06b70ac (diff) |
API to delete AU cache & blacklist
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/plugin_manager.h | 2 | ||||
-rw-r--r-- | libs/ardour/plugin_manager.cc | 38 |
2 files changed, 40 insertions, 0 deletions
diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index 31ab833508..3a6a210b5f 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -56,6 +56,8 @@ class LIBARDOUR_API PluginManager : public boost::noncopyable { void cancel_plugin_timeout(); void clear_vst_cache (); void clear_vst_blacklist (); + void clear_au_cache (); + void clear_au_blacklist (); const std::string get_default_windows_vst_path() const { return windows_vst_path; } const std::string get_default_lxvst_path() const { return lxvst_path; } diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index 01853ccdb3..2fc84d3679 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -49,6 +49,8 @@ #include <glib/gstdio.h> #include <glibmm/miscutils.h> #include <glibmm/pattern.h> +#include <glibmm/fileutils.h> +#include <glibmm/miscutils.h> #include "pbd/whitespace.h" #include "pbd/file_utils.h" @@ -342,6 +344,29 @@ PluginManager::clear_vst_blacklist () } void +PluginManager::clear_au_cache () +{ +#ifdef AUDIOUNIT_SUPPORT + // AUPluginInfo::au_cache_path () + string fn = Glib::build_filename (ARDOUR::user_config_directory(), "au_cache"); + if (Glib::file_test (fn, Glib::FILE_TEST_EXISTS)) { + ::g_unlink(fn.c_str()); + } +#endif +} + +void +PluginManager::clear_au_blacklist () +{ +#ifdef AUDIOUNIT_SUPPORT + string fn = Glib::build_filename (ARDOUR::user_cache_directory(), "au_blacklist.txt"); + if (Glib::file_test (fn, Glib::FILE_TEST_EXISTS)) { + ::g_unlink(fn.c_str()); + } +#endif +} + +void PluginManager::ladspa_refresh () { if (_ladspa_plugin_info) { @@ -623,6 +648,19 @@ PluginManager::au_refresh (bool cache_only) Config->set_discover_audio_units (false); Config->save_state(); + /* note: AU require a CAComponentDescription pointer provided by the OS. + * Ardour only caches port and i/o config. It can't just 'scan' without + * 'discovering' (like we do for VST). + * + * So in case discovery fails, we assume the worst: the Description + * is broken (malicious plugins) and even a simple 'scan' would always + * crash ardour on startup. Hence we disable Auto-Scan on start. + * + * If the crash happens at any later time (description is available), + * Ardour will blacklist the plugin in question -- unless + * the crash happens during realtime-run. + */ + _au_plugin_info = AUPluginInfo::discover(); // successful scan re-enabled automatic discovery |