pub struct TempoSegment {
pub start_tick: u64,
pub us_per_quarter: u32,
}Expand description
One constant-tempo span of a MIDI TempoMap, starting at a tick offset.
A segment holds the tempo (in microseconds per quarter note) that applies
from start_tick until the next segment begins. The tempo must be
non-zero.
§Examples
use sim_lib_stream_clock::TempoSegment;
let segment = TempoSegment::new(0, 500_000)?;
assert_eq!(segment.start_tick, 0);
assert_eq!(segment.us_per_quarter, 500_000);Fields§
§start_tick: u64Tick offset at which this tempo takes effect.
us_per_quarter: u32Tempo of the segment, in microseconds per quarter note.
Implementations§
Trait Implementations§
Source§impl Clone for TempoSegment
impl Clone for TempoSegment
Source§fn clone(&self) -> TempoSegment
fn clone(&self) -> TempoSegment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TempoSegment
Source§impl Debug for TempoSegment
impl Debug for TempoSegment
impl Eq for TempoSegment
Source§impl PartialEq for TempoSegment
impl PartialEq for TempoSegment
Source§fn eq(&self, other: &TempoSegment) -> bool
fn eq(&self, other: &TempoSegment) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TempoSegment
Auto Trait Implementations§
impl Freeze for TempoSegment
impl RefUnwindSafe for TempoSegment
impl Send for TempoSegment
impl Sync for TempoSegment
impl Unpin for TempoSegment
impl UnsafeUnpin for TempoSegment
impl UnwindSafe for TempoSegment
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