fix time trait usage

This commit is contained in:
🪞👃🪞 2024-11-01 15:27:06 +02:00
parent dc38fd3d52
commit 799228e366
7 changed files with 36 additions and 47 deletions

View file

@ -12,8 +12,8 @@ pub const DEFAULT_PPQ: f64 = 96.0;
#[derive(Debug, Default)]
pub struct TimeUnit(AtomicF64);
impl TimeUnit {
fn get (&self) -> f64 { self.0.load(Ordering::Relaxed) }
fn set (&self, value: f64) { self.0.store(value, Ordering::Relaxed) }
pub fn get (&self) -> f64 { self.0.load(Ordering::Relaxed) }
pub fn set (&self, value: f64) { self.0.store(value, Ordering::Relaxed) }
}
/// Temporal resolutions: sample rate, tempo, MIDI pulses per quaver (beat)
#[derive(Debug, Clone)]
@ -274,7 +274,7 @@ pub trait LaunchSync {
}
}
/// Something that defines note quantization
pub trait Quantize<T> { fn quant (&self) -> &TimeUnit; }
pub trait Quantize { fn quant (&self) -> &TimeUnit; }
/// (pulses, name), assuming 96 PPQ
pub const NOTE_DURATIONS: [(usize, &str);26] = [
(1, "1/384"),