use bincode::{Decode, Encode};
#[derive(Debug, Clone, PartialEq, Encode, Decode)]
pub struct TimingPoint {
pub time_us: i64,
pub bpm: f32,
pub signature: u8,
pub is_inherited: bool,
pub scroll_speed: f32,
}
impl TimingPoint {
#[must_use]
pub fn bpm(time_us: i64, bpm: f32) -> Self {
Self {
time_us,
bpm,
signature: 4,
is_inherited: false,
scroll_speed: 1.0,
}
}
#[must_use]
pub fn sv(time_us: i64, scroll_speed: f32) -> Self {
Self {
time_us,
bpm: 0.0,
signature: 4,
is_inherited: true,
scroll_speed,
}
}
}