pub struct RtControl { /* private fields */ }Expand description
A Send handle for pushing MIDI and parameter changes to a RealtimePluginRunner
without locking. Lives on the control thread; the runner lives on the audio thread.
Implementations§
Source§impl RtControl
impl RtControl
Sourcepub fn send_midi(&mut self, event: MidiEvent) -> bool
pub fn send_midi(&mut self, event: MidiEvent) -> bool
Queue a MIDI event for the next block (at block start). Returns false if the command
queue is full (the event is dropped rather than blocking the caller).
Sourcepub fn send_midi_at(&mut self, event: MidiEvent, sample_offset: i32) -> bool
pub fn send_midi_at(&mut self, event: MidiEvent, sample_offset: i32) -> bool
Queue a MIDI event scheduled at sample_offset samples into the next block, for
sample-accurate sequencing. A negative offset is floored to 0; process() clamps it
into the actual (possibly shorter) block. Returns false if the queue is full.
Sourcepub fn set_parameter(&mut self, id: u32, value: f64) -> bool
pub fn set_parameter(&mut self, id: u32, value: f64) -> bool
Queue a normalized parameter change (0.0..=1.0) for the next block. Returns false
if the queue is full.
Sourcepub fn set_tempo(&mut self, bpm: f64) -> bool
pub fn set_tempo(&mut self, bpm: f64) -> bool
Queue a transport tempo change (BPM) for the next block. bpm must be finite and
greater than 0; an invalid value is rejected (returns false) rather than queued.
Returns false if the queue is full.
Sourcepub fn set_time_signature(&mut self, numerator: i32, denominator: i32) -> bool
pub fn set_time_signature(&mut self, numerator: i32, denominator: i32) -> bool
Queue a transport time-signature change for the next block. denominator must be one
of 1, 2, 4, 8, 16 and numerator must be positive; an invalid value is rejected
(returns false). Returns false if the queue is full.
Sourcepub fn set_playing(&mut self, playing: bool) -> bool
pub fn set_playing(&mut self, playing: bool) -> bool
Queue a transport playing-state toggle for the next block. Returns false if the queue
is full.
Sourcepub fn dropped_command_count(&self) -> u64
pub fn dropped_command_count(&self) -> u64
Total number of commands dropped because the queue was full since this control was created. A persistently rising count means the queue capacity is too small for the control rate.