pub enum Library {
Piano,
Sample,
Program,
SetList,
}Expand description
One of the instrument’s stored libraries — what a ControlKind::Reference id is an
id into.
A file carries the id alone, so nothing but this says which catalogue resolves it. Listed here are the libraries something in a decoded body actually refers to; the instruments hold others (the live slots, the settings singleton) that no reference points at, and they are not here.
Variants§
Piano
Piano instruments (.npno).
Sample
Sample instruments (.nsmp).
Program
The instrument’s own programs.
SetList
Set lists, which name programs in turn.
Implementations§
Source§impl Library
impl Library
Sourcepub const fn code(self) -> u8
pub const fn code(self) -> u8
The library’s numeric code.
It exists because a const generic parameter cannot be an enum: a type that carries
its library — LibraryRefOf — carries this
instead and turns it back with from_code.
The numbers are the object-class codes the instruments use on the wire, and
nord-usb’s ObjectClass takes its library codes from here, so a caller holding
both has one table.
Sourcepub const fn from_code(code: u8) -> Option<Library>
pub const fn from_code(code: u8) -> Option<Library>
The library a code names, or None — most bytes name none.
Sourcepub const fn expect_code(code: u8) -> Library
pub const fn expect_code(code: u8) -> Library
The library a code names, for the type-level parameter this
vocabulary exists to carry.
⚠️ Panics on a code naming none. That is a build failure only where the value is
forced at compile time, which the aliases in components
are — a LibraryRefOf<7> nobody places compiles clean and fails when a field
declared with it asks for its control kind. Use from_code
anywhere a code arrives at runtime.
Trait Implementations§
impl Copy for Library
impl Eq for Library
impl StructuralPartialEq for Library
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl Send for Library
impl Sync for Library
impl Unpin for Library
impl UnsafeUnpin for Library
impl UnwindSafe for Library
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.