pub struct ConvertTicksToMicroseconds { /* private fields */ }Expand description
Convert timings of midi events from ticks to microseconds.
Implementations§
Source§impl ConvertTicksToMicroseconds
impl ConvertTicksToMicroseconds
Sourcepub fn convert<T>(&mut self, ticks: u64, event: &T) -> u64where
T: MidiEvent,
pub fn convert<T>(&mut self, ticks: u64, event: &T) -> u64where
T: MidiEvent,
Return the time of the event, in microseconds, relative to the beginning of the track.
§Parameters
ticks: 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 time, in microseconds, relative to the beginning of the track.
Trait Implementations§
Source§impl TryFrom<Header> for ConvertTicksToMicroseconds
Available on crate feature convert-time only.
impl TryFrom<Header> for ConvertTicksToMicroseconds
Available on crate feature
convert-time only.Source§fn try_from(header: Header) -> Result<Self, Self::Error>
fn try_from(header: Header) -> Result<Self, Self::Error>
Create a new ConvertTicksToMicrosecond with the given header.
The parameter header is used to determine the meaning of “tick”, since this is stored
in the header in a midi file.
Source§type Error = TimeConversionError
type Error = TimeConversionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ConvertTicksToMicroseconds
impl RefUnwindSafe for ConvertTicksToMicroseconds
impl Send for ConvertTicksToMicroseconds
impl Sync for ConvertTicksToMicroseconds
impl Unpin for ConvertTicksToMicroseconds
impl UnwindSafe for ConvertTicksToMicroseconds
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