Merge with trunk R2935.
[ardour.git] / libs / ardour / plugin_manager.cc
index d321d6f259804c2eaeb43b23c212c20f703d4054..ae5d6f52ee26930b14097f3bb66792f90d8e6075 100644 (file)
 #include <ardour/plugin.h>
 #include <ardour/ladspa_plugin.h>
 
+#ifdef HAVE_SLV2
+#include <slv2/slv2.h>
+#include <ardour/lv2_plugin.h>
+#endif
+
 #ifdef VST_SUPPORT
 #include <ardour/vst_plugin.h>
 #endif
@@ -104,6 +109,11 @@ PluginManager::PluginManager ()
                ladspa_plugin_whitelist.push_back (2150); // tap pitch shifter
        } 
 
+#ifdef HAVE_SLV2
+       _lv2_world = slv2_world_new();
+       slv2_world_load_all(_lv2_world);
+#endif
+
        refresh ();
 }
 
@@ -111,6 +121,9 @@ void
 PluginManager::refresh ()
 {
        ladspa_refresh ();
+#ifdef HAVE_SLV2
+       lv2_refresh ();
+#endif
 #ifdef VST_SUPPORT
        if (Config->get_use_vst()) {
                vst_refresh ();
@@ -345,6 +358,21 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
        return label;
 }
 
+#ifdef HAVE_SLV2
+void
+PluginManager::lv2_refresh ()
+{
+       lv2_discover();
+}
+
+int
+PluginManager::lv2_discover ()
+{
+       _lv2_plugin_info = LV2PluginInfo::discover(_lv2_world);
+       return 0;
+}
+#endif
+
 #ifdef HAVE_AUDIOUNITS
 void
 PluginManager::au_refresh ()