#include "ardour/mac_vst_support.h"
#include "ardour/mac_vst_plugin.h"
#include "pbd/basename.h"
+#include "pbd/pathexpand.h"
#include <cstring>
#endif //MACVST_SUPPORT
BootMessage (_("Discovering Mac VST Plugins"));
}
mac_vst_refresh (cache_only);
+ } else if (_mac_vst_plugin_info) {
+ _mac_vst_plugin_info->clear ();
+ } else {
+ _mac_vst_plugin_info = new ARDOUR::PluginInfoList();
}
#endif //Native Mac VST SUPPORT
DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Discovering Windows VST plugins along %1\n", path));
+ if (Session::get_disable_all_loaded_plugins ()) {
+ info << _("Disabled WindowsVST scan (safe mode)") << endmsg;
+ return -1;
+ }
+
if (Config->get_verbose_plugin_scan()) {
info << string_compose (_("--- Windows VST plugins Scan: %1"), path) << endmsg;
}
mac_vst_discover_from_path ("~/Library/Audio/Plug-Ins/VST:/Library/Audio/Plug-Ins/VST", cache_only);
}
-static bool mac_vst_filter (const string& str, void *)
+static bool mac_vst_filter (const string& str)
{
- if (!Glib::file_test (str, Glib::FILE_TEST_IS_DIR)) {
- return false;
- }
string plist = Glib::build_filename (str, "Contents", "Info.plist");
if (!Glib::file_test (plist, Glib::FILE_TEST_IS_REGULAR)) {
return false;
int
PluginManager::mac_vst_discover_from_path (string path, bool cache_only)
{
- vector<string> plugin_objects;
- vector<string>::iterator x;
+ if (Session::get_disable_all_loaded_plugins ()) {
+ info << _("Disabled MacVST scan (safe mode)") << endmsg;
+ return -1;
+ }
- find_paths_matching_filter (plugin_objects, path, mac_vst_filter, 0, true, true, false);
+ Searchpath paths (path);
+ /* customized version of run_functor_for_paths() */
+ for (vector<string>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
+ string expanded_path = path_expand (*i);
+ if (!Glib::file_test (expanded_path, Glib::FILE_TEST_IS_DIR)) continue;
+ try {
+ Glib::Dir dir(expanded_path);
+ for (Glib::DirIterator di = dir.begin(); di != dir.end(); di++) {
+ string fullpath = Glib::build_filename (expanded_path, *di);
- for (x = plugin_objects.begin(); x != plugin_objects.end (); ++x) {
- ARDOUR::PluginScanMessage(_("MacVST"), *x, !cache_only && !cancelled());
- mac_vst_discover (*x, cache_only || cancelled());
+ /* we're only interested in bundles */
+ if (!Glib::file_test (fullpath, Glib::FILE_TEST_IS_DIR)) {
+ continue;
+ }
+
+ if (mac_vst_filter (fullpath)) {
+ ARDOUR::PluginScanMessage(_("MacVST"), fullpath, !cache_only && !cancelled());
+ mac_vst_discover (fullpath, cache_only || cancelled());
+ continue;
+ }
+
+ /* don't descend into AU bundles in the VST dir */
+ if (fullpath[0] == '.' || (fullpath.length() > 10 && strings_equal_ignore_case (".component", fullpath.substr(fullpath.length() - 10)))) {
+ continue;
+ }
+
+ /* recurse */
+ mac_vst_discover_from_path (fullpath, cache_only);
+ }
+ } catch (Glib::FileError& err) { }
}
+
return 0;
}
vector<string>::iterator x;
int ret = 0;
+ if (Session::get_disable_all_loaded_plugins ()) {
+ info << _("Disabled LinuxVST scan (safe mode)") << endmsg;
+ return -1;
+ }
+
#ifndef NDEBUG
(void) path;
#endif
PluginManager::PluginStatusType
-PluginManager::get_status (const PluginInfoPtr& pi)
+PluginManager::get_status (const PluginInfoPtr& pi) const
{
PluginStatus ps (pi->type, pi->unique_id);
PluginStatusList::const_iterator i = find (statuses.begin(), statuses.end(), ps);
type = Windows_VST;
} else if (stype == "LXVST") {
type = LXVST;
+ } else if (stype == "MacVST") {
+ type = MacVST;
} else if (stype == "Lua") {
type = Lua;
} else {
statuses.insert (ps);
}
-ARDOUR::PluginInfoList&
+const ARDOUR::PluginInfoList&
PluginManager::windows_vst_plugin_info ()
{
#ifdef WINDOWS_VST_SUPPORT
#endif
}
-ARDOUR::PluginInfoList&
+const ARDOUR::PluginInfoList&
PluginManager::mac_vst_plugin_info ()
{
#ifdef MACVST_SUPPORT
#endif
}
-ARDOUR::PluginInfoList&
+const ARDOUR::PluginInfoList&
PluginManager::lxvst_plugin_info ()
{
#ifdef LXVST_SUPPORT
#endif
}
-ARDOUR::PluginInfoList&
+const ARDOUR::PluginInfoList&
PluginManager::ladspa_plugin_info ()
{
assert(_ladspa_plugin_info);
return *_ladspa_plugin_info;
}
-ARDOUR::PluginInfoList&
+const ARDOUR::PluginInfoList&
PluginManager::lv2_plugin_info ()
{
#ifdef LV2_SUPPORT
#endif
}
-ARDOUR::PluginInfoList&
+const ARDOUR::PluginInfoList&
PluginManager::au_plugin_info ()
{
#ifdef AUDIOUNIT_SUPPORT
return _empty_plugin_info;
}
-ARDOUR::PluginInfoList&
+const ARDOUR::PluginInfoList&
PluginManager::lua_plugin_info ()
{
assert(_lua_plugin_info);