[][src]Struct iced_audio::core::range::IntRange

pub struct IntRange { /* fields omitted */ }

A range that defines a discrete linear range of i32 values

Implementations

impl IntRange[src]

pub fn new(min: i32, max: i32) -> Self[src]

Creates a new IntRange

Arguments

  • min - the minimum of the range (inclusive)
  • max - the maximum of the range (inclusive)

Panics

This will panic if max <= min

pub fn create_param<ID: Debug + Copy + Clone>(
    &self,
    id: ID,
    value: i32,
    default_value: i32
) -> Param<ID>
[src]

Creates a new Param with values mapped from this range.

  • id - A unique user-defined identifier for the parameter. This can be an enum, i32, u32, String, etc. Each parameter must have a unique ID value!
  • value - The inital value of the parameter.
  • default_value - The default value of the parameter.

pub fn create_param_default<ID: Debug + Copy + Clone>(
    &self,
    id: ID
) -> Param<ID>
[src]

Creates a new Param with values mapped from this range where value and default_value is 0.

  • id - A unique user-defined identifier for the parameter. This can be an enum, i32, u32, String, etc. Each parameter must have a unique ID value!

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

Snaps a Normal to the closest integer value in this range.

pub fn to_normal(&self, value: i32) -> Normal[src]

Returns the corresponding Normal from the supplied value

pub fn to_value(&self, normal: Normal) -> i32[src]

Returns the corresponding value from the supplied Normal

Trait Implementations

impl Clone for IntRange[src]

impl Copy for IntRange[src]

impl Debug for IntRange[src]

impl Default for IntRange[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> SetParameter for T

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