[LV2] Widget-less UI not working

Stefan Riha hoitaus at gmail.com
Fri Jun 3 19:16:50 PDT 2016


Yes, that helped, it works much better now. I tried your "customui.lv2" and
it works flawlessly.

I structured the *ttl's of my project like yours, and using kx in Ardour
works. But I still get an error with jalv (with -s). It always wants to use
the kx:Widget, even though kx is listed as a required feature. Maybe a
typo, I'll figure it out next week.

The ttl's I use are:

https://github.com/poidl/yassy/blob/master/yassy.lv2/manifest.ttl
https://github.com/poidl/yassy/blob/master/yassy.lv2/yassy.ttl
https://github.com/poidl/yassyui/blob/master/yassyui.lv2/yassyui.ttl

I used to have the ui in a separate bundle (that's why the projects are
different), but I install the

libyassy.so
libyassyui.so
manifest.ttl
yassy.ttl
yassyui.ttl

files now all to the same .lv2/yassy.lv2 have the exact same *ttl structure
as customui.lv2.

On Sat, May 28, 2016 at 7:26 PM, Stefan Riha <hoitaus at gmail.com> wrote:

> Thanks, that's a lot of valuable information. Much appreciated.
>
> Yes makes sense, the x11 quirk is not good.
>
> Can't wait to try it next week.
> On May 28, 2016 19:10, "Hanspeter Portner" <ventosus at airpost.net> wrote:
>
>> On 28.05.2016 01:27, Stefan Riha wrote:
>> > I had time now to try it. I'm not sure if I understood this correctly,
>> but ui:idleInterface and ui:showInterface don't
>> > seem to solve my problem. Jalv and Ardour don't even call
>> extension_data(). They break before that, due to the invalid
>> > widget pointer they get from calling instantiate().
>>
>> Ah, I forgot to tell that not all hosts support ui:showInterface, yet.
>> e.g. Ardour does not.
>> And jalv needs to be called with a special (undocumented) flag (-s), to
>> run in the proper state.
>>
>> Although ui:showInterface is the 'official' extension to do custom UIs,
>> some hosts only support its deprecated
>> predecessor extension 'external-ui' [1].
>>
>> 'external-ui' and ui:showInterface/ui:idleInterface are pretty similar
>> and you can actually wrap one into the
>> other to support both within the same code [2].
>>
>> [1] http://kxstudio.linuxaudio.org/ns/lv2ext/external-ui
>> [2] https://github.com/ventosus/customui.lv2
>>
>> Have a look at [2], it should get you going, it runs fine in jalv(1.4.6),
>> Ardour(4.7), Qtractor (0.7.5)
>>
>> Run your host from the console to see whether it works for you (the UI
>> prints some debug strings to stdout)
>>
>> e.g.
>> $ jalv -s http://open-music-kontrollers.ch/lv2/customui#test
>>
>> > However, I noticed that if I declare the widget-less UI as a ui:X11UI
>> in the .ttl, then it works! Jalv, Ardour and
>> > Qtractor open an empty window, call extension_data() with
>> ui:idleInterface. I actually think that's all I need. Probably
>> > has something to do with the pointer type for X11 windows (see
>> http://lv2plug.in/ns/extensions/ui/#X11UI )
>>
>> No, that's not what you need. ui:idleInterface can be used apart from
>> ui:showInterface. It's readily used with
>> ui:X11UI to drive animations, screen updates, etc. as X11 has no main
>> loop as e.g. Gtk and Qt.
>>
>> If your plugin does not create an XWindow, don't declare it as ui:X11UI,
>> if your plugin does not create a GtkWidget,
>> don't declare it as ui:GtkUI, ...
>>
>> You're just being lucky here. Hosts expect an ui:X11UI to return an
>> XWindow ID. The latter is just a plain Integer.
>> Whathever you return as a widget XWindow ID (or whathever resided in
>> memory at that time) may just happen to
>> already exist in your Xwindow environment. Some hosts may not even check
>> the retured value for validity, either.
>>
>> > On Sat, May 21, 2016 at 5:08 PM, Hanspeter Portner <
>> ventosus at airpost.net <mailto:ventosus at airpost.net>> wrote:
>> >
>> >     On 21.05.2016 06:23, Stefan Riha wrote:
>> >     > Hi, I'm a beginner and experimenting with lv2.
>> >
>> >     Great
>> >
>> >     > I wrote a simply synth and want a UI without Widget. On the lv2
>> page it says
>> >     >
>> >     >  "There is no requirement that a UI actually be a graphical
>> widget."
>> >     >  (from: http://lv2plug.in/ns/extensions/ui/ ).
>> >
>> >     True, an UI can theoretically be anything.
>> >
>> >     Can you give some more information on what you want to accomplish?
>> You may well not need an UI in the first place (but
>> >     don't know yet, as you are a beginner).
>> >
>> >     > Below that, there is a list of subclasses of UI, but all are for
>> widgets. So I thought I'd try ui:UI directly instead of
>> >     > ui:GtkUI etc. But neither jalv nor Ardour recognises that there
>> is a UI.
>> >
>> >     ui:UI is the parent class which the Widget UIs (ui:GtkUI,
>> ui:Gtk3UI, ui:QtUI, ...) derive from. It is en empty shell
>> >     really, hosts cannot possibly know what is inside, you have to give
>> the host some more information.
>> >
>> >     > So I used ui:GtkUI instead. In jalv, this yields error messages
>> of type Gtk-CRITICAL. Obviously it's because there is no
>> >     > actual widget. In Ardour, I can see that the UI is instantiated()
>> and immediately cleanedup(), probably because the Gtk
>> >     > errors are handled that way.
>> >
>> >     If you define the UI as an ui:GtkUI, but do not return a valid
>> GtkWidget to the host, sure this raises an error.
>> >
>> >     > How do you do this?
>> >     >
>> >     > I looked for hours for some example code but couldn't find one. I
>> stumbled across Ingen which has some form of
>> >     > web-interface (if I understood correctly) and tried to read the
>> .ttl files, but don't understand them.
>> >
>> >     You may be looking for ui:showInterface [1] and ui:idleInterface
>> [2], with those you can build arbitrary
>> >     UIs.
>> >
>> >     Here [3] you can find a dummy plugin I use for testing various UIs
>> in my humble host.
>> >     <test_show.c> implements an as-simple-as-it-gets no-widget UI.
>> >
>> >     [1] http://lv2plug.in/ns/extensions/ui/#showInterface
>> >     [2] http://lv2plug.in/ns/extensions/ui/#idleInterface
>> >     [3] https://github.com/ventosus/alluis.lv2
>> >
>> >     > Thanks a lot for your help,
>> >     > Stefan
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lv2plug.in/pipermail/devel-lv2plug.in/attachments/20160604/5c3a4114/attachment.htm>


More information about the Devel mailing list