Skip to content
Snippets Groups Projects
Commit 36f4c8ca authored by Christopher Stawarz's avatar Christopher Stawarz
Browse files

On OS X, look for user-installed plugins in ~/Library/Application Support/open-ephys/PlugIns

parent dd01a6be
Branches
Tags
No related merge requests found
......@@ -81,26 +81,35 @@ PluginManager::~PluginManager()
void PluginManager::loadAllPlugins()
{
Array<File> foundDLLs;
Array<File> paths;
#ifdef __APPLE__
paths.add(File::getSpecialLocation(File::currentApplicationFile).getChildFile("Contents/PlugIns"));
paths.add(File::getSpecialLocation(File::userApplicationDataDirectory).getChildFile("Application Support/open-ephys/PlugIns"));
#else
paths.add(File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile("plugins"));
#endif
for (auto &pluginPath : paths) {
if (!pluginPath.isDirectory()) {
std::cout << "Plugin path not found: " << pluginPath.getFullPathName() << std::endl;
} else {
loadPlugins(pluginPath);
}
}
}
void PluginManager::loadPlugins(const File &pluginPath) {
Array<File> foundDLLs;
#ifdef WIN32
File pluginPath = File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile("plugins");
String pluginExt("*.dll");
String pluginExt("*.dll");
#elif defined(__APPLE__)
File pluginPath = File::getSpecialLocation(File::currentApplicationFile).getChildFile("Contents/PlugIns");
String pluginExt("*.bundle");
#else
File pluginPath = File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile("plugins");
String pluginExt("*.so");
String pluginExt("*.so");
#endif
if (!pluginPath.isDirectory())
{
std::cout << "Plugin path not found" << std::endl;
return;
}
#ifdef __APPLE__
pluginPath.findChildFiles(foundDLLs, File::findDirectories, false, pluginExt);
#else
......
......@@ -63,6 +63,7 @@ public:
PluginManager();
~PluginManager();
void loadAllPlugins();
void loadPlugins(const File &pluginPath);
int loadPlugin(const String&);
//void unloadPlugin(Plugin *);
void removeAllPlugins();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment