X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fplugin_manager.cc;h=912fc20dcda350fb6f6c1ac510f58860a8eb92b2;hb=c99738d88e8a2ad806b219b9f3614a6b55b6bf37;hp=5597fac9e8802beba71e86644b161ee63a128cbd;hpb=6f5ee7c4293c43486d48bac00fdcdba90dabb17d;p=ardour.git diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index 5597fac9e8..912fc20dcd 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -21,7 +21,6 @@ #include "libardour-config.h" #endif -#define __STDC_FORMAT_MACROS 1 #include #include @@ -49,8 +48,7 @@ #include "ardour/ladspa_plugin.h" #include "ardour/filesystem_paths.h" -#ifdef HAVE_SLV2 -#include +#ifdef LV2_SUPPORT #include "ardour/lv2_plugin.h" #endif @@ -135,19 +133,12 @@ PluginManager::PluginManager () ladspa_plugin_whitelist.push_back (2150); // tap pitch shifter } -#ifdef HAVE_SLV2 - _lv2_world = new LV2World(); -#endif - BootMessage (_("Discovering Plugins")); } PluginManager::~PluginManager() { -#ifdef HAVE_SLV2 - delete _lv2_world; -#endif } @@ -155,7 +146,7 @@ void PluginManager::refresh () { ladspa_refresh (); -#ifdef HAVE_SLV2 +#ifdef LV2_SUPPORT lv2_refresh (); #endif #ifdef VST_SUPPORT @@ -190,7 +181,7 @@ PluginManager::ladspa_refresh () /* allow LADSPA_PATH to augment, not override standard locations */ /* Only add standard locations to ladspa_path if it doesn't - * already contain them. Check for trailing '/'s too. + * already contain them. Check for trailing G_DIR_SEPARATOR too. */ int i; @@ -201,7 +192,7 @@ PluginManager::ladspa_refresh () case ':' : case '\0': continue; - case '/' : + case G_DIR_SEPARATOR : if (ladspa_path[found + strlen(standard_paths[i]) + 1] == ':' || ladspa_path[found + strlen(standard_paths[i]) + 1] == '\0') { continue; @@ -443,15 +434,41 @@ PluginManager::get_ladspa_category (uint32_t plugin_id) string label = matches2->object; lrdf_free_statements(matches2); - return label; + /* Kludge LADSPA class names to be singular and match LV2 class names. + This avoids duplicate plugin menus for every class, which is necessary + to make the plugin category menu at all usable, but is obviously a + filthy kludge. + + In the short term, lrdf could be updated so the labels match and a new + release made. To support both specs, we should probably be mapping the + URIs to the same category in code and perhaps tweaking that hierarchy + dynamically to suit the user. Personally, I (drobilla) think that time + is better spent replacing the little-used LRDF. + + In the longer term, we will abandon LRDF entirely in favour of LV2 and + use that class hierarchy. Aside from fixing this problem properly, that + will also allow for translated labels. SWH plugins have been LV2 for + ages; TAP needs porting. I don't know of anything else with LRDF data. + */ + if (label == "Utilities") { + return "Utility"; + } else if (label == "Pitch shifters") { + return "Pitch Shifter"; + } else if (label != "Dynamics" && label != "Chorus" + &&label[label.length() - 1] == 's' + && label[label.length() - 2] != 's') { + return label.substr(0, label.length() - 1); + } else { + return label; + } } -#ifdef HAVE_SLV2 +#ifdef LV2_SUPPORT void PluginManager::lv2_refresh () { delete _lv2_plugin_info; - _lv2_plugin_info = LV2PluginInfo::discover(_lv2_world); + _lv2_plugin_info = LV2PluginInfo::discover(); } #endif @@ -623,7 +640,7 @@ PluginManager::save_statuses () ofs << "Hidden"; break; } - + ofs << ' '; ofs << (*i).unique_id;; ofs << endl; @@ -642,7 +659,7 @@ PluginManager::load_statuses () if (!ifs) { return; } - + std::string stype; std::string sstatus; std::string id; @@ -697,12 +714,12 @@ PluginManager::load_statuses () << endmsg; continue; } - + id = buf; strip_whitespace_edges (id); set_status (type, id, status); } - + ifs.close (); } @@ -716,8 +733,7 @@ PluginManager::set_status (PluginType t, string id, PluginStatusType status) return; } - pair res = statuses.insert (ps); - //cerr << "Added " << t << " " << id << " " << status << " success ? " << res.second << endl; + statuses.insert (ps); } ARDOUR::PluginInfoList& @@ -743,7 +759,7 @@ PluginManager::ladspa_plugin_info () ARDOUR::PluginInfoList& PluginManager::lv2_plugin_info () { -#ifdef HAVE_SLV2 +#ifdef LV2_SUPPORT if (!_lv2_plugin_info) lv2_refresh(); return *_lv2_plugin_info;