pub enum ParamEvent<'a, P: Param> {
    BeginSetParameter(&'a P),
    SetParameter(&'a P, P::Plain),
    SetParameterNormalized(&'a P, f32),
    EndSetParameter(&'a P),
}
Expand description

An event that updates a parameter’s value. Since NIH-plug manages the parameters, interacting with parameter values with VIZIA works a little different from updating any other state. These events are automatically handled by nih_plug_vizia.

Call the upcast() method to be able to emit this event through an [EventContext][EventContext].

Variants§

§

BeginSetParameter(&'a P)

Begin an automation gesture for a parameter.

§

SetParameter(&'a P, P::Plain)

Set a parameter to a new normalized value. This needs to be surrounded by a matching BeginSetParameter and EndSetParameter.

§

SetParameterNormalized(&'a P, f32)

Set a parameter to a new normalized value. This needs to be surrounded by a matching BeginSetParameter and EndSetParameter.

§

EndSetParameter(&'a P)

End an automation gesture for a parameter.

Implementations§

source§

impl<P: Param> ParamEvent<'_, P>

source

pub fn upcast(self) -> RawParamEvent

Convert this event into a type erased version of itself that can be emitted through [EventContext::emit()][EventContext::emit()].

TODO: Think of a better, clearer term for this

Trait Implementations§

source§

impl<'a, P: Clone + Param> Clone for ParamEvent<'a, P>where P::Plain: Clone,

source§

fn clone(&self) -> ParamEvent<'a, P>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, P: Debug + Param> Debug for ParamEvent<'a, P>where P::Plain: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<P: Param> From<ParamEvent<'_, P>> for RawParamEvent

source§

fn from(event: ParamEvent<'_, P>) -> Self

Converts to this type from the input type.
source§

impl<'a, P: Copy + Param> Copy for ParamEvent<'a, P>where P::Plain: Copy,

Auto Trait Implementations§

§

impl<'a, P> RefUnwindSafe for ParamEvent<'a, P>where P: RefUnwindSafe, <P as Param>::Plain: RefUnwindSafe,

§

impl<'a, P> Send for ParamEvent<'a, P>where P: Sync, <P as Param>::Plain: Send,

§

impl<'a, P> Sync for ParamEvent<'a, P>where P: Sync, <P as Param>::Plain: Sync,

§

impl<'a, P> Unpin for ParamEvent<'a, P>where <P as Param>::Plain: Unpin,

§

impl<'a, P> UnwindSafe for ParamEvent<'a, P>where P: RefUnwindSafe, <P as Param>::Plain: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

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

§

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 Twhere U: TryFrom<T>,

§

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

impl<T> Any for Twhere T: Any,

§

impl<T> CloneAny for Twhere T: Any + Clone,

§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,