mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
big ass refactor (rip client)
This commit is contained in:
parent
94c1f83ef2
commit
8c3cf53c67
56 changed files with 2232 additions and 1891 deletions
|
|
@ -1,15 +1,23 @@
|
|||
use crate::core::*;
|
||||
|
||||
#[derive(Default)]
|
||||
use atomic_float::AtomicF64;
|
||||
#[derive(Debug)]
|
||||
pub struct Timebase {
|
||||
/// Frames per second
|
||||
pub rate: ::atomic_float::AtomicF64,
|
||||
pub rate: AtomicF64,
|
||||
/// Beats per minute
|
||||
pub bpm: ::atomic_float::AtomicF64,
|
||||
pub bpm: AtomicF64,
|
||||
/// Ticks per beat
|
||||
pub ppq: ::atomic_float::AtomicF64,
|
||||
pub ppq: AtomicF64,
|
||||
}
|
||||
impl Default for Timebase {
|
||||
fn default () -> Self {
|
||||
Self {
|
||||
rate: 48000f64.into(),
|
||||
bpm: 125f64.into(),
|
||||
ppq: 96f64.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Timebase {
|
||||
pub fn new (rate: f64, bpm: f64, ppq: f64) -> Self {
|
||||
Self { rate: rate.into(), bpm: bpm.into(), ppq: ppq.into() }
|
||||
|
|
@ -146,7 +154,6 @@ impl Timebase {
|
|||
ticks
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)] mod test {
|
||||
use super::*;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue