pub struct ConvertMicroSecondsToTicks { /* private fields */ }Expand description
Convert timings of midi events from microseconds to ticks.
Implementations§
Source§impl ConvertMicroSecondsToTicks
impl ConvertMicroSecondsToTicks
Sourcepub fn convert<T>(
&mut self,
microseconds: u64,
event: &T,
) -> Result<u64, TimeConversionError>where
T: MidiEvent,
pub fn convert<T>(
&mut self,
microseconds: u64,
event: &T,
) -> Result<u64, TimeConversionError>where
T: MidiEvent,
Return the time of the midi event, in ticks, relative to the beginning of the track.
§Parameters
microseconds: the time, in ticks, relative to the beginning of the track.
It is assumed that this only increases with subsequent calls to this method.
event: the event.
§Return value
The method returns Err if the event does not indicate a tempo of zero microseconds per beat.
Otherwise, it returns Ok(time_in_ticks), where time_in_ticks is the time, in ticks,
relative to the beginning of the track.
Trait Implementations§
Source§impl From<Header> for ConvertMicroSecondsToTicks
Available on crate feature convert-time only.
impl From<Header> for ConvertMicroSecondsToTicks
Available on crate feature
convert-time only.Auto Trait Implementations§
impl Freeze for ConvertMicroSecondsToTicks
impl RefUnwindSafe for ConvertMicroSecondsToTicks
impl Send for ConvertMicroSecondsToTicks
impl Sync for ConvertMicroSecondsToTicks
impl Unpin for ConvertMicroSecondsToTicks
impl UnwindSafe for ConvertMicroSecondsToTicks
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more