pub struct ParamSnapshot<'a> {
pub get_param: &'a dyn Fn(u32) -> f32,
pub get_param_plain: &'a dyn Fn(u32) -> f32,
pub format_param: &'a dyn Fn(u32) -> String,
pub get_meter: &'a dyn Fn(u32) -> f32,
pub get_options: &'a dyn Fn(u32) -> Vec<String>,
pub default_normalized: &'a dyn Fn(u32) -> f32,
pub next_discrete_normalized: &'a dyn Fn(u32) -> f32,
pub param_name: &'a dyn Fn(u32) -> String,
pub widget_type: &'a dyn Fn(u32) -> WidgetType,
}Expand description
Immutable view of one frame’s worth of parameter state.
Each field is a borrowed closure, so the snapshot itself is cheap to construct - no copying of values up front. Closures are read on demand as widgets/dispatch need them.
Fields§
§get_param: &'a dyn Fn(u32) -> f32Read normalized value (0.0–1.0).
get_param_plain: &'a dyn Fn(u32) -> f32Read plain (unit-scaled) value.
format_param: &'a dyn Fn(u32) -> StringFormat the current plain value as a display string.
get_meter: &'a dyn Fn(u32) -> f32Read a meter value (0.0–1.0).
get_options: &'a dyn Fn(u32) -> Vec<String>Enumerate option display strings for a discrete/enum parameter. Returns empty if the parameter is continuous or not dropdown-shaped.
default_normalized: &'a dyn Fn(u32) -> f32Default normalized value, used for reset-on-double-click.
next_discrete_normalized: &'a dyn Fn(u32) -> f32Compute the next normalized value after a click-to-cycle selector advance. Wraps around at the end of the range.
param_name: &'a dyn Fn(u32) -> StringParameter display name. Used as a fallback label when a layout entry did not supply its own (e.g. XY-pad axis names).
widget_type: &'a dyn Fn(u32) -> WidgetTypeAuto-detected widget type from the parameter’s range. widgets::draw
uses this when the layout entry did not specify an explicit widget
kind.