pub struct TempoMap { /* private fields */ }Expand description
An ordered tempo map for one SMF, with its time division.
Implementations§
Source§impl TempoMap
impl TempoMap
Sourcepub fn constant(division: Division, us_per_quarter: u32) -> Self
pub fn constant(division: Division, us_per_quarter: u32) -> Self
Build a single-tempo map (useful for tests and tempo-less files).
Sourcepub fn entries(&self) -> &[TempoEntry]
pub fn entries(&self) -> &[TempoEntry]
The tempo entries, sorted by tick.
Sourcepub fn ticks_to_seconds(&self, tick: u64) -> f64
pub fn ticks_to_seconds(&self, tick: u64) -> f64
Convert an absolute tick position to elapsed seconds from the start.
Sourcepub fn seconds_to_ticks(&self, seconds: f64) -> u64
pub fn seconds_to_ticks(&self, seconds: f64) -> u64
Convert elapsed seconds from the start to an absolute tick position (rounded to the nearest tick).
Trait Implementations§
impl Eq for TempoMap
impl StructuralPartialEq for TempoMap
Auto Trait Implementations§
impl Freeze for TempoMap
impl RefUnwindSafe for TempoMap
impl Send for TempoMap
impl Sync for TempoMap
impl Unpin for TempoMap
impl UnsafeUnpin for TempoMap
impl UnwindSafe for TempoMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more