pub struct StmPlayerState {Show 16 fields
pub samples: Vec<StmSampleBody>,
pub patterns: Vec<StmPattern>,
pub order: Vec<u8>,
pub n_patterns: u8,
pub channels: [StmChannel; 4],
pub speed: u8,
pub tempo: u8,
pub sample_rate: u32,
pub order_index: usize,
pub row: u8,
pub tick: u8,
pub tick_sample_cursor: u32,
pub ended: bool,
pub global_volume: u8,
pub pending_order_jump: Option<u8>,
pub pending_break_row: Option<u8>,
}Expand description
STM player — owns decoded patterns / samples and a row/tick/BPM-style state machine.
Fields§
§samples: Vec<StmSampleBody>§patterns: Vec<StmPattern>§order: Vec<u8>§n_patterns: u8§channels: [StmChannel; 4]§speed: u8§tempo: u8§sample_rate: u32§order_index: usize§row: u8§tick: u8§tick_sample_cursor: u32§ended: bool§global_volume: u8§pending_order_jump: Option<u8>Pending pattern jump (Bxy): set on tick 0 of a row, consumed by
next_row.
pending_break_row: Option<u8>Pending pattern-break row (Dxy): set on tick 0, consumed by
next_row.
Implementations§
Source§impl StmPlayerState
impl StmPlayerState
pub fn new( header: &StmHeader, samples: Vec<StmSampleBody>, patterns: Vec<StmPattern>, sample_rate: u32, ) -> Self
Sourcepub fn samples_per_tick(&self) -> u32
pub fn samples_per_tick(&self) -> u32
Samples-per-tick using the MOD-style formula, with tempo treated
as a BPM-ish equivalent. Scream Tracker v1’s tempo register is
historically tempo * 2 compared to the S3M / MOD scale; we
approximate with bpm_equiv = tempo * 125 / 0x60, matching the
estimate_duration_micros heuristic in crate::stm.
Auto Trait Implementations§
impl Freeze for StmPlayerState
impl RefUnwindSafe for StmPlayerState
impl Send for StmPlayerState
impl Sync for StmPlayerState
impl Unpin for StmPlayerState
impl UnsafeUnpin for StmPlayerState
impl UnwindSafe for StmPlayerState
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
Mutably borrows from an owned value. Read more