pub struct SystemClock {
pub sample_rate: f32,
/* private fields */
}Expand description
High-precision system clock for sample-accurate timing.
Provides sample-accurate timing for signal processing. Uses atomic operations for thread safety without locks.
Fields§
§sample_rate: f32Sample rate of the audio system (Hz).
Implementations§
Source§impl SystemClock
impl SystemClock
Sourcepub fn new(sample_rate: f32, initial_bpm: f64) -> SystemClock
pub fn new(sample_rate: f32, initial_bpm: f64) -> SystemClock
Create a new system clock at the given sample rate and initial BPM.
Sourcepub fn with_sample_rate(sample_rate: f32) -> SystemClock
pub fn with_sample_rate(sample_rate: f32) -> SystemClock
Create a new system clock with a default BPM of 120.
Trait Implementations§
Source§impl ClockSource for SystemClock
impl ClockSource for SystemClock
Source§fn sample_rate(&self) -> f32
fn sample_rate(&self) -> f32
Get the sample rate of this clock source
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if the clock is running
Source§fn current_position(&self) -> u64
fn current_position(&self) -> u64
Get the current sample position Read more
Auto Trait Implementations§
impl !Freeze for SystemClock
impl RefUnwindSafe for SystemClock
impl Send for SystemClock
impl Sync for SystemClock
impl Unpin for SystemClock
impl UnsafeUnpin for SystemClock
impl UnwindSafe for SystemClock
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