summaryrefslogtreecommitdiff
path: root/gtk2_ardour/plugin_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/plugin_ui.cc')
-rw-r--r--gtk2_ardour/plugin_ui.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc
index d3c9effaa2..a91a5bf9d1 100644
--- a/gtk2_ardour/plugin_ui.cc
+++ b/gtk2_ardour/plugin_ui.cc
@@ -42,6 +42,10 @@
#ifdef VST_SUPPORT
#include <ardour/vst_plugin.h>
#endif
+#ifdef HAVE_LV2
+#include <ardour/lv2_plugin.h>
+#include "lv2_plugin_ui.h"
+#endif
#include <lrdf.h>
@@ -86,6 +90,10 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert
error << _("Eh? LADSPA plugins don't have editors!") << endmsg;
break;
+ case ARDOUR::LV2:
+ have_gui = create_lv2_editor (insert);
+ break;
+
default:
#ifndef VST_SUPPORT
error << _("unknown type of editor-supplying plugin (note: no VST support in this version of ardour)")
@@ -251,6 +259,30 @@ PluginUIWindow::app_activated (bool yn)
}
bool
+PluginUIWindow::create_lv2_editor(boost::shared_ptr<PluginInsert> insert)
+{
+#ifndef HAVE_LV2
+ return false;
+#else
+
+ boost::shared_ptr<LV2Plugin> vp;
+
+ if ((vp = boost::dynamic_pointer_cast<LV2Plugin> (insert->plugin())) == 0) {
+ error << _("create_lv2_editor called on non-LV2 plugin") << endmsg;
+ throw failed_constructor ();
+ } else {
+ LV2PluginUI* lpu = new LV2PluginUI (insert, vp);
+ _pluginui = lpu;
+ add (*lpu);
+ lpu->package (*this);
+ }
+
+ non_gtk_gui = false;
+ return true;
+#endif
+}
+
+bool
PluginUIWindow::on_key_press_event (GdkEventKey* event)
{
if (non_gtk_gui) {