| 156 | } |
| 157 | |
| 158 | PluginPaths |
| 159 | VST3EffectsModule::FindModulePaths(PluginManagerInterface &pluginManager) |
| 160 | { |
| 161 | //Note: The host recursively scans these folders at startup in this order (User/Global/Application). |
| 162 | //https://developer.steinberg.help/display/VST/Plug-in+Locations |
| 163 | |
| 164 | FilePaths pathList; |
| 165 | #ifdef __WXMSW__ |
| 166 | // Windows specific VST3 search paths |
| 167 | { |
| 168 | wxString programFilesPath; |
| 169 | if(wxGetEnv("programfiles", &programFilesPath)) |
| 170 | pathList.push_back(programFilesPath + "\\Common Files\\VST3"); |
| 171 | } |
| 172 | #elif __WXMAC__ |
| 173 | pathList.push_back("~/Library/Audio/Plug-ins/VST3/"); |
| 174 | pathList.push_back("/Library/Audio/Plug-ins/VST3/"); |
| 175 | pathList.push_back("/Network/Library/Audio/Plug-ins/VST3/"); |
| 176 | #elif __WXGTK__ |
| 177 | pathList.push_back(wxGetHomeDir() + "/.vst3/"); |
| 178 | pathList.push_back("/usr/lib/vst3/"); |
| 179 | pathList.push_back("/usr/local/lib/vst3/"); |
| 180 | #endif |
| 181 | |
| 182 | // bundled/app specific |
| 183 | { |
| 184 | auto path = wxFileName(PlatformCompatibility::GetExecutablePath()); |
| 185 | #ifdef __WXGTK__ |
| 186 | path.AppendDir("vst3"); |
| 187 | #else |
| 188 | path.AppendDir("VST3"); |
| 189 | #endif |
| 190 | pathList.push_back(path.GetPath()); |
| 191 | } |
| 192 | { |
| 193 | auto customPaths = pluginManager.ReadCustomPaths(*this); |
| 194 | std::copy(customPaths.begin(), customPaths.end(), std::back_inserter(pathList)); |
| 195 | } |
| 196 | |
| 197 | PluginPaths result; |
| 198 | VST3PluginTraverser vst3PluginTraverser([&](const wxString& pluginPath){ |
| 199 | result.push_back(pluginPath); |
| 200 | }); |
| 201 | |
| 202 | for(const auto& path : pathList) |
| 203 | { |
| 204 | wxDir dir(path); |
| 205 | if(dir.IsOpened()) |
| 206 | dir.Traverse(vst3PluginTraverser, wxEmptyString, wxDIR_DEFAULT); |
| 207 | } |
| 208 | return result; |
| 209 | } |
| 210 | |
| 211 | unsigned VST3EffectsModule::DiscoverPluginsAtPath(const PluginPath& path, TranslatableString& errMsg, |
| 212 | const RegistrationCallback& callback) |
nothing calls this directly
no test coverage detected