Skip to main content

Crate truce_gui

Crate truce_gui 

Source
Expand description

Built-in GUI for truce plugins.

Orchestrates the two truce_gui_types::RenderBackend impls into editor types: with the default cpu feature, BuiltinEditor rasterises widgets to a truce_cpu::CpuBackend (tiny-skia) pixmap and blits it to a wgpu surface; with the gpu feature, GpuEditor renders directly through truce_gpu::WgpuBackend. The non-runtime data types (layout, widget regions, interaction state, theme, render trait) live in truce-gui-types and the plugin traits in truce-plugin; this crate re-exports them so existing truce_gui::... paths keep working.

Re-exports§

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

Modules§

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§

CpuBackend
CPU-based rendering backend.
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. Lives here (next to the tiny-skia rasterizer that consumes them) so truce-gui-types stays rasterizer-free.
IntoLayoutEditor
Fluent shorthand for default_editor. Build a GridLayout, then close the editor() impl with .into_editor(&self.params):
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_editor
Construct truce’s default editor for a plugin’s editor() impl.
default_hit_test
Default hit test: circular for knobs, rectangular for everything else, skip meters. Used by the leaf traits’ hit_test defaults.
to_physical_px
Convert a logical extent (in points) to physical pixels.