reenable global play/pause

This commit is contained in:
🪞👃🪞 2024-11-25 16:10:21 +01:00
parent 86f37fb278
commit 340919830a
12 changed files with 208 additions and 165 deletions

View file

@ -1,6 +1,5 @@
use crate::*;
use rand::{thread_rng, distributions::uniform::UniformSampler};
pub use palette::{*, convert::*, okhsl::*};
/// A color in OKHSL and RGB representations.
#[derive(Debug, Default, Copy, Clone, PartialEq)]

View file

@ -15,6 +15,7 @@ pub(crate) use std::io::{stdout};
pub(crate) use std::thread::{spawn, JoinHandle};
pub(crate) use std::time::Duration;
pub(crate) use atomic_float::*;
pub(crate) use palette::{*, convert::*, okhsl::*};
use better_panic::{Settings, Verbosity};
use std::ops::{Add, Sub, Mul, Div, Rem};
use std::cmp::{Ord, Eq, PartialEq};

View file

@ -116,10 +116,26 @@ impl_time_unit!(Pulse);
/// Quantization setting for launching clips
#[derive(Debug, Default)] pub struct LaunchSync(AtomicF64);
impl_time_unit!(LaunchSync);
impl LaunchSync {
pub fn next (&self) -> f64 {
next_note_length(self.get() as usize) as f64
}
pub fn prev (&self) -> f64 {
prev_note_length(self.get() as usize) as f64
}
}
/// Quantization setting for notes
#[derive(Debug, Default)] pub struct Quantize(AtomicF64);
impl_time_unit!(Quantize);
impl Quantize {
pub fn next (&self) -> f64 {
next_note_length(self.get() as usize) as f64
}
pub fn prev (&self) -> f64 {
prev_note_length(self.get() as usize) as f64
}
}
/// Temporal resolutions: sample rate, tempo, MIDI pulses per quaver (beat)
#[derive(Debug, Clone)]