diff --git a/src/music.rs b/src/music.rs index 2f0b89a..f5924c8 100644 --- a/src/music.rs +++ b/src/music.rs @@ -17,6 +17,16 @@ pub struct BeatRate { #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)] pub struct StaticBeatRate(Duration); +pub struct TimeSignature { + initial: StaticTimeSignature, + changes: BTreeMap, +} + +pub struct StaticTimeSignature { + numerator: u32, + denominator: u32, +} + impl StaticBeatRate { pub fn from_bpm(bpm: f32) -> Self { @@ -52,6 +62,20 @@ impl BeatRate { } } +impl StaticTimeSignature { + pub fn new(numerator: u32, denominator: u32) -> Self {Self {numerator, denominator}} +} + +impl From for TimeSignature { + fn from(rhs: StaticTimeSignature) -> Self { + Self { + initial: rhs, + changes: BTreeMap::new(), + } + } +} + + #[cfg(test)] mod tests { use super::*;