Skip to main content

Crate truce_gui

Crate truce_gui 

Source
Expand description

Built-in GPU-free GUI for truce plugins (heavyweight runtime).

Uses a truce_gui_types::RenderBackend trait to abstract over rendering implementations. The default backend_cpu::CpuBackend uses tiny-skia for software rasterization. The non-runtime data types (layout, widget regions, interaction state, theme, render trait, plugin-logic trait) live in truce-gui-types and truce-plugin; this crate re-exports them so existing truce_gui::... paths keep working.

Re-exports§

pub use editor::BuiltinEditor;
pub use platform::EditorScale;
pub use platform::to_physical_px;

Modules§

backend_cpu
CPU rendering backend using tiny-skia.
blit
Pixel buffer → wgpu surface blit pipeline.
editor
Built-in editor using the CPU render backend.
font
Font rendering using fontdue (TrueType rasterization).
interaction
BaseviewTranslator - the windowing-toolkit-specific half of truce-gui’s interaction surface. The platform-agnostic data types (InputEvent, MouseButton, Modifiers, WidgetRegion, InteractionState, DragState, DropdownState, dispatch, …) live in truce_gui_types::interaction and are re-exported here so existing truce_gui::interaction::* paths keep working.
layout
Simple layout helpers for positioning widgets.
platform
Platform window bridging for baseview.
render
Render backend trait for abstracting over CPU and GPU rendering.
snapshot
Read-only view of parameter state consumed by the pure-library rendering and interaction functions (widgets::draw, interaction::dispatch).
theme
widgets
Audio plugin UI widgets: knobs, sliders, toggles, labels, headers.

Macros§

layout
Declarative layout DSL for plugin GUIs.

Structs§

ImageId
Opaque handle to a backend-registered image.
ParamSnapshot
Immutable view of one frame’s worth of parameter state.
Theme
Visual theme for the built-in GUI.

Traits§

ColorExt
Extension trait giving truce_gui_types::theme::Color the to_skia / to_premultiplied methods that used to live on the inherent impl, now relocated here so truce-gui-types stays rasterizer-free.
PluginLogic
The f32-buffer user-facing plugin trait.
PluginLogic64
The f64-buffer user-facing plugin trait. Same surface as PluginLogic but with the audio buffer pinned to f64.
PluginLogicCore
Wrapper-facing plugin trait, generic over the audio sample type.
RenderBackend
Abstraction over rendering backends (CPU via tiny-skia, GPU via wgpu).

Functions§

backing_scale
Get the display scale factor used to size the next editor.
default_hit_test
Default hit test: circular for knobs, rectangular for everything else, skip meters. Used by the leaf traits’ hit_test defaults.