Signal wish to show inline display in gui by lv2:optionalFeature
authorJohannes Mueller <github@johannes-mueller.org>
Sun, 23 Jul 2017 19:10:07 +0000 (21:10 +0200)
committerRobin Gareus <robin@gareus.org>
Mon, 31 Jul 2017 19:31:23 +0000 (21:31 +0200)
... in .ttl file rather than by extension_data() in code. That's more in the
spirit of LV2.

libs/ardour/ardour/lv2_plugin.h
libs/ardour/lv2_plugin.cc
libs/plugins/a-comp.lv2/a-comp#stereo.ttl.in
libs/plugins/a-comp.lv2/a-comp.c
libs/plugins/a-comp.lv2/a-comp.ttl.in
libs/plugins/a-eq.lv2/a-eq.ttl.in

index 9eb80d187ef7e0c74aa4a798debfeb609fa15557..b17de51928487916f13aa05b6f46b56100063981 100644 (file)
@@ -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
 
index 2b6e8021725b6369135da373e468aa5d4261970d..9456ba3d0c6c18186d885326bf21cb133d7885a1 100644 (file)
@@ -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);
index 8511d59618cb8da9e7896e37941a9f1af0b798ca..efc5b7b54e6f42e54258a55d157d2ecc61e65783 100644 (file)
@@ -14,7 +14,8 @@
     a lv2:Plugin, doap:Project, lv2:CompressorPlugin ;
 
     lv2:optionalFeature <http://lv2plug.in/ns/lv2core#hardRTCapable> ;
-               lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#queue_draw> ;
+    lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#queue_draw> ;
+    lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#in_gui> ;
 
     lv2:port [
         a lv2:InputPort, lv2:ControlPort ;
index 35598c3d51b4e2adbdc8a442ee7c8c35165c2d06..e14f4ee004d9333e353a970761cacf03ad8af69b 100644 (file)
@@ -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;
 }
index e11066a94f17f23fee808074ee5dba7e063a02c9..2ada2fda4f94b2f5e5496280fcf2327c4362da49 100644 (file)
@@ -14,7 +14,8 @@
     a lv2:Plugin, doap:Project, lv2:CompressorPlugin ;
 
     lv2:optionalFeature <http://lv2plug.in/ns/lv2core#hardRTCapable> ;
-               lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#queue_draw> ;
+    lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#queue_draw> ;
+    lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#in_gui> ;
 
     lv2:port [
         a lv2:InputPort, lv2:ControlPort ;
index 21e77bebd0f5e7b70dd6a210147faec425ef7fc9..bfdd45e2cedaf3c25ca2a0a8cf296cdf8fe3fa09 100644 (file)
@@ -32,7 +32,8 @@ unit:db1
     a lv2:Plugin, doap:Project, lv2:FilterPlugin ;
 
     lv2:optionalFeature <http://lv2plug.in/ns/lv2core#hardRTCapable> ;
-               lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#queue_draw> ;
+    lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#queue_draw> ;
+    lv2:optionalFeature <http://harrisonconsoles.com/lv2/inlinedisplay#in_gui> ;
 
     lv2:requiredFeature <http://lv2plug.in/ns/ext/options#options> ,
                         <http://lv2plug.in/ns/ext/urid#map> ;