Skip to main content

RtControl

Struct RtControl 

Source
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

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.