diff options
author | David Robillard <d@drobilla.net> | 2011-04-22 08:08:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-22 08:08:37 +0000 |
commit | c37722f7dc3c3872095a70eb35bd43f4662d99f5 (patch) | |
tree | a51d2b31118ed41374ea754480f2bc548fda0214 /libs | |
parent | 12bb5b62071e25168922ef0fe27f23493bed05db (diff) |
Use new Suil and SLV2 APIs for LV2 plugin UIs.
Add lv2_ui.h (required by lv2_external_ui.h).
git-svn-id: svn://localhost/ardour2/branches/3.0@9406 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/lv2_plugin.h | 2 | ||||
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 26 | ||||
-rw-r--r-- | libs/ardour/wscript | 3 |
3 files changed, 29 insertions, 2 deletions
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h index a854a2ac8e..91dc2f61a5 100644 --- a/libs/ardour/ardour/lv2_plugin.h +++ b/libs/ardour/ardour/lv2_plugin.h @@ -74,6 +74,7 @@ class LV2Plugin : public ARDOUR::Plugin SLV2Plugin slv2_plugin () { return _plugin; } SLV2UI slv2_ui () { return _ui; } + SLV2Value ui_type() { return _ui_type; } SLV2Port slv2_port (uint32_t i) { return slv2_plugin_get_port_by_index (_plugin, i); } bool is_external_ui () const; @@ -125,6 +126,7 @@ class LV2Plugin : public ARDOUR::Plugin LV2_Feature** _features; SLV2Plugin _plugin; SLV2UI _ui; + SLV2Value _ui_type; SLV2Value _name; SLV2Value _author; SLV2Instance _instance; diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 9978cec1dd..57242afab3 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -30,8 +30,11 @@ #include "pbd/compose.h" #include "pbd/error.h" #include "pbd/pathscanner.h" +#include "pbd/stl_delete.h" #include "pbd/xml++.h" +#include "libardour-config.h" + #include "ardour/ardour.h" #include "ardour/audio_buffer.h" #include "ardour/audioengine.h" @@ -40,14 +43,15 @@ #include "ardour/lv2_plugin.h" #include "ardour/session.h" -#include "pbd/stl_delete.h" - #include "i18n.h" #include <locale.h> #include "lv2ext/lv2_files.h" #include "lv2ext/lv2_persist.h" #include "rdff.h" +#ifdef HAVE_SUIL +#include <suil/suil.h> +#endif #define NS_DC "http://dublincore.org/documents/dcmi-namespace/" #define NS_LV2 "http://lv2plug.in/ns/lv2core#" @@ -98,6 +102,7 @@ LV2Plugin::init(LV2World& world, SLV2Plugin plugin, framecnt_t rate) _world = world; _plugin = plugin; _ui = NULL; + _ui_type = NULL; _control_data = 0; _shadow_data = 0; _latency_control_port = 0; @@ -202,6 +207,21 @@ LV2Plugin::init(LV2World& world, SLV2Plugin plugin, framecnt_t rate) SLV2UIs uis = slv2_plugin_get_uis(_plugin); if (slv2_uis_size(uis) > 0) { +#if defined(HAVE_NEW_SLV2) and defined(HAVE_SUIL) + // Look for embeddable UI + SLV2Value ui_type = NULL; + SLV2_FOREACH(u, uis) { + SLV2UI this_ui = slv2_uis_get(uis, u); + if (slv2_ui_is_supported(this_ui, + suil_ui_supported, + _world.gtk_gui, + &_ui_type)) { + // TODO: Multiple UI support + _ui = this_ui; + break; + } + } +#else // Look for Gtk native UI for (unsigned i = 0; i < slv2_uis_size(uis); ++i) { SLV2UI ui = slv2_uis_get_at(uis, i); @@ -210,6 +230,7 @@ LV2Plugin::init(LV2World& world, SLV2Plugin plugin, framecnt_t rate) break; } } +#endif // If Gtk UI is not available, try to find external UI if (!_ui) { @@ -236,6 +257,7 @@ LV2Plugin::~LV2Plugin () slv2_instance_free(_instance); slv2_value_free(_name); slv2_value_free(_author); + slv2_value_free(_ui_type); delete [] _control_data; delete [] _shadow_data; diff --git a/libs/ardour/wscript b/libs/ardour/wscript index f95b22d572..10aae55915 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -244,6 +244,7 @@ def configure(conf): autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0') autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False) autowaf.check_pkg(conf, 'slv2', uselib_store='NEW_SLV2', atleast_version='0.7.0', mandatory=False) + autowaf.check_pkg(conf, 'suil', uselib_store='SUIL', atleast_version='0.1.0', mandatory=False) autowaf.check_pkg(conf, 'rasqal', uselib_store='RASQAL', atleast_version='0.9.14', mandatory=False) autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False) autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False) @@ -330,6 +331,8 @@ def build(bld): if bld.env['HAVE_SLV2']: obj.source += [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc', 'rdff.c' ] obj.uselib += ' SLV2 ' + ' RASQAL ' + if bld.env['HAVE_SUIL']: + obj.uselib += ' SUIL ' if bld.env['VST_SUPPORT']: obj.source += [ 'vst_plugin.cc', 'session_vst.cc' ] |