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,
}
Expand description

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

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);

Set Beats Per Minute.

Set the time signature.

Set ticks per beat.

Set bar start tick.

Validate contents.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.