pub struct Transport { /* private fields */ }Expand description
A fixed-tempo grid in output frames. BPM counts quarter notes per minute. Tempo is rounded to 0.001 BPM on construction; every boundary is computed directly with integer arithmetic, rounded to the nearest frame (halves up).
Implementations§
Source§impl Transport
impl Transport
Sourcepub fn new(
sample_rate: u32,
bpm: f64,
signature: TimeSignature,
origin: u64,
) -> Result<Self>
pub fn new( sample_rate: u32, bpm: f64, signature: TimeSignature, origin: u64, ) -> Result<Self>
sample_rate uses the crate’s supported rate limits, BPM is finite 1..=1000,
and origin is the first bar’s first output frame.
pub fn sample_rate(&self) -> u32
pub fn bpm(&self) -> f64
pub fn signature(&self) -> TimeSignature
pub fn origin(&self) -> u64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transport
impl RefUnwindSafe for Transport
impl Send for Transport
impl Sync for Transport
impl Unpin for Transport
impl UnsafeUnpin for Transport
impl UnwindSafe for Transport
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