Gain (slint)
The gain plugin reimplemented with a Slint GUI. Same DSP as the built-in gain example, different frontend.
Source: examples/truce-example-gain-slint/.
#What it demonstrates
SlintEditorwith setup closure and per-frame sync- Custom
.slintmarkup withKnob,Meter,XYPadfrom@truce - Manual callback wiring (
on_gain_changed,on_pan_changed) - Formatted value text synced from Rust (
state.format()) - Header bar implemented in
.slintmarkup - Consistent window sizing between editor and snapshot test
- Screenshot testing with
truce_slint::screenshot(software renderer)
#Layout
Header bar with plugin name. Left column with two knobs (Gain,
Pan) and an XY pad. Thin stereo meter spanning the full height on
the right. All defined in ui/main.slint.
#Files
src/lib.rs— plugin logic, editor wiring, snapshot testui/main.slint— declarative UI markupbuild.rs— compiles.slintto Rust
#See also
- slint integration guide
- gain — same plugin with the built-in GUI
- gain-egui — same plugin with egui
- gain-iced — same plugin with iced
#Build and test
cargo build -p truce-example-gain-slint
cargo test -p truce-example-gain-slint