PotHead

Struct PotHead 

Source
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>,

Source

pub fn new(config: &'static Config<TIn, TOut>) -> Result<Self, ConfigError>

Source

pub fn config(&self) -> &Config<TIn, TOut>

Source

pub fn update(&mut self, input: TIn) -> TOut

Source

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.

Source

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.

Source

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()

Source

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.

Source

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).

Auto Trait Implementations§

§

impl<TIn, TOut> Freeze for PotHead<TIn, TOut>

§

impl<TIn, TOut> RefUnwindSafe for PotHead<TIn, TOut>
where TIn: RefUnwindSafe, TOut: RefUnwindSafe,

§

impl<TIn, TOut> Send for PotHead<TIn, TOut>
where TIn: Sync, TOut: Sync,

§

impl<TIn, TOut> Sync for PotHead<TIn, TOut>
where TIn: Sync, TOut: Sync,

§

impl<TIn, TOut> Unpin for PotHead<TIn, TOut>

§

impl<TIn, TOut> UnwindSafe for PotHead<TIn, TOut>
where TIn: RefUnwindSafe, TOut: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.