wxArrayString NyquistEffectsModule::FindPlugins(PluginManagerInterface & pm) { wxArrayString pathList = NyquistEffect::GetNyquistSearchPath(); wxArrayString files; // Add the Nyquist prompt effect files.Add(NYQUIST_PROMPT_ID); // Load .ny plug-ins pm.FindFilesInPathList(wxT("*.ny"), pathList, files); // LLL: Works for all platform with NEW plugin support (dups are removed) pm.FindFilesInPathList(wxT("*.NY"), pathList, files); // Ed's fix for bug 179 return files; }
bool NyquistEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm) { // Autoregister effects that we "think" are ones that have been shipped with // Audacity. A little simplistic, but it should suffice for now. wxArrayString pathList = NyquistEffect::GetNyquistSearchPath(); wxArrayString files; if (!pm.IsPluginRegistered(NYQUIST_PROMPT_ID)) { RegisterPlugin(pm, NYQUIST_PROMPT_ID); } for (int i = 0; i < WXSIZEOF(kShippedEffects); i++) { files.Clear(); pm.FindFilesInPathList(kShippedEffects[i], pathList, files); for (size_t j = 0, cnt = files.GetCount(); j < cnt; j++) { if (!pm.IsPluginRegistered(files[j])) { RegisterPlugin(pm, files[j]); } } } // We still want to be called during the normal registration process return false; }
wxArrayString LadspaEffectsModule::FindPlugins(PluginManagerInterface & pm) { wxArrayString pathList = GetSearchPaths(); wxArrayString files; #if defined(__WXMAC__) // Recursively scan for all shared objects pm.FindFilesInPathList(wxT("*.so"), pathList, files, true); #elif defined(__WXMSW__) // Recursively scan for all DLLs pm.FindFilesInPathList(wxT("*.dll"), pathList, files, true); #else // Recursively scan for all shared objects pm.FindFilesInPathList(wxT("*.so"), pathList, files, true); #endif return files; }
wxArrayString LadspaEffectsModule::FindPlugins(PluginManagerInterface & pm) { #if defined(USE_LIBLRDF) && defined(EFFECT_CATEGORIES) EffectManager& em = EffectManager::Get(); wxArrayString rdfPathList; wxString rdfPathVar; wxArrayString rdfFiles; InitCategoryMap(); lrdf_init(); rdfPathVar = wxGetenv(wxT("LADSPA_RDF_PATH")); if (rdfPathVar != wxT("")) wxGetApp().AddMultiPathsToPathList(rdfPathVar, rdfPathList); #ifdef __WXGTK__ wxGetApp().AddUniquePathToPathList(wxT("/usr/share/ladspa/rdf"), rdfPathList); wxGetApp().AddUniquePathToPathList(wxT("/usr/local/share/ladspa/rdf"), rdfPathList); #endif #ifdef __WXMAC__ wxGetApp().AddUniquePathToPathList(wxT("/usr/share/ladspa/rdf"), rdfPathList); // XXX Maybe other Mac paths here? #endif #ifdef __WXMSW__ //wxGetApp().AddUniquePathToPathList(wxT("WINDOWS LRDF PATH"), // rdfPathList); // XXX Other Windows paths here. #endif // Add the Audacity paths so we get ladspa.rdfs if we are using a local // liblrdf for(i=0; i<audacityPathList.GetCount(); i++) { wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH; wxGetApp().AddUniquePathToPathList(prefix + wxT("rdf"), rdfPathList); } wxGetApp().FindFilesInPathList(wxT("*.rdf"), rdfPathList, rdfFiles); wxGetApp().FindFilesInPathList(wxT("*.rdfs"), rdfPathList, rdfFiles); for(size_t i = 0; i < rdfFiles.GetCount(); ++i) { wxString fileUri(wxT("file://")); fileUri += rdfFiles[i]; lrdf_read_file(fileUri.mb_str(wxConvUTF8)); } // Add all plugin categories found by LRDF lrdf_uris* cats = lrdf_get_all_subclasses("http://ladspa.org/ontology#Plugin"); if (cats) { // Add the categories and find the plugins belonging to them for (size_t i = 0; i < cats->count; ++i) { char* label = lrdf_get_label(cats->items[i]); if (!label) continue; wxString uri = MapCategoryUri(wxString::FromAscii(cats->items[i])); em.AddCategory(uri, wxString::FromUTF8(label)); std::free(label); lrdf_uris* plugs = lrdf_get_instances(cats->items[i]); if (plugs) { for (size_t j = 0; j < plugs->count; ++j) { unsigned long uid = lrdf_get_uid(plugs->items[j]); gPluginCategories.insert(std::make_pair(uid, uri)); } lrdf_free_uris(plugs); } } // And their relationships for (size_t i = 0; i < cats->count; ++i) { EffectCategory* p = em.LookupCategory(MapCategoryUri(wxString::FromAscii(cats-> items[i]))); if (!p) continue; lrdf_uris* subs = lrdf_get_subclasses(cats->items[i]); if (subs) { for (size_t j = 0; j < subs->count; ++j) { EffectCategory* c = em.LookupCategory(MapCategoryUri(wxString::FromAscii(subs->items[j]))); if (c) em.AddCategoryParent(c, p); } lrdf_free_uris(subs); } } lrdf_free_uris(cats); } #endif wxArrayString pathList; wxArrayString files; wxString pathVar; // Check for the LADSPA_PATH environment variable pathVar = wxString::FromUTF8(getenv("LADSPA_PATH")); if (!pathVar.empty()) { wxStringTokenizer tok(pathVar); while (tok.HasMoreTokens()) { pathList.Add(tok.GetNextToken()); } } #if defined(__WXMAC__) #define LADSPAPATH wxT("/Library/Audio/Plug-Ins/LADSPA") // Look in ~/Library/Audio/Plug-Ins/LADSPA and /Library/Audio/Plug-Ins/LADSPA pathList.Add(wxGetHomeDir() + wxFILE_SEP_PATH + LADSPAPATH); pathList.Add(LADSPAPATH); // Recursively scan for all shared objects pm.FindFilesInPathList(wxT("*.so"), pathList, files, true); #elif defined(__WXMSW__) // Recursively scan for all DLLs pm.FindFilesInPathList(wxT("*.dll"), pathList, files, true); #else pathList.Add(wxGetHomeDir() + wxFILE_SEP_PATH + wxT(".ladspa")); pathList.Add(wxT("/usr/local/lib/ladspa")); pathList.Add(wxT("/usr/lib/ladspa")); pathList.Add(wxT(LIBDIR) wxT("/ladspa")); // Recursively scan for all shared objects pm.FindFilesInPathList(wxT("*.so"), pathList, files, true); #endif return files; }