From 4b7bb94c8e73fc24a846182b297717558840f642 Mon Sep 17 00:00:00 2001 From: rbmj Date: Wed, 25 Oct 2023 18:17:48 -0700 Subject: [PATCH] Added IntParam::range() and FloatParam::range() --- src/params/float.rs | 6 ++++++ src/params/integer.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/params/float.rs b/src/params/float.rs index 63348aa4..83cb8fd8 100644 --- a/src/params/float.rs +++ b/src/params/float.rs @@ -300,6 +300,12 @@ impl FloatParam { self.modulated_plain_value() } + /// The range of valid plain values for this parameter. + #[inline] + pub fn range(&self) -> FloatRange { + self.range + } + /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this /// parameter in [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation] /// events, and must thus be unique between _all_ polyphonically modulatable parameters. See the diff --git a/src/params/integer.rs b/src/params/integer.rs index 7dd63596..dd5254d5 100644 --- a/src/params/integer.rs +++ b/src/params/integer.rs @@ -278,6 +278,12 @@ impl IntParam { pub fn value(&self) -> i32 { self.modulated_plain_value() } + + /// The range of valid plain values for this parameter. + #[inline] + pub fn range(&self) -> IntRange { + self.range + } /// Enable polyphonic modulation for this parameter. The ID is used to uniquely identify this /// parameter in [`NoteEvent::PolyModulation`][crate::prelude::NoteEvent::PolyModulation]