pub struct PotHead<TIn: 'static, TOut: 'static = TIn> { /* private fields */ }Implementations§
Source§impl<TIn, TOut> PotHead<TIn, TOut>where
TIn: 'static + Copy + PartialOrd + AsPrimitive<f32>,
TOut: 'static + Copy + PartialOrd + AsPrimitive<f32>,
f32: AsPrimitive<TOut>,
impl<TIn, TOut> PotHead<TIn, TOut>where
TIn: 'static + Copy + PartialOrd + AsPrimitive<f32>,
TOut: 'static + Copy + PartialOrd + AsPrimitive<f32>,
f32: AsPrimitive<TOut>,
pub fn new(config: &'static Config<TIn, TOut>) -> Result<Self, ConfigError>
pub fn config(&self) -> &Config<TIn, TOut>
pub fn update(&mut self, input: TIn) -> TOut
Sourcepub fn physical_position(&self) -> f32
pub fn physical_position(&self) -> f32
Returns the current physical input position in normalized 0.0..1.0 range. Useful for UI display when grab mode is active.
This always reflects where the pot physically is (after normalize→filter→curve→hysteresis), but BEFORE virtual modifications like snap zones and grab mode logic.
Sourcepub fn current_output(&self) -> f32
pub fn current_output(&self) -> f32
Returns the current output value in normalized 0.0..1.0 range without updating state. Useful for reading the locked virtual value in grab mode.
Sourcepub fn is_waiting_for_grab(&self) -> bool
pub fn is_waiting_for_grab(&self) -> bool
Returns true if grab mode is active but not yet grabbed.
When true, physical_position() != current_output()
Sourcepub fn set_virtual_value(&mut self, value: f32)
pub fn set_virtual_value(&mut self, value: f32)
Set the virtual parameter value (e.g., after preset change or automation). This unlocks grab mode, requiring the pot to be grabbed again.
Sourcepub fn release(&mut self)
pub fn release(&mut self)
Release grab and set virtual value to current physical position. Useful when switching which parameter a physical pot controls.
After calling this, the pot will be ungrabbed and the virtual value will be set to the current physical position. The pot must be moved to re-grab (in Pickup/PassThrough modes).