[][src]Struct iced_audio::FloatParam

pub struct FloatParam { /* fields omitted */ }

A Param that defines a continuous linear range of f32 values

Methods

impl FloatParam[src]

pub fn new(id: u32, min: f32, max: f32, value: f32, default_value: f32) -> Self[src]

Creates a new FloatParam

Arguments

  • id - an identifier for the parameter (must be unique!)
  • min - the minimum of the range (inclusive)
  • max - the maximum of the range (inclusive)
  • value - the initial value of the parameter (if value falls outside the range given by min and max, then min or max will be used instead)
  • default_value - the default value of the parameter (if default_value falls outside the range given by min and max, then min or max will be used instead)

Panics

This will panic if max <= min

pub fn set_from_value(&mut self, value: f32)[src]

Sets the parameter's value to value

If value falls outside the range given by min and max from FloatParam::new(), then min or max will be used instead.

Value to Normal calculactions will not be recalculated if the value has not changed.

pub fn set_from_normal(&mut self, normal: Normal)[src]

Sets the parameter's value from a Normal

Normal to value calculactions will not be recalculated if the Normal has not changed.

pub fn value(&self) -> f32[src]

Returns the parameter's value

pub fn default_value(&self) -> f32[src]

Returns the parameter's default value

Trait Implementations

impl Clone for FloatParam[src]

impl Copy for FloatParam[src]

impl Debug for FloatParam[src]

impl Param for FloatParam[src]

impl PartialEq<FloatParam> for FloatParam[src]

impl StructuralPartialEq for FloatParam[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,