pub struct Header {
pub generation: Generation,
pub tag: Tag,
pub location: u32,
pub aux: u32,
pub version: u32,
}Expand description
The five fields both generations carry, verbatim.
No asserts live here: what location and aux mean is per format — a
bank/slot pair on programs, a library location on samples, 0xFFFFFFFF where
unset — so the container preserves them and the format modules interpret them.
Fields§
§generation: Generation§tag: Tag§location: u32u32 at 0x0c. On slot-addressed formats the low u16 is the bank and the
high u16 the slot; see Header::slot.
aux: u32u32 at 0x10: unset, a program category in the low u16, or a format-specific
two-word value. Preserved verbatim; see Header::category.
version: u32u32 at 0x14: a format’s schema version (ne5p holds 4) or a library’s
content version (nsmp holds format×100 + revision).
Implementations§
Source§impl Header
impl Header
Sourcepub fn new(format: &str, location: (u16, u16), version: u32) -> Header
pub fn new(format: &str, location: (u16, u16), version: u32) -> Header
A fresh type-1 header — the generation every current device writes — with
aux at the 0xFFFFFFFF the slot-addressed formats hold.
Sourcepub fn slot(&self) -> (u16, u16)
pub fn slot(&self) -> (u16, u16)
The location as the (bank, slot) pair slot-addressed formats store there.
Sourcepub fn category(&self) -> Option<u16>
pub fn category(&self) -> Option<u16>
The program category id most program formats keep in aux: the low u16
when the high u16 is zero, None for 0xFFFFFFFF (no category — the
formats whose panel has no category picker) and for the both-halves
shape the preset/library tags hold. What an id names is per model; the
Stage 2/3 names are ProgramCategory.
pub fn set_slot(&mut self, (bank, slot): (u16, u16))
Trait Implementations§
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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.