====== openGL UIs for LV2 plugins ======
~~SLIDESHOW~~
Robin Gareus
\\
linuxaudio.org, CiTu.fr
\\
Linux Audio Conference 2013, Graz
===== Definitions =====
**LV2** (LADSPA version 2) is an **open standard** for plugins (and hosts), targeted at audio processing.
**openGL** is a **cross-language**, multi-platform API for rendering 2D and 3D computer graphics.
===== Why LV2 GUIs =====
* No custom UI is the preferred method
* Host generated UI (common look&feel, UI guidelines,..)
===== Why LV2 GUIs =====
* No custom UI is the preferred method
* Host generated UI (common look&feel, UI guidelines,..)
but..
===== Why LV2 GUIs =====
* No custom UI is the preferred method
* Host generated UI (common look&feel, UI guidelines,..)
but
* //Specialized// plugins
* Important visual feedback
* Huge number of controls
* Dependencies between controls
* Custom widgets e.g. 3D panning
===== Why LV2 GUIs =====
* No custom UI is the preferred method
* Host generated UI (common look&feel, UI guidelines,..)
but
* //Specialized// plugins
* Important visual feedback
* Huge number of controls
* Dependencies between controls
* Custom widgets e.g. 3D panning
* //Corporate// look&feel (VST anyone?!)
===== LV2 GUIs =====
* openGL
===== LV2 GUIs =====
* 3D FPS..
===== LV2 GUIs =====
* 3D FPS..
* Audio Effects!
===== LV2 GUIs =====
* 3D FPS..
* Audio Effects!
* WTF?!? :)
===== The toolkit + ABI issue 1 =====
{{ :wiki:wiki:lv2gl:pluginhost01.png?440}}
* Simple setup - plugin inside host
~~CLEARFLOAT~~
===== The toolkit + ABI issue 2 =====
{{ :wiki:wiki:lv2gl:pluginhost02.png?440}}
* Simple setup - plugin inside host
~~CLEARFLOAT~~
===== The toolkit + ABI issue 3 =====
{{ :wiki:wiki:lv2gl:pluginhost03.png?440}}
* Simple setup - plugin inside host
~~CLEARFLOAT~~
===== The toolkit + ABI issue 4 =====
{{ :wiki:wiki:lv2gl:pluginhost04.png?440}}
* Plugin and host use the same toolkit.
* Toolkit is a shared lib
* Identical version of library
~~CLEARFLOAT~~
===== The toolkit + ABI issue 5 =====
{{ :wiki:wiki:lv2gl:pluginhost05.png?440}}
* Plugin and host use the same toolkit.
* ..but plugin & host were built with different versions
* ABI (Application Binary Interface) does not match
* -> conflicts of symbols
* -> segfault..
~~CLEARFLOAT~~
===== The toolkit + ABI issue =====
Possible solutions to the API + ABI conflict:
* Compile plugin and host with same version of the library
===== The toolkit + ABI issue =====
Possible solutions to the API + ABI conflict:
* Compile plugin and host with same version of the library
* Run plugin as separate process
===== The toolkit + ABI issue =====
Possible solutions to the API + ABI conflict:
* Compile plugin and host with same version of the library
* Run plugin as separate process
* Use only libraries which are API and ABI compatible across versions
===== GUI Toolkits =====
* gdk/gtk (non relocatable, problematic on win, hard on OSX)
* Qt (huge framework, many edge-cases)
* libx11/xcb (no windows, not on OSX by default)
* libclxclient (no windows, not on OSX by default)
* FLTK (different back-ends depending on OS,..)
* openGL
===== GUI Toolkits =====
* gdk/gtk (non relocatable, problematic on win, hard on OSX)
* Qt (huge framework, many edge-cases)
* libx11/xcb (no windows, not on OSX by default)
* libclxclient (no windows, not on OSX by default)
* FLTK (different back-ends depending on OS,..)
* openGL
===== GUI Toolkits =====
* gdk/gtk (non relocatable, problematic on win, hard on OSX)
* Qt (huge framework, many edge-cases)
* libx11/xcb (no windows, not on OSX by default)
* libclxclient (no windows, not on OSX by default)
* FLTK (different back-ends depending on OS,..)
* openGL
===== GUI Toolkits =====
* gdk/gtk (non relocatable, problematic on win, hard on OSX)
* Qt (huge framework, many edge-cases)
* libx11/xcb (no windows, not on OSX by default)
* libclxclient (no windows, not on OSX by default)
* FLTK (different back-ends depending on OS,..)
* openGL
===== GUI Toolkits =====
* gdk/gtk (non relocatable, problematic on win, hard on OSX)
* Qt (huge framework, many edge-cases)
* libx11/xcb (no windows, not on OSX by default)
* libclxclient (no windows, not on OSX by default)
* FLTK (different back-ends depending on OS,..)
* openGL
===== GUI Toolkits =====
* gdk/gtk (non relocatable, problematic on win, hard on OSX)
* Qt (huge framework, many edge-cases)
* libx11/xcb (no windows, not on OSX by default)
* libclxclient (no windows, not on OSX by default)
* FLTK (different back-ends depending on OS,..)
* openGL
===== GUI Toolkits =====
* gdk/gtk (non relocatable, problematic on win, hard on OSX)
* Qt (huge framework, many edge-cases)
* libx11/xcb (no windows, not on OSX by default)
* libclxclient (no windows, not on OSX by default)
* FLTK (different back-ends depending on OS,..)
* openGL
There are no dedicated audio related widgets in either toolkit by default
(with exception of libclxclient and some qt stuff*).
===== Pro/Cons of openGL =====
Problems:
* No widgets at all.
===== Pro/Cons of openGL =====
Problems:
* No widgets at all.
* No default fonts.
===== Pro/Cons of openGL =====
Problems:
* No widgets at all.
* No default fonts.
* No Desktop integration.
===== Pro/Cons of openGL =====
Advantages:
* Cross-platform
===== Pro/Cons of openGL =====
Advantages:
* Cross-platform
* Minimal (no) library dependencies, API & ABI backwards compatible to ~1999.
===== Pro/Cons of openGL =====
Advantages:
* Cross-platform
* Minimal (no) library dependencies, API & ABI backwards compatible to ~1999.
* Hardware accelerated.
===== Pro/Cons of openGL =====
Advantages:
* Cross-platform
* Minimal (no) library dependencies, API & ABI backwards compatible to ~1999.
* Hardware accelerated.
* 3D (!)
===== Pro/Cons of openGL =====
Advantages:
* Cross-platform
* Minimal (no) library dependencies, API & ABI backwards compatible to ~1999.
* Hardware accelerated.
* 3D (!)
* UIs can be designed in e.g. blender.
===== State of the Art =====
* August 2012: first LV2 + GL example plugin
* March 2013: two //real// LV2 openGL plugins:
* setBfree -- b_synth.lv2
* balance.lv2
* Spring 2013: widget model from blender & implementation in C
* Dial aka rotary knob
* Switch / Toggle Button
* Radio Button / Push Button
* Level Meter
* Organ Drawbars
* May 2013: started to break out openGL lv2 lib.
* Last night: updates to libsuil to directly support openGL cross platform.
===== Examples =====
Some screenshots first..
\\
..audio examples right after.
===== setBfree Blender Model =====
{{ :wiki:wiki:lv2gl:screenshot-12.png?800 |}}
===== setBfree main UI =====
{{ :wiki:wiki:lv2gl:screenshot-14.png?800 |}}
===== setBfree main UI - rotated =====
{{ :wiki:wiki:lv2gl:sb3_gui_rotate.png?800 |}}
===== setBfree Program List =====
{{ :wiki:wiki:lv2gl:screenshot-15.png?800 |}}
===== setBfree - Text Entry =====
{{ :wiki:wiki:lv2gl:screenshot-16.png?800 |}}
===== setBfree - File Chooser =====
{{ :wiki:wiki:lv2gl:screenshot-17.png?800 |}}
===== balance.lv2 =====
{{ :wiki:wiki:lv2gl:screenshot-20.png?248 |}}
===== balance.lv2 - side-view =====
{{ :wiki:wiki:lv2gl:screenshot-18.png?800 |}}
===== Q&A =====
Thanks for your attention.
\\
Questions?!
\\
(while I prepare/launch the demo)