Struct reaper_medium::ReaperVolumeValue
source · [−]pub struct ReaperVolumeValue(_);
Expand description
This represents a volume measured in REAPER’s native volume unit.
Implementations
sourceimpl ReaperVolumeValue
impl ReaperVolumeValue
sourcepub const MIN: ReaperVolumeValue = _
pub const MIN: ReaperVolumeValue = _
The minimum possible value (0.0).
If the scale would be linear, this would be less than -150 dB. But it’s not. In practice,
REAPER considers this as equal to the MINUS_150_DB
value.
There’s no maximum value because REAPER allows to exceed the soft maximum of 12 dB!
sourcepub const NAN: ReaperVolumeValue = _
pub const NAN: ReaperVolumeValue = _
The not-a-number volume (f64::NAN
= 1.#R dB).
It’s reasonable to assume that this isn’t actually a valid value. However, REAPER doesn’t prevent extensions from setting it, so you might run into it.
sourcepub const MINUS_150_DB: ReaperVolumeValue = _
pub const MINUS_150_DB: ReaperVolumeValue = _
The “soft minimum” volume (3.1622776601684e-008 = -150.0 dB).
When setting a value, use MIN
(0.0) instead because this is just an approximation.
sourcepub const ZERO_DB: ReaperVolumeValue = _
pub const ZERO_DB: ReaperVolumeValue = _
The “unaltered” volume (1.0 = 0.0 dB).
sourcepub const TWELVE_DB: ReaperVolumeValue = _
pub const TWELVE_DB: ReaperVolumeValue = _
The “soft maximum” volume (3.981071705535 = 12.0 dB).
sourcepub fn new(value: f64) -> ReaperVolumeValue
pub fn new(value: f64) -> ReaperVolumeValue
Creates a REAPER volume value.
Panics
This function panics if the given value is not within the range supported by REAPER
(0.0..)
.
Trait Implementations
sourceimpl Clone for ReaperVolumeValue
impl Clone for ReaperVolumeValue
sourcefn clone(&self) -> ReaperVolumeValue
fn clone(&self) -> ReaperVolumeValue
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ReaperVolumeValue
impl Debug for ReaperVolumeValue
sourceimpl Default for ReaperVolumeValue
impl Default for ReaperVolumeValue
sourcefn default() -> ReaperVolumeValue
fn default() -> ReaperVolumeValue
sourceimpl Display for ReaperVolumeValue
impl Display for ReaperVolumeValue
sourceimpl PartialEq<ReaperVolumeValue> for ReaperVolumeValue
impl PartialEq<ReaperVolumeValue> for ReaperVolumeValue
sourcefn eq(&self, other: &ReaperVolumeValue) -> bool
fn eq(&self, other: &ReaperVolumeValue) -> bool
sourceimpl PartialOrd<ReaperVolumeValue> for ReaperVolumeValue
impl PartialOrd<ReaperVolumeValue> for ReaperVolumeValue
sourcefn partial_cmp(&self, other: &ReaperVolumeValue) -> Option<Ordering>
fn partial_cmp(&self, other: &ReaperVolumeValue) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresourceimpl TryFrom<f64> for ReaperVolumeValue
impl TryFrom<f64> for ReaperVolumeValue
impl Copy for ReaperVolumeValue
impl StructuralPartialEq for ReaperVolumeValue
Auto Trait Implementations
impl RefUnwindSafe for ReaperVolumeValue
impl Send for ReaperVolumeValue
impl Sync for ReaperVolumeValue
impl Unpin for ReaperVolumeValue
impl UnwindSafe for ReaperVolumeValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more