pub enum Layout {
V2,
V3,
V4,
}Expand description
Stream units for one sample generation. V4 alone alternates stereo channel words instead of fields.
Variants§
V2
.nsmp: 3-byte words, 24-field cells, a 51-byte stroke header.
V3
.nsmp3: 4-byte words, 32-field cells, a 68-byte stroke header.
V4
.nsmp4: Layout::V3’s units, and a word stream per channel on stereo.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn from_version(version: u32) -> Option<Layout>
pub fn from_version(version: u32) -> Option<Layout>
The layout implied by a format × 100 + revision content version, or None
for a version at or above V5_FROM_VERSION.
Sourcepub const fn extension(self) -> &'static str
pub const fn extension(self) -> &'static str
The file extension a generation’s instruments carry, without the dot.
Sourcepub const fn splits_wide_openings(self) -> bool
pub const fn splits_wide_openings(self) -> bool
Whether stereo channels occupy alternating, independently padded word streams. True only for V4; only 1:1 records gain padding because content tiles whole words.
Sourcepub const fn word(self) -> usize
pub const fn word(self) -> usize
Bytes per stream word. A header occupies one word’s low 24 bits.
Sourcepub const fn header_len(self) -> usize
pub const fn header_len(self) -> usize
Bytes in the fixed stroke header before the word stream.
Sourcepub const fn cell(self) -> usize
pub const fn cell(self) -> usize
Fields per mono cell. Content counts are multiples; stereo terminators double it.
Sourcepub const fn rmax(self) -> usize
pub const fn rmax(self) -> usize
Fields one 1:1 record covers at most, per channel — RMAX. A run is split into
whole records of at least Layout::cell and at most this, which is what
makes the reachable run lengths come in windows with gaps between them.
Sourcepub const fn signed_peak(self) -> bool
pub const fn signed_peak(self) -> bool
Whether statistic B carries the extreme content field’s sign. V2 stores its
magnitude, so ffffff is a peak of 16,777,215 there and −1 in the wide chain.
Trait Implementations§
impl Copy for Layout
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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.