summaryrefslogtreecommitdiff
path: root/gtk2_ardour/plugin_ui.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-09 00:49:07 +0000
committerDavid Robillard <d@drobilla.net>2008-08-09 00:49:07 +0000
commitdaf91bc21def66a2d4a875bb1c32c8cb6fcf176b (patch)
treee9c98e981d0b03d540ff1b805ebcd9f9961816bd /gtk2_ardour/plugin_ui.cc
parenta35abc05287a6fd8e1e91f24aa4f829201d0e4e1 (diff)
Embedded LV2 GTK GUI support.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3678 d708f5d6-7413-0410-9779-e7cbd77b26cf
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 7d000d3a45..4918523af3 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>
@@ -83,6 +87,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)")
@@ -248,6 +256,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) {