pub struct Transport {
pub playing: bool,
pub recording: bool,
pub preroll_active: Option<bool>,
pub sample_rate: f32,
pub tempo: Option<f64>,
pub time_sig_numerator: Option<i32>,
pub time_sig_denominator: Option<i32>,
/* private fields */
}
Expand description
Information about the plugin’s transport. Depending on the plugin API and the host not all fields may be available.
Fields§
§playing: bool
Whether the transport is currently running.
recording: bool
Whether recording is enabled in the project.
preroll_active: Option<bool>
Whether the pre-roll is currently active, if the plugin API reports this information.
sample_rate: f32
The sample rate in Hertz. Also passed in
Plugin::initialize()
, so if you need this then you
can also store that value.
tempo: Option<f64>
The project’s tempo in beats per minute.
time_sig_numerator: Option<i32>
The time signature’s numerator.
time_sig_denominator: Option<i32>
The time signature’s denominator.
Implementations§
source§impl Transport
impl Transport
sourcepub fn pos_samples(&self) -> Option<i64>
pub fn pos_samples(&self) -> Option<i64>
The position in the song in samples. Will be calculated from other information if needed.
sourcepub fn pos_seconds(&self) -> Option<f64>
pub fn pos_seconds(&self) -> Option<f64>
The position in the song in seconds. Can be used to calculate the time in samples if needed.
sourcepub fn pos_beats(&self) -> Option<f64>
pub fn pos_beats(&self) -> Option<f64>
The position in the song in quarter notes. Will be calculated from other information if needed.
sourcepub fn bar_start_pos_beats(&self) -> Option<f64>
pub fn bar_start_pos_beats(&self) -> Option<f64>
The last bar’s start position in beats. Will be calculated from other information if needed.
sourcepub fn bar_number(&self) -> Option<i32>
pub fn bar_number(&self) -> Option<i32>
The number of the bar at bar_start_pos_beats
. This starts at 0 for the very first bar at
the start of the song. Will be calculated from other information if needed.
sourcepub fn loop_range_samples(&self) -> Option<(i64, i64)>
pub fn loop_range_samples(&self) -> Option<(i64, i64)>
The loop range in samples, if the loop is active and this information is available. None of the plugin API docs mention whether this is exclusive or inclusive, but just assume that the end is exclusive. Will be calculated from other information if needed.
sourcepub fn loop_range_seconds(&self) -> Option<(f64, f64)>
pub fn loop_range_seconds(&self) -> Option<(f64, f64)>
The loop range in seconds, if the loop is active and this information is available. None of the plugin API docs mention whether this is exclusive or inclusive, but just assume that the end is exclusive. Will be calculated from other information if needed.
sourcepub fn loop_range_beats(&self) -> Option<(f64, f64)>
pub fn loop_range_beats(&self) -> Option<(f64, f64)>
The loop range in quarter notes, if the loop is active and this information is available. None of the plugin API docs mention whether this is exclusive or inclusive, but just assume that the end is exclusive. Will be calculated from other information if needed.