[−][src]Struct music_timer::music_time_counter::MusicTimeCounter
Data structure that handles advancing music time within a time signature.
Methods
impl MusicTimeCounter
[src]
pub fn new(time_signature: TimeSignature) -> Self
[src]
Create a new MusicTimeCounter
with a TimeSignature
.
Arguments
time_signature
- TheTimeSignature
theMusicTimeCounter
is constrained by.
Example
use music_timer::{time_signature::TimeSignature, music_time_counter::MusicTimeCounter}; let timer = MusicTimeCounter::new(TimeSignature::new(3, 4));
pub fn current_time(&self) -> &MusicTime
[src]
Gets the current time of the counter.
pub fn advance_beat(&mut self)
[src]
Advance this counter by 1 beat.
pub fn advance_beat_interval(&mut self)
[src]
Advance this counter by 1 beat interval.
pub fn beat_target_frames(&self, bpm: f32) -> Duration
[src]
pub fn beat_interval_target_frames(&self, bpm: f32) -> Duration
[src]
pub fn set_current_time(&mut self, current_time: MusicTime) -> &mut Self
[src]
Set the current music time of the counter.
Arguments
current_time
- The new current time to set counter to.
Trait Implementations
impl Debug for MusicTimeCounter
[src]
impl Default for MusicTimeCounter
[src]
Auto Trait Implementations
impl RefUnwindSafe for MusicTimeCounter
impl Send for MusicTimeCounter
impl Sync for MusicTimeCounter
impl Unpin for MusicTimeCounter
impl UnwindSafe for MusicTimeCounter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,