Skip to content

Commit 36f4c8c

Browse files
committed
On OS X, look for user-installed plugins in ~/Library/Application Support/open-ephys/PlugIns
1 parent dd01a6b commit 36f4c8c

2 files changed

Lines changed: 24 additions & 14 deletions

File tree

Source/Processors/PluginManager/PluginManager.cpp

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,26 +81,35 @@ PluginManager::~PluginManager()
8181

8282
void PluginManager::loadAllPlugins()
8383
{
84-
Array<File> foundDLLs;
84+
Array<File> paths;
85+
86+
#ifdef __APPLE__
87+
paths.add(File::getSpecialLocation(File::currentApplicationFile).getChildFile("Contents/PlugIns"));
88+
paths.add(File::getSpecialLocation(File::userApplicationDataDirectory).getChildFile("Application Support/open-ephys/PlugIns"));
89+
#else
90+
paths.add(File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile("plugins"));
91+
#endif
92+
93+
for (auto &pluginPath : paths) {
94+
if (!pluginPath.isDirectory()) {
95+
std::cout << "Plugin path not found: " << pluginPath.getFullPathName() << std::endl;
96+
} else {
97+
loadPlugins(pluginPath);
98+
}
99+
}
100+
}
85101

102+
void PluginManager::loadPlugins(const File &pluginPath) {
103+
Array<File> foundDLLs;
104+
86105
#ifdef WIN32
87-
File pluginPath = File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile("plugins");
88-
String pluginExt("*.dll");
106+
String pluginExt("*.dll");
89107
#elif defined(__APPLE__)
90-
File pluginPath = File::getSpecialLocation(File::currentApplicationFile).getChildFile("Contents/PlugIns");
91108
String pluginExt("*.bundle");
92109
#else
93-
File pluginPath = File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile("plugins");
94-
String pluginExt("*.so");
110+
String pluginExt("*.so");
95111
#endif
96-
97-
98-
if (!pluginPath.isDirectory())
99-
{
100-
std::cout << "Plugin path not found" << std::endl;
101-
return;
102-
}
103-
112+
104113
#ifdef __APPLE__
105114
pluginPath.findChildFiles(foundDLLs, File::findDirectories, false, pluginExt);
106115
#else

Source/Processors/PluginManager/PluginManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class PluginManager {
6363
PluginManager();
6464
~PluginManager();
6565
void loadAllPlugins();
66+
void loadPlugins(const File &pluginPath);
6667
int loadPlugin(const String&);
6768
//void unloadPlugin(Plugin *);
6869
void removeAllPlugins();

0 commit comments

Comments
 (0)