Skip to main content

HostCommand

Enum HostCommand 

Source
pub enum HostCommand {
Show 16 variants LoadPlugin { path: String, sample_rate: f64, block_size: u32, tempo: f64, time_sig_numerator: i32, time_sig_denominator: i32, }, UnloadPlugin, CreateGui, CloseGui, StartProcessing, StopProcessing, SetParameter { id: u32, value: f64, }, SetParameterAt { id: u32, value: f64, offset: i32, }, GetParameter { id: u32, }, GetAllParameters, FormatParameter { id: u32, normalized: f64, }, SendMidi { event: MidiEvent, }, Process { inputs: Vec<Vec<f32>>, frames: u32, }, SaveState, LoadState { data: Vec<u8>, }, Shutdown,
}
Expand description

Commands that can be sent to the isolated plugin process.

This enum is the single source of truth for the isolation IPC protocol — the helper binary imports it from here rather than redefining it, so the two halves can never drift apart.

Variants§

§

LoadPlugin

Load a plugin from the specified path, configured for the given audio settings.

Fields

§path: String

Path to the .vst3 bundle.

§sample_rate: f64

Sample rate to configure the plugin for.

§block_size: u32

Block size to configure the plugin for.

§tempo: f64

Transport tempo (BPM) to advertise in the plugin’s host ProcessContext.

§time_sig_numerator: i32

Time signature numerator to advertise in the host ProcessContext.

§time_sig_denominator: i32

Time signature denominator to advertise in the host ProcessContext.

§

UnloadPlugin

Unload the current plugin

§

CreateGui

Create plugin GUI

§

CloseGui

Close plugin GUI

§

StartProcessing

Start the plugin’s audio processing.

§

StopProcessing

Stop the plugin’s audio processing.

§

SetParameter

Set a parameter (normalized 0.0..=1.0).

Fields

§id: u32

Parameter id.

§value: f64

Normalized value.

§

SetParameterAt

Schedule a parameter change at a sample offset within the next process block.

Fields

§id: u32

Parameter id.

§value: f64

Normalized value.

§offset: i32

Sample offset within the next processed block.

§

GetParameter

Read a parameter’s current normalized value.

Fields

§id: u32

Parameter id.

§

GetAllParameters

Read all parameters.

§

FormatParameter

Ask the plugin to format a normalized value as a display string.

Fields

§id: u32

Parameter id.

§normalized: f64

Normalized value to format.

§

SendMidi

Send a MIDI event to the plugin.

Fields

§event: MidiEvent

The event to deliver.

§

Process

Process one block of audio. inputs is per-channel; frames is the block length.

Fields

§inputs: Vec<Vec<f32>>

Per-channel input samples ([channel][frame]).

§frames: u32

Number of frames in this block.

§

SaveState

Serialize the plugin’s current state to an opaque byte blob.

§

LoadState

Restore the plugin’s state from a blob previously returned by SaveState.

Fields

§data: Vec<u8>

The opaque state bytes.

§

Shutdown

Shutdown the helper process

Trait Implementations§

Source§

impl Clone for HostCommand

Source§

fn clone(&self) -> HostCommand

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HostCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for HostCommand

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for HostCommand

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.