Lv2-hmi.h issues on lv2:portProperty lv2:integer, lv2:enumeration


lv2hmi isn’t working appropriately with lv2:portProperty lv2:integer, lv2:enumeration ;. I will show some strange detected cases.

How to reproduce


Create a plugin with the following parameter defined on .ttl:

    a lv2:ControlPort, lv2:InputPort;
    lv2:index 8;
    lv2:symbol "Preset_combobox";
    lv2:name "Curent preset";
    lv2:portProperty lv2:integer, lv2:enumeration ;
        lv2:scalePoint [rdfs:label "Prst 1"; rdf:value 0];
        lv2:scalePoint [rdfs:label "Prst 2"; rdf:value 1];
        lv2:scalePoint [rdfs:label "Prst 3"; rdf:value 2];
        lv2:scalePoint [rdfs:label "Prst 4"; rdf:value 3];
    lv2:default 0;
    lv2:minimum 0;
    lv2:maximum 3;

Assign to B&C.

On source code, assign different colours for each value.

LV2_HMI_LED_Colour led_colours[] = {
    LV2_HMI_LED_Colour_Red, LV2_HMI_LED_Colour_Yellow, LV2_HMI_LED_Colour_Cyan, LV2_HMI_LED_Colour_Magenta,
    LV2_HMI_LED_Colour_Magenta, LV2_HMI_LED_Colour_Yellow, LV2_HMI_LED_Colour_White

LV2_HMI_LED_Colour current_led_colour = led_colours[<PARAMETER VALUE>];
self->hmi->set_led_with_brightness(self->hmi->handle, self->hmi_combobox_addressing, current_led_colour, LV2_HMI_LED_Brightness_Normal);

A led colour was on only on B. Ok. This coudn’t be considered a problem. but press C and see the result. The led on B is turned off. Press C and it go back turned on.


Create a plugin with the following parameter defined on .ttl as described above.
Assign it to B or C (but not both).

Change the label value.

char short_message[10];
sprintf(short_message, "%d", <PARAMETER VALUE>);

self->hmi->set_label(self->hmi->handle, self->hmi_combobox_addressing, short_message);

Noticed that the presented value is a strange concatenation between the defined value and the lv2:scalePoint. There isn’t possible to replace totally the label value with the defined on set_label.

Another strange behavior: if hmi->set_label is never called for a parameter, the label will always shows
the lv2:name (as expected). But if hmi->set_label is called when the parameter is changed AND you changes the parameter value using mod ui parameter settings page
sometimes instead of showing the text defined using hmi->set_label, will shows the lv2:name. When it occurs, if you define a led value, it will be turned off too.

More one strange behavior: if you change the hmi->set_label by a MIDI message assigned for another parameter (that causes update on enumeration with control input port request change extension), the strange concatenation will be partially updated: the first part (that contains what as defined on hmi->set_label) is updated, but the second part (that contains the lv2:scalePoint current value) isn’t updated.

Expected/suggested solution

A fix for this, please :slight_smile:

Additional information

  • release: v1.13.1.3124
  • browser: Firefox