Struct jack::TransportBBT[][src]

pub struct TransportBBT {
    pub bar: usize,
    pub beat: usize,
    pub tick: usize,
    pub sig_num: f32,
    pub sig_denom: f32,
    pub ticks_per_beat: f64,
    pub bpm: f64,
    pub bar_start_tick: f64,
}

Transport Bar Beat Tick data.

Fields

bar: usize

Time signature bar, 1 or more.

beat: usize

Time signature beat, 1 <= beat <= sig_num.

tick: usize

current tick-within-beat

Remarks

  • Should be >= 0 and < ticks_per_beat: the first tick is tick 0.
sig_num: f32

Time Signature “numerator”. Jack calls this beats_per_bar.

sig_denom: f32

Time Signature “denominator”. Jack calls this beat_type.

ticks_per_beat: f64

Number of ticks within a beat.

Remarks

  • Usually a moderately large integer with many denominators, such as 1920.0
bpm: f64

BPM, quantized to block size. This means when the tempo is not constant within this block, the BPM value should adapted to compensate for this. This is different from most fields in this struct, which specify the value at the beginning of the block rather than an average.

bar_start_tick: f64

Number of ticks that have elapsed between frame 0 and the first beat of the current measure.

Implementations

impl TransportBBT[src]

pub fn with_bbt<'a>(
    &'a mut self,
    bar: usize,
    beat: usize,
    tick: usize
) -> &'a mut Self
[src]

Set bar, beat, tick

Example

use jack::TransportBBT;
let bbt = TransportBBT::default().with_bbt(4, 2, 14).validated();
assert!(bbt.is_ok());
let bbt = bbt.unwrap();
assert_eq!(bbt.bar, 4);
assert_eq!(bbt.beat, 2);
assert_eq!(bbt.tick, 14);

pub fn with_bpm<'a>(&'a mut self, bpm: f64) -> &'a mut Self[src]

Set Beats Per Minute.

pub fn with_timesig<'a>(&'a mut self, num: f32, denom: f32) -> &'a mut Self[src]

Set the time signature.

pub fn with_ticks_per_beat<'a>(
    &'a mut self,
    ticks_per_beat: f64
) -> &'a mut Self
[src]

Set ticks per beat.

pub fn with_bar_start_tick<'a>(&'a mut self, tick: f64) -> &'a mut Self[src]

Set bar start tick.

pub fn validated<'a>(&'a self) -> Result<Self, TransportBBTValidationError>[src]

Validate contents.

pub fn valid(&self) -> bool[src]

Trait Implementations

impl Clone for TransportBBT[src]

impl Copy for TransportBBT[src]

impl Debug for TransportBBT[src]

impl Default for TransportBBT[src]

impl PartialEq<TransportBBT> for TransportBBT[src]

impl StructuralPartialEq for TransportBBT[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.