pub enum Unit {
Panel10,
Decibels,
Milliseconds,
Hertz,
Bpm,
ClockDivision,
Semitones,
Octaves,
Pan,
None,
}Expand description
What a control’s reading is in.
⚠️ Naming a unit is not a promise that the stored value converts to it. Several Nord
knobs read in milliseconds or hertz over a curve no manual publishes; the unit says
what the panel shows, and the type’s own Display prints a converted reading only
where the transform is known. See Unit::describes_a_known_transform.
Variants§
Panel10
The panel’s own 0..10, which most Nord knobs read in.
Decibels
Milliseconds
Hertz
Bpm
Beats per minute, quarter-note.
ClockDivision
A subdivision of the master clock — 1/8, 1/4 T.
Semitones
Octaves
Pan
A stereo position, left through centre to right.
None
No unit: a count, an index, or a raw byte.
Implementations§
Source§impl Unit
impl Unit
Sourcepub const fn code(self) -> u8
pub const fn code(self) -> u8
The unit’s numeric code.
It exists for the same reason Library::code does: a const generic parameter
cannot be an enum, so a type that carries its unit —
BipolarOf — carries this and turns it back with
expect_code.
Sourcepub const fn expect_code(code: u8) -> Unit
pub const fn expect_code(code: u8) -> Unit
The unit a code names, for the type-level parameter this
vocabulary exists to carry.
⚠️ Panics on a code naming none, which is a build failure where the value is
forced at compile time — as the aliases in components are.
Sourcepub fn describes_a_known_transform(&self) -> bool
pub fn describes_a_known_transform(&self) -> bool
Whether a value in this unit can be computed from the stored one.
False for the units where the panel’s curve is not published — a caller that wants to label an axis may still use the unit, but must print the stored value.
Trait Implementations§
impl Copy for Unit
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.