truce-gui
Built-in GUI runtime for truce plugins.
Overview
Provides a complete widget toolkit that draws knobs, sliders, meters,
dropdowns, and XY pads straight from your parameter layout — no custom
editor code, no pixel math. The BuiltinEditor auto-generates a full UI
from a GridLayout. By default it rasterises on the CPU with tiny-skia;
opt into GPU rendering (wgpu) with the gpu feature.
Windowing is handled through baseview. In CPU mode the tiny-skia pixmap
is uploaded to a wgpu surface each frame for compositing; in GPU mode
GpuEditor renders the widgets directly through wgpu. All supported
formats (CLAP, VST3, VST2, AU, LV2, AAX, standalone) use the same path.
truce-gui orchestrates the two RenderBackend implementations into
editor types. The renderers themselves live in sibling crates, so a
plugin only compiles the one it uses:
- the CPU rasteriser (
CpuBackend, tiny-skia + fontdue) lives intruce-cpu, pulled in by the defaultcpufeature; - the GPU backend (
WgpuBackend, wgpu) lives intruce-gpu, pulled in by thegpufeature.
The lightweight trait + data surface (GridLayout, RenderBackend,
WidgetType, Theme, …) lives in
truce-gui-types so alt-GUI backends
(truce-egui / truce-iced / truce-slint) and plugin authors using a
custom editor don't transitively pull in the rasterisation + windowing
stack.
Key types
BuiltinEditor-- the mainEditorimplementation; auto-generates UI from paramsGpuEditor(with thegpufeature) -- wrapsBuiltinEditorto render throughtruce_gpu::WgpuBackenddefault_editor()/IntoLayoutEditor-- turn aGridLayoutinto aBox<dyn Editor>, picking the renderer the active feature selectsCpuBackend(re-exported fromtruce-cpuwith thecpufeature) -- the tiny-skia software rasterizer (theRenderBackendtrait it implements lives intruce-gui-types)BaseviewTranslator-- mapsbaseview::Events into theInputEventstream consumed bytruce_gui_types::interaction::dispatch- Re-exports of every
truce-gui-typesandtruce-pluginpublic symbol so existingtruce_gui::layout::*/truce_gui::PluginLogicpaths keep resolving
Widgets
Knobs, sliders, toggles, dropdowns, XY pads, level meters, labels, and
parameter groups. All widgets bind directly to truce parameters. The
widget data types + draw helpers live in truce-gui-types::widgets;
this crate orchestrates the renderer the draw helpers paint into.
Usage