API to delete AU cache & blacklist

This commit is contained in:
Robin Gareus
2015-02-28 15:51:06 +01:00
parent c936c973b5
commit 380215a08c
2 changed files with 40 additions and 0 deletions

View File

@@ -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; }

View File

@@ -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"
@@ -341,6 +343,29 @@ PluginManager::clear_vst_blacklist ()
#endif
}
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 ()
{
@@ -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