pub struct PatternStatus { /* private fields */ }Expand description
What a sequencer track’s pattern player is doing, for the UI to draw.
Four small atomics rather than a channel, and for the same reason as
VuLevels: the UI redraws on a timer and wants the state now rather
than a history of it, and publishing must not make the audio thread
allocate, block, or care whether anyone is listening.
The step and the queued slot are things the UI could work out for itself — both are functions of the transport position — but only by reimplementing the audio thread’s arithmetic and hoping the two never disagree. Reading what actually played is one store per callback and cannot drift.
Implementations§
Source§impl PatternStatus
impl PatternStatus
pub fn new() -> Self
Sourcepub fn publish(
&self,
live_slot: u8,
queued_slot: Option<u8>,
step: u8,
running: bool,
)
pub fn publish( &self, live_slot: u8, queued_slot: Option<u8>, step: u8, running: bool, )
Called once per callback from the audio thread.
pub fn live_slot(&self) -> u8
pub fn queued_slot(&self) -> Option<u8>
pub fn step(&self) -> u8
pub fn is_running(&self) -> bool
Trait Implementations§
Source§impl Debug for PatternStatus
impl Debug for PatternStatus
Source§impl Default for PatternStatus
impl Default for PatternStatus
Source§fn default() -> PatternStatus
fn default() -> PatternStatus
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for PatternStatus
impl RefUnwindSafe for PatternStatus
impl Send for PatternStatus
impl Sync for PatternStatus
impl Unpin for PatternStatus
impl UnsafeUnpin for PatternStatus
impl UnwindSafe for PatternStatus
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