diff options
author | David Robillard <d@drobilla.net> | 2011-04-28 15:36:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-28 15:36:51 +0000 |
commit | 06e8b6452dd458cee1ad0e53046a12923cf294e9 (patch) | |
tree | bfc168bf527fd9887df2420398864d2df253432f | |
parent | 0060b9929f168f3727a53f34ba9efcba6795a624 (diff) |
Fix external UIs (e.g. Calf git).
git-svn-id: svn://localhost/ardour2/branches/3.0@9442 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/lv2_plugin_ui.cc | 11 | ||||
-rw-r--r-- | gtk2_ardour/lv2_plugin_ui.h | 1 | ||||
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 12 |
3 files changed, 14 insertions, 10 deletions
diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index 8cd3382ad1..cd43f410f4 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -33,8 +33,7 @@ using namespace ARDOUR; using namespace PBD; #if defined(HAVE_NEW_SLV2) && defined(HAVE_SUIL) -SuilHost* LV2PluginUI::ui_host = NULL; -SLV2Value LV2PluginUI::ui_GtkUI = NULL; +SuilHost* LV2PluginUI::ui_host = NULL; #endif void @@ -178,17 +177,17 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) #if defined(HAVE_NEW_SLV2) && defined(HAVE_SUIL) if (!LV2PluginUI::ui_host) { - LV2PluginUI::ui_GtkUI = slv2_value_new_uri( - ARDOUR::PluginManager::the_manager()->lv2_world()->world, - "http://lv2plug.in/ns/extensions/ui#GtkUI"); LV2PluginUI::ui_host = suil_host_new( LV2PluginUI::lv2_ui_write, NULL, NULL, NULL); } + LV2World* lv2_world = ARDOUR::PluginManager::the_manager()->lv2_world(); + SLV2Value container_type = (is_external_ui) + ? lv2_world->external_gui : lv2_world->gtk_gui; SLV2UI ui = _lv2->slv2_ui(); _inst = suil_instance_new( LV2PluginUI::ui_host, this, - slv2_value_as_uri(ui_GtkUI), + slv2_value_as_uri(container_type), slv2_value_as_uri(slv2_plugin_get_uri(_lv2->slv2_plugin())), slv2_value_as_uri(slv2_ui_get_uri(ui)), slv2_value_as_uri(_lv2->ui_type()), diff --git a/gtk2_ardour/lv2_plugin_ui.h b/gtk2_ardour/lv2_plugin_ui.h index 5eacff14cc..ccbd177f56 100644 --- a/gtk2_ardour/lv2_plugin_ui.h +++ b/gtk2_ardour/lv2_plugin_ui.h @@ -84,6 +84,7 @@ class LV2PluginUI : public PlugUIBase, public Gtk::VBox #if defined(HAVE_NEW_SLV2) && defined(HAVE_SUIL) static SuilHost* ui_host; static SLV2Value ui_GtkUI; + static SLV2Value ui_external; SuilInstance* _inst; #else diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index eef3e3065d..67fbd97c32 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -211,13 +211,15 @@ LV2Plugin::init(LV2World& world, SLV2Plugin plugin, framecnt_t rate) // Look for embeddable UI SLV2Value ui_type = NULL; SLV2_FOREACH(uis, u, uis) { - SLV2UI this_ui = slv2_uis_get(uis, u); + SLV2UI this_ui = slv2_uis_get(uis, u); + SLV2Value this_ui_type = NULL; if (slv2_ui_is_supported(this_ui, suil_ui_supported, _world.gtk_gui, - &_ui_type)) { + &this_ui_type)) { // TODO: Multiple UI support - _ui = this_ui; + _ui = this_ui; + _ui_type = this_ui_type; break; } } @@ -226,7 +228,8 @@ LV2Plugin::init(LV2World& world, SLV2Plugin plugin, framecnt_t rate) for (unsigned i = 0; i < slv2_uis_size(uis); ++i) { SLV2UI ui = slv2_uis_get_at(uis, i); if (slv2_ui_is_a(ui, _world.gtk_gui)) { - _ui = ui; + _ui = ui; + _ui_type = _world.gtk_gui; break; } } @@ -238,6 +241,7 @@ LV2Plugin::init(LV2World& world, SLV2Plugin plugin, framecnt_t rate) SLV2UI ui = slv2_uis_get_at(uis, i); if (slv2_ui_is_a(ui, _world.external_gui)) { _ui = ui; + _ui_type = _world.external_gui; break; } } |