pub struct IntParam {
pub info: ParamInfo,
/* private fields */
}Expand description
An integer parameter.
Fields§
§info: ParamInfoImplementations§
Source§impl IntParam
impl IntParam
Sourcepub fn new(info: ParamInfo) -> Self
pub fn new(info: ParamInfo) -> Self
§Panics
Panics if info.default_plain is non-finite or doesn’t
round-trip through i64. The cast f64 as i64 saturates
silently - default_plain = -1.0 lands on -1 (fine), but
default_plain = 1e30 saturates to i64::MAX and f64::NAN
becomes 0. The derive populates default_plain from
#[param(default = ...)]; a user-supplied float there is a
programmer error, not a runtime condition we should
silently absorb.
pub fn value(&self) -> i64
Sourcepub fn value_f32(&self) -> f32
pub fn value_f32(&self) -> f32
Read the value widened to f32. Useful when an int param feeds
a per-sample DSP loop that runs in f32.
Sourcepub fn value_usize(&self) -> usize
pub fn value_usize(&self) -> usize
Read the value as a non-negative usize. Negatives clamp to 0;
values above usize::MAX saturate.
pub fn set_value(&self, v: i64)
pub fn id(&self) -> u32
Auto Trait Implementations§
impl !Freeze for IntParam
impl RefUnwindSafe for IntParam
impl Send for IntParam
impl Sync for IntParam
impl Unpin for IntParam
impl UnsafeUnpin for IntParam
impl UnwindSafe for IntParam
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more