diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-09-10 21:27:39 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-09-10 21:27:39 +0000 |
commit | c86210a9d5bdb7b36ad58552a1f99f53d48781b3 (patch) | |
tree | 6ab06935a1e2bc4ef6a4448dd01b09f5b2628c66 /gtk2_ardour/plugin_ui.cc | |
parent | 68e943265edf04e63a8e8b8f62bab20f99d9c637 (diff) |
merge 2.0-ongoing into 3.0 @ 3581 - 3710
git-svn-id: svn://localhost/ardour2/branches/3.0@3712 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/plugin_ui.cc')
-rw-r--r-- | gtk2_ardour/plugin_ui.cc | 32 |
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) { |