[LAD] How to develop guis for LV2?

David Robillard dave at drobilla.net
Thu Nov 5 23:33:42 UTC 2009

On Thu, 2009-11-05 at 22:21 +0100, fons at kokkinizita.net wrote:
> On the LV2 website, Lars Luthman's UI extension is described as: 
> "This extension is written for revision 2 of the LV2 specification
> and is NOT compatible with revisions 3 and later. Do not implement
> this extension in new plugins or hosts, and do not expect it to work
> in old ones. It is only available here for archaeological purposes." 

For anyone genuinely interested and not just taking vain pot shots to
further some weird personal vendetta or whatever the hell:

The thing that changed in r3 is: persistent references to ports must
refer to ports by their symbol, and not their index.  Persistent means
things on disk that might refer to several versions of a plugin in the
future, nothing about the index has actually changed.  Plugin data
files, host session files, etc.

The reasoning for this is for things like dynamic plugins or plugin
wrappers, a numeric namespace doesn't work.  For example:

Plugin A has 4 ports
Plugin B has 2 ports

Plugin C is a wrapper that loads both plugin A and plugin B and exposes
their ports.  Number the B ports starting at 4, fine.

What if a new version of plugin A comes out that has 5 ports?  Uh-oh.
The indices of Plugin C have been broken.  Indices are not a
good /persistent/ identifier for this reason (they are fine at run-time
or more generally when the plugin versions are fixed).

Nobody thought of this so the clarification was not in the original
spec.  Though the intention was for indices to be just a runtime
optimization all along, it was never explicitly stated that using
indices for persistent stuff is a bad idea.  Now it is.

Unfortunately the GUI extension does refer to ports by index, so it
needs to be updated, hence the above warning.  This is just a future
proof thing that came up, and in practice nothing is broken and it all
works exactly as it did before.


More information about the Linux-audio-dev mailing list