Remove beat entry from meter dialog (beats are not allowed in API), clean up some...
[ardour.git] / libs / ardour / plugin.cc
index 2b193ab0e6ca2746ab01d132d587e4bac3bad17f..d8616eabde6d7c6a55637ca8dfe4ed161f90545f 100644 (file)
 #include <ardour/audio_unit.h>
 #endif
 
+#ifdef HAVE_SLV2
+#include <ardour/lv2_plugin.h>
+#endif
+
 #include <pbd/stl_delete.h>
 
 #include "i18n.h"
@@ -91,9 +95,7 @@ void
 Plugin::make_nth_control (uint32_t n, const XMLNode& node)
 {
        if (controls[n]) {
-               error << string_compose (_("programming error: %1"),
-                                        X_("Plugin::make_nth_control() called too late"))
-                     << endmsg;
+               /* already constructed */
                return;
        }
 
@@ -316,6 +318,12 @@ ARDOUR::find_plugin(Session& session, string identifier, PluginType type)
        case ARDOUR::LADSPA:
                plugs = mgr->ladspa_plugin_info();
                break;
+       
+#ifdef HAVE_SLV2
+       case ARDOUR::LV2:
+               plugs = mgr->lv2_plugin_info();
+               break;
+#endif
 
 #ifdef VST_SUPPORT
        case ARDOUR::VST:
@@ -340,6 +348,19 @@ ARDOUR::find_plugin(Session& session, string identifier, PluginType type)
                        return (*i)->load (session);
                }
        }
+
+#ifdef VST_SUPPORT
+       /* hmm, we didn't find it. could be because in older versions of Ardour.
+          we used to store the name of a VST plugin, not its unique ID. so try
+          again.
+       */
+
+       for (i = plugs.begin(); i != plugs.end(); ++i) {
+               if (identifier == (*i)->name){
+                       return (*i)->load (session);
+               }
+       }
+#endif
        
        return PluginPtr ((Plugin*) 0);
 }