pub struct MusicTimeCounter { /* private fields */ }Expand description
Data structure that handles advancing music time within a time signature.
Implementations§
Source§impl MusicTimeCounter
impl MusicTimeCounter
Sourcepub fn new(time_signature: TimeSignature) -> Self
pub fn new(time_signature: TimeSignature) -> Self
Sourcepub fn current_time(&self) -> &MusicTime
pub fn current_time(&self) -> &MusicTime
Gets the current time of the counter.
Sourcepub fn advance_beat(&mut self)
pub fn advance_beat(&mut self)
Advance this counter by 1 beat.
Sourcepub fn advance_beat_interval(&mut self)
pub fn advance_beat_interval(&mut self)
Advance this counter by 1 beat interval.
Sourcepub fn beat_target_frames(&self, bpm: f32) -> Duration
pub fn beat_target_frames(&self, bpm: f32) -> Duration
Sourcepub fn beat_interval_target_frames(&self, bpm: f32) -> Duration
pub fn beat_interval_target_frames(&self, bpm: f32) -> Duration
Sourcepub fn set_current_time(&mut self, current_time: MusicTime) -> &mut Self
pub fn set_current_time(&mut self, current_time: MusicTime) -> &mut Self
Set the current music time of the counter.
§Arguments
current_time- The new current time to set counter to.
Trait Implementations§
Source§impl Debug for MusicTimeCounter
impl Debug for MusicTimeCounter
Auto Trait Implementations§
impl Freeze for MusicTimeCounter
impl RefUnwindSafe for MusicTimeCounter
impl Send for MusicTimeCounter
impl Sync for MusicTimeCounter
impl Unpin for MusicTimeCounter
impl UnwindSafe for MusicTimeCounter
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