1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2007 - 2016 Christian Schoenebeck * |
* Copyright (C) 2007 - 2021 Christian Schoenebeck * |
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
98 |
} else throw Exception("unknown instrument editor"); |
} else throw Exception("unknown instrument editor"); |
99 |
} |
} |
100 |
|
|
101 |
|
std::vector<String> InstrumentEditorFactory::PluginDirs() { |
102 |
|
std::vector<String> dirs; |
103 |
|
|
104 |
|
// getenv() is available on POSIX and Windows |
105 |
|
char* pcEnvPluginDir = getenv("LINUXSAMPLER_PLUGIN_DIR"); |
106 |
|
if (pcEnvPluginDir) { |
107 |
|
String sEnvPluginDir = pcEnvPluginDir; |
108 |
|
if (!sEnvPluginDir.empty()) |
109 |
|
dirs.push_back(sEnvPluginDir); |
110 |
|
} |
111 |
|
|
112 |
|
#if defined(WIN32) |
113 |
|
if (dirs.empty()) { |
114 |
|
String installDir = Sampler::GetInstallDir(); |
115 |
|
if (!installDir.empty()) |
116 |
|
dirs.push_back(installDir + "\\plugins"); |
117 |
|
} |
118 |
|
#endif |
119 |
|
|
120 |
|
if (dirs.empty()) |
121 |
|
dirs.push_back(CONFIG_PLUGIN_DIR); |
122 |
|
|
123 |
|
return dirs; |
124 |
|
} |
125 |
|
|
126 |
|
String InstrumentEditorFactory::PluginDirsAsString() { |
127 |
|
std::vector<String> dirs = PluginDirs(); |
128 |
|
String result; |
129 |
|
for (const String& dir : dirs) { |
130 |
|
if (!result.empty()) result += ", "; |
131 |
|
result += "'" + dir + "'"; |
132 |
|
} |
133 |
|
return result; |
134 |
|
} |
135 |
|
|
136 |
void InstrumentEditorFactory::LoadPlugins() { |
void InstrumentEditorFactory::LoadPlugins() { |
137 |
if (!bPluginsLoaded) { |
if (!bPluginsLoaded) { |
138 |
dmsg(1,("Loading instrument editor plugins...")); |
dmsg(1,("Loading instrument editor plugins...")); |