Gain (vizia)
The gain plugin reimplemented with a Vizia GUI. Same DSP as the built-in gain example, different frontend.
Source: crates/truce-vizia/examples/truce-example-gain-vizia/.
#What it demonstrates
ViziaEditorwith a setup closure receiving&mut Context+ParamLens<P>param_knob,param_xy_pad,level_meterwidget helpers- Shared
Signal<f32>per param — knob and XY pad bound to the sameidstay in sync without extra wiring - Per-OS screenshot baselines with
pixel_threshold(2)on Linux and Windows (rasterizer drift) with_stylesheet(widgets::BASE_CSS)for vizia layout shimswith_font(JETBRAINS_MONO)for cross-backend visual parity
#Layout
Left column: two knobs (Gain, Pan) over a 130×130 Pan/Gain XY pad. Right column: stereo meter spanning the full height. 176×260 logical points, aligned so the XY pad's bottom edge matches the meter's.
#Files
src/lib.rs— plugin logic, editor wiring, screenshot testssrc/main.rs— standalone host entry point
#See also
- vizia integration guide
- gain — same plugin with the built-in GUI
- gain-egui — same plugin with egui
- gain-iced — same plugin with iced
- gain-slint — same plugin with slint
#Build and test
cargo build --manifest-path crates/truce-vizia/Cargo.toml \
-p truce-example-gain-vizia
cargo test --manifest-path crates/truce-vizia/Cargo.toml \
-p truce-example-gain-vizia
The vizia examples live in a separate Cargo sub-workspace (see the
vizia integration guide for why). All cargo build / cargo test invocations need --manifest-path crates/truce-vizia/Cargo.toml.