| 221 | } |
| 222 | |
| 223 | PluginPaths LV2EffectsModule::FindModulePaths(PluginManagerInterface &) |
| 224 | { |
| 225 | // Retrieve data about all LV2 plugins |
| 226 | const LilvPlugins *plugs = lilv_world_get_all_plugins(LV2Symbols::gWorld); |
| 227 | |
| 228 | // Iterate over all plugins retrieve their URI |
| 229 | PluginPaths plugins; |
| 230 | LILV_FOREACH(plugins, i, plugs) |
| 231 | { |
| 232 | const LilvPlugin *plug = lilv_plugins_get(plugs, i); |
| 233 | const LilvNode *cls = lilv_plugin_class_get_uri(lilv_plugin_get_class(plug)); |
| 234 | LilvNodePtr name{ lilv_plugin_get_name(plug) }; |
| 235 | |
| 236 | // Bypass unsupported plugin types |
| 237 | using namespace LV2Symbols; |
| 238 | if (lilv_node_equals(cls, node_InstrumentPlugin) || |
| 239 | lilv_node_equals(cls, node_MIDIPlugin) || |
| 240 | lilv_node_equals(cls, node_MathConstants) || |
| 241 | lilv_node_equals(cls, node_MathFunctions)) |
| 242 | { |
| 243 | wxLogInfo(wxT("LV2 plugin '%s' has unsupported type '%s'"), lilv_node_as_string(lilv_plugin_get_uri(plug)), lilv_node_as_string(cls)); |
| 244 | continue; |
| 245 | } |
| 246 | |
| 247 | // If it doesn't have a name or has no ports, then it's not valid |
| 248 | if (!name || !lilv_plugin_get_port_by_index(plug, 0)) |
| 249 | { |
| 250 | wxLogInfo(wxT("LV2 plugin '%s' is invalid"), lilv_node_as_string(lilv_plugin_get_uri(plug))); |
| 251 | continue; |
| 252 | } |
| 253 | |
| 254 | plugins.push_back(LilvString(lilv_plugin_get_uri(plug))); |
| 255 | } |
| 256 | |
| 257 | return plugins; |
| 258 | } |
| 259 | |
| 260 | unsigned LV2EffectsModule::DiscoverPluginsAtPath( |
| 261 | const PluginPath & path, TranslatableString &errMsg, |
no test coverage detected