[LV2] inline plugin displays

Jörn Nettingsmeier nettings at stackingdwarves.net
Tue Mar 15 12:02:10 PDT 2016


On 03/15/2016 03:47 AM, Robin Gareus wrote:
> Hi all,
>
> Here's another small ad-hoc LV2 extension. I've just prototyped adding
> inline mixer-strip displays. A picture says more than words here:
>
>    http://robin.linuxaudio.org/tmp/inline_display.png
>
> small LV2 UIs; display only (non interactive) pixmaps.
>
> The API consists of two calls:
>
> 1) A LV2 extension provided by the plugin to render a pixmap.
>
> This is function is provided by the plugin's shared-object itself (not
> the GUI) because it must also be available when the plugin GUI is not
> visible (not even loaded). It's intended for visualizing the most
> relevant plugin parameters in a tiny area (~100x100px).
>
>
> /** raw image pixmap format is ARGB32,
>   * the data pointer is owned by the plugin and must be valid
>   * from the first call to render until cleanup.
>   */
> typedef struct {
>    unsigned char *data;
>    int width;
>    int height;
>    int stride;
> } LV2_Inline_Display_Image_Surface;
>
> /**
>   * Plugin Inline-Display Interface.
>   */
> typedef struct {
>    /**
>     * The render method. This is called by the host in a non-realtime
>     * context, usually the main GUI thread.
>     * The data pointer is owned by the plugin and must be valid
>     * from the first call to render until cleanup.
>     *
>     * @param instance The LV2 instance
>     * @param w the max available width
>     * @param h the max available height
>     * @return pointer to a LV2_Inline_Display_Image_Surface or NULL
>     */
>    LV2_Inline_Display_Image_Surface* (*render)
>                       (LV2_Handle instance, uint32_t w, uint32_t h);
> } LV2_Inline_Display_Interface;
>
>
>
> 2) A LV2 feature provided by the host. This allows a plugin to tell the
> host that the image needs to be updated. It is intended to be called by
> the plugin in rt-context - during run(), when the ports are valid.
>
>
> /** a LV2 Feature provided by the Host to the plugin */
> typedef struct {
>
>    /** Opaque host data */
>    LV2_Inline_Display_Handle handle;
>
>    /** Request from run() that the host should call render()
>     * at a later time to update the inline display.
>     */
>    void (*queue_draw)(LV2_Inline_Display_Handle handle);
> } LV2_Inline_Display;
>
>
>
> So far I've implemented this as proof of concept in Ardour, fil4.lv2 and
> meters.lv2 (all git/master).
>
> thoughts, comments are welcome,

User speaking here: sweeeeeeeet!

I really like the simplification of making this stuff read-only and not 
bother with editable controls at this point. Can't wait for the first 
compressor plugin to adopt this feature - seeing the current gain 
reduction at a glance is pretty much a must-have these days.



-- 
Jörn Nettingsmeier
Lortzingstr. 11, 45128 Essen, Tel. +49 177 7937487

Meister für Veranstaltungstechnik (Bühne/Studio)
Tonmeister VDT

http://stackingdwarves.net



More information about the Devel mailing list