Portable OpenGL Plugin UIs

LV2 allows plugins to implement UIs in any toolkit. This has led to UIs being implemented in several (which is a Good Thing, and works fine in all hosts via Suil), but mostly Gtk.

Unfortunately, Gtk is not really suitable for use in plugins on platforms where a “system Gtk” can’t be relied on. Some toolkits are suitable for static linking, but personally, I am somewhat disillusioned with “toolkits” lately, and massive libraries in general. Sometimes all you want or need is a straightforward standard graphics API and some keyboard/mouse events.

When it comes to standard cross-platform graphics APIs, the undisputed heavyweight king is OpenGL. While not perfect (what is?), no other API is already there on almost any platform you’d care about (heck, most modern phones have hardware accelerated OpenGL). Unfortunately, OpenGL deals only with rendering, and not user input or windowing issues. What is needed is a minimal framework to get an OpenGL view to draw to, and receive keyboard and mouse events. Enter Jalv.

Jalv handles all the platform specific business behind an API very similar to GLUT, but much smaller and appropriate for plugins (which GLUT unfortunately is not). In terms of size, this is a few hundred lines of C per platform (on a personal note, this fits in well with my ever-increasing distaste in dealing with bloated junk with tons of dependencies… give me a Couple Hundred Lines of C™ any day). The breakdown on Jalv is on its homepage, but suffice to say after a few days’ work it does the job it was designed to do on X11, Mac OS X, and Windows. Since embedding X11 works in LV2 land, that means an OpenGL plugin UI can be embedded in the host, and I have the pretty pictures to prove it:

Pugl embedded in Ardour

Pugl embedded in Ingen

This is a simple test plugin (complete with gratuitous use of 3D) embedded in Ingen and Ardour. Both are Gtk based programs, but this works in Qt as well. Testing so far on other platforms has only been top-level since I have no programs to embed in, but the bulk of the work is done. This includes full keyboard and mouse support, with significantly more complete keyboard support than GLUT.

Naturally I can’t predict the future, so it remains to be seen how much OpenGL UI action we’ll see for plugins. Being just a low level drawing API and not a set of boxed widgets, it’s a bit open ended with a bit of a learning curve, but on the other hand there is lots of existing OpenGL code out there. Perhaps someone will throw together a library of audio appropriate widgets, if one doesn’t already exist. Either way, I think an easy to use API for writing truly portable LV2 plugin UIs is a very good thing, which hopefully eliminates a barrier for some plugin developers and helps LV2 invade the territory of its proprietary adversaries… or, at the very least, makes for a really cool 3D panner GUI :)

flattr this!

Jalv 1.0.0

Jalv 1.0.0 is out. Jalv is a simple but fully featured LV2 host for Jack. It runs LV2 plugins and exposes their ports as Jack ports, essentially making any LV2 plugin function as a Jack application. Jalv is particularly useful for testing during plugin development, and as an example of a Lilv-based LV2 host.

This is the initial release of Jalv. It is still a relatively immature program, but supports most of the important new functionality in the LV2 1.0.0 release (e.g. saving plugin presets with state, atom-based event ports, message-based plugin<=>UI communication, etc.).

flattr this!

Lilv 0.14.0

Lilv 0.14.0 is out. Lilv is a library to make the use of LV2 plugins as simple as possible for applications.

This release includes many improvements, most notably built-in support for saving/restoring plugin state (including powerful non-destructive saving of plugin state which contains files), as well as many bug and portability fixes.

Changes:

  • Add lilv_plugin_get_extension_data
  • Use path variables in pkgconfig files
  • Install man page to DATADIR (e.g. PREFIX/share/man, not PREFIX/man)
  • Make Lilv::uri_to_path static inline (fix linking errors)
  • Use correct URI for dcterms:replaces (for hiding old plugins): “http://purl.org/dc/terms/replaces”
  • Fix compilation on BSD
  • Only load dynmanifest libraries once per bundle, not once per plugin
  • Fix lilv_world_find_nodes to work with wildcard subjects
  • Add lilv_plugin_get_related to get resources related to plugins that are not directly rdfs:seeAlso linked (e.g. presets)
  • Add lilv_world_load_resource for related resources (e.g. presets)
  • Print presets in lv2info
  • Remove locale smashing kludges and use new serd functions for converting nodes to/from numbers.
  • Add LilvState API for handling plugin state. This makes it simple to save and restore plugin state both in memory and on disk, as well as save presets in a host-sharable way since the disk format is identical to the LV2 presets format.
  • Update old references to lv2_list (now lv2ls)
  • Support compilation as C++ under MSVC++.
  • Remove use of wordexp.
  • Add lilv_plugin_get_port_by_designation() and lilv_port_get_index() as an improved generic alternative to lilv_plugin_get_latency_port_index().
  • Add lilv_plugin_get_project() and get author information from project if it is not given directly on the plugin.

flattr this!

Suil 0.6.0

Suil 0.6.0 is out. Suil is a lightweight C library for loading and wrapping LV2 plugin UIs. Suil transparently presents UIs written in any toolkit as the desired widget type of host programs, so hosts do not have to depend on foreign toolkits.

The biggest change with this release is support for wrapping X11 UIs, which can be used to implement a UI in just about any toolkit or graphics API on X11 based systems.

Changes:

  • Use path variables in pkgconfig files
  • Add support for embedding X11 UIs (ui:X11UI)
  • Support new LV2 UI features automatically if provided by host

flattr this!

Sratom 0.2.0

Sratom is a new C library for serialising LV2 atoms to/from Turtle. It is intended to be a full serialisation solution for LV2 atoms, allowing implementations to serialise binary atoms to strings and read them back again. This is particularly useful for saving plugin state, or implementing plugin control with network transparency. Sratom uses Serd and Sord to do the work, it is a small library implemented in a single source file, suitable for direct inclusion in projects if avoiding a dependency is desired.

Download Sratom 0.2.0

flattr this!

Sord 0.8.0

Sord 0.8.0 is out. Sord is a lightweight C library for storing RDF statements in memory.

This release fixes some minor bugs, adds some convenient API (though the API is compatible with all previous releases), and adds a sord_validate tool which can be used to validate RDF data against RDFS/OWL schemas.

Changes:

  • Use path variables in pkgconfig files
  • Install man page to DATADIR (e.g. PREFIX/share/man, not PREFIX/man)
  • Tolerate serd passing NULL nodes to reader callback (serd 0.6.0)
  • Fix comparison of typed literals
  • Take advantage of interning in sord_node_equals()
  • Support compilation as C++ under MSVC++.
  • Add sord_iter_get_node()
  • Refuse to intern relative URIs in sord_new_uri*()
  • Add sord_new_relative_uri()
  • Add SordInserter for writing to a model via Serd sink functions.
  • Add convenient sord_search(), sord_ask(), and sord_count()
  • Add sord_validate tool for validating data against RDF/OWL schemas

flattr this!

Serd 0.14.0

Serd 0.14.0 is out. Serd is a lightweight C library for RDF syntax which supports reading and writing Turtle and NTriples.

This release contains added functionality, several bug fixes, and improved performance. The API remains backwards compatible with all previous releases.

Changes:

  • Use path variables in pkgconfig files
  • Install man page to DATADIR (e.g. PREFIX/share/man, not PREFIX/man)
  • Tolerate invalid characters in string literals by replacing with the Unicode replacement character
  • Report reason for failure to open file in serdi
  • Improve write performance by doing bulk writes for unescaped substrings
  • Add SerdBulkSink for writing bulk output and corresponding serdi -B option
  • Add serdi -f option to prevent URI qualification
  • Remove use of multi-byte peek (readahead) and use exactly 1 page for read buffer (instead of 2)
  • Handle a quote as the last character of a long string literal in the writer (by escaping it) rather than the reader, to avoid writing Turtle other tools fail to parse.
  • Add serd_strtod(), serd_node_new_decimal(), and serd_node_new_integer() for locale-independent numeric node parsing/serialising.
  • Add serd_file_sink for easy writing to a FILE* stream.
  • Add serd_chunk_sink for easy writing to a string.
  • Escape ASCII control characters in output (e.g. fix problems with string literals that start with a backspace)
  • Improve URI resolution to cover most of the abnormal cases from RFC3986
  • Support file://localhost/foo URIs in serd_uri_to_path()
  • Support Windows file://c:/foo URIs in serd_uri_to_path() on all platforms
  • Add serd_node_new_blob and serd_base64_decode for handling arbitrary binary data via base64 encoding.
  • Support compilation as C++ under MSVC++.
  • Implement pretty-printing for collections.
  • Parse collections iteratively in O(1) space.
  • Report read error if both “genid” and “docid” IDs are found in the same document, to prevent silent merging of distinct blank nodes.
  • Handle files and strings that start with a UTF-8 Byte Order Mark.
  • Add serd_writer_get_env().
  • Add serd_node_new_file_uri() and serd_file_uri_parse() and implement proper URI to/from path hex escaping, etc.
  • Add serd_uri_serialise_relative() for making URIs relative to a base where possible (by chopping a common prefix and adding dot segments).
  • Make URIs serialised by the writer properly escape characters.
  • Add serd_writer_set_root_uri() and corresponding -r option to serdi to enable writing URIs with up references (../).
  • Resolve dot segments in serd_uri_resolve() instead of at write time.
  • Add serd_reader_set_default_graph() for reading a file as a named graph.

flattr this!

LV2 1.0.0

The first unified LV2 release, LV2 1.0.0, is out.

This release merges the previous lv2core package with all the official extension packages, as well as example plugins, lv2specgen, and additional data. From a developer point of view, the biggest change is that all LV2 API headers can be used by simply checking for the single pkg-config package “lv2″ (for compatibility the previous “lv2core” package is still installed). Implementations are encouraged to abandon the “copy paste headers” practice and depend on this package instead.

With this release, several new extensions have become stable that together greatly increase the power of LV2: atom, log, parameters, patch, port-groups, port-props, resize-port, state, time, worker.

Documentation and more detailed change logs

Download LV2 1.0.0

flattr this!