State

state plugin

Hello-world for #[derive(State)] — the per-instance non-numeric data plumbing.

Source: examples/truce-example-state/. Guide: chapter 11 → state.

#What it demonstrates

  • The split between params (numeric atoms — automatable, host knows about them) and state (anything else — strings, file paths, view modes, nested structs — the framework round-trips bytes on snapshot_into / load_state but the host never sees the shape).
  • #[derive(State)] on a StateBinding-bound struct.
  • A custom egui editor that reads + writes the instance label.
  • An audio-thread param (Active: BoolParam) sitting alongside the state-only label.

#Parameters

Name Type Description
Active BoolParam Pass-through enable toggle

#State

Field Type Description
label String User-entered plugin instance label