From 6663a267556faebc350dc7e5771989c97a1b1884 Mon Sep 17 00:00:00 2001 From: Johannes Mueller Date: Sun, 23 Jul 2017 21:10:07 +0200 Subject: Signal wish to show inline display in gui by lv2:optionalFeature ... in .ttl file rather than by extension_data() in code. That's more in the spirit of LV2. --- libs/ardour/ardour/lv2_plugin.h | 2 +- libs/ardour/lv2_plugin.cc | 10 +++++++--- libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in | 3 ++- libs/plugins/a-comp.lv2/a-comp.c | 3 --- libs/plugins/a-comp.lv2/a-comp.ttl.in | 3 ++- libs/plugins/a-eq.lv2/a-eq.ttl.in | 3 ++- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h index 9eb80d187e..b17de51928 100644 --- a/libs/ardour/ardour/lv2_plugin.h +++ b/libs/ardour/ardour/lv2_plugin.h @@ -278,7 +278,7 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee #ifdef LV2_EXTENDED const LV2_Inline_Display_Interface* _display_interface; - bool _show_display_in_generic_gui; + bool _inline_display_in_gui; const LV2_Midnam_Interface* _midname_interface; #endif diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 2b6e802172..9456ba3d0c 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -190,6 +190,7 @@ public: LilvNode* auto_automation_control; // atom:supports LilvNode* auto_automation_controlled; // lv2:portProperty LilvNode* auto_automation_controller; // lv2:portProperty + LilvNode* inline_display_in_gui; // lv2:optionalFeature #endif private: @@ -390,6 +391,7 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate) _was_activated = false; _has_state_interface = false; _can_write_automation = false; + _inline_display_in_gui = false; _max_latency = 0; _current_latency = 0; _impl->block_length = _session.get_block_size(); @@ -547,8 +549,6 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate) _display_interface = (const LV2_Inline_Display_Interface*) extension_data (LV2_INLINEDISPLAY__interface); - _show_display_in_generic_gui = (bool) extension_data (LV2_INLINEDISPLAY__in_gui); - _midname_interface = (const LV2_Midnam_Interface*) extension_data (LV2_MIDNAM__interface); if (_midname_interface) { @@ -595,6 +595,9 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate) if (lilv_nodes_contains (optional_features, _world.auto_can_write_automatation)) { _can_write_automation = true; } + if (lilv_nodes_contains (optional_features, _world.inline_display_in_gui)) { + _inline_display_in_gui = true; + } lilv_nodes_free(optional_features); #endif @@ -966,7 +969,7 @@ LV2Plugin::has_inline_display () { bool LV2Plugin::inline_display_in_gui () { - return _show_display_in_generic_gui; + return _inline_display_in_gui; } Plugin::Display_Image_Surface* @@ -3163,6 +3166,7 @@ LV2World::LV2World() auto_automation_control = lilv_new_uri(world, LV2_AUTOMATE_URI__control); auto_automation_controlled = lilv_new_uri(world, LV2_AUTOMATE_URI__controlled); auto_automation_controller = lilv_new_uri(world, LV2_AUTOMATE_URI__controller); + inline_display_in_gui = lilv_new_uri(world, LV2_INLINEDISPLAY__in_gui); #endif #ifdef HAVE_LV2_1_2_0 bufz_powerOf2BlockLength = lilv_new_uri(world, LV2_BUF_SIZE__powerOf2BlockLength); diff --git a/libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in b/libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in index 8511d59618..efc5b7b54e 100644 --- a/libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in +++ b/libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in @@ -14,7 +14,8 @@ a lv2:Plugin, doap:Project, lv2:CompressorPlugin ; lv2:optionalFeature ; - lv2:optionalFeature ; + lv2:optionalFeature ; + lv2:optionalFeature ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; diff --git a/libs/plugins/a-comp.lv2/a-comp.c b/libs/plugins/a-comp.lv2/a-comp.c index 35598c3d51..e14f4ee004 100644 --- a/libs/plugins/a-comp.lv2/a-comp.c +++ b/libs/plugins/a-comp.lv2/a-comp.c @@ -876,9 +876,6 @@ extension_data(const char* uri) if (!strcmp(uri, LV2_INLINEDISPLAY__interface)) { return &display; } - if (!strcmp(uri, LV2_INLINEDISPLAY__in_gui)) { - return &display; - } #endif return NULL; } diff --git a/libs/plugins/a-comp.lv2/a-comp.ttl.in b/libs/plugins/a-comp.lv2/a-comp.ttl.in index e11066a94f..2ada2fda4f 100644 --- a/libs/plugins/a-comp.lv2/a-comp.ttl.in +++ b/libs/plugins/a-comp.lv2/a-comp.ttl.in @@ -14,7 +14,8 @@ a lv2:Plugin, doap:Project, lv2:CompressorPlugin ; lv2:optionalFeature ; - lv2:optionalFeature ; + lv2:optionalFeature ; + lv2:optionalFeature ; lv2:port [ a lv2:InputPort, lv2:ControlPort ; diff --git a/libs/plugins/a-eq.lv2/a-eq.ttl.in b/libs/plugins/a-eq.lv2/a-eq.ttl.in index 21e77bebd0..bfdd45e2ce 100644 --- a/libs/plugins/a-eq.lv2/a-eq.ttl.in +++ b/libs/plugins/a-eq.lv2/a-eq.ttl.in @@ -32,7 +32,8 @@ unit:db1 a lv2:Plugin, doap:Project, lv2:FilterPlugin ; lv2:optionalFeature ; - lv2:optionalFeature ; + lv2:optionalFeature ; + lv2:optionalFeature ; lv2:requiredFeature , ; -- cgit v1.2.3