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 oftruce-gui’s interaction surface. The platform-agnostic data types (InputEvent,MouseButton,Modifiers,WidgetRegion,InteractionState,DragState,DropdownState,dispatch, …) live intruce_gui_types::interactionand are re-exported here so existingtruce_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.
- Param
Snapshot - Immutable view of one frame’s worth of parameter state.
- Theme
- Visual theme for the built-in GUI.
Traits§
- Color
Ext - Extension trait giving
truce_gui_types::theme::Colortheto_skia/to_premultipliedmethods. Lives here (next to the tiny-skia rasterizer that consumes them) sotruce-gui-typesstays rasterizer-free. - Into
Layout Editor - Fluent shorthand for
default_editor. Build aGridLayout, then close theeditor()impl with.into_editor(&self.params): - Plugin
Logic - The
f32-buffer user-facing plugin trait. - Plugin
Logic64 - The
f64-buffer user-facing plugin trait. Same surface asPluginLogicbut with the audio buffer pinned tof64. - Plugin
Logic Core - Wrapper-facing plugin trait, generic over the audio sample type.
- Render
Backend - 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_testdefaults. - to_
physical_ px - Convert a logical extent (in points) to physical pixels.