Skip to main content

HostCommand

Enum HostCommand 

Source
pub enum HostCommand {
Show 58 variants LoadPlugin { path: String, sample_rate: f64, block_size: u32, tempo: f64, time_sig_numerator: i32, time_sig_denominator: i32, class_id: Option<String>, }, UnloadPlugin, CreateGui, CloseGui, StartProcessing, StopProcessing, Reconfigure { sample_rate: f64, block_size: u32, }, SetProcessMode { mode: ProcessMode, }, SetParameter { id: u32, value: f64, }, SetParameterAt { id: u32, value: f64, offset: i32, }, SetTempo { bpm: f64, }, SetTimeSignature { numerator: i32, denominator: i32, }, SetPlaying { playing: bool, }, GetParameter { id: u32, }, GetAllParameters, FormatParameter { id: u32, normalized: f64, }, SendMidi { event: MidiEvent, }, SendMidiAt { event: MidiEvent, sample_offset: i32, }, SendPluginEvent { event: PluginEvent, }, MidiPanic, Process { inputs: Vec<Vec<f32>>, frames: u32, }, ProcessBuses { inputs: Vec<AudioBusBuffer>, outputs: Vec<AudioBusConfig>, frames: u32, }, AudioBusLayout, SaveState, LoadState { data: Vec<u8>, context: StateContext, }, NoteOn { channel: u8, note: u8, velocity: u8, sample_offset: i32, }, NoteOff { note_id: i32, sample_offset: i32, }, SendNoteExpression { note_id: i32, kind: NoteExpressionType, value: f64, sample_offset: i32, }, NoteExpressions { bus: i32, channel: i16, }, SelectProgram { unit_id: i32, program_index: i32, }, SetBusActive { media_type: MediaType, direction: BusDirection, bus_index: i32, active: bool, }, BusArrangements, SetBusArrangements { inputs: Vec<SpeakerArrangement>, outputs: Vec<SpeakerArrangement>, }, GetUnits, GetSelectedUnit, SelectUnit { unit_id: i32, }, ProgramPitchNames { program_list_id: i32, program_index: i32, }, GetProgramData { program_list_id: i32, program_index: i32, }, SetProgramData { program_list_id: i32, program_index: i32, data: Vec<u8>, }, GetUnitData { unit_id: i32, }, SetUnitData { unit_id: i32, data: Vec<u8>, }, BeginHostEdit { parameter_id: u32, }, EndHostEdit { parameter_id: u32, }, SendMidiLearn { bus: i32, channel: i16, controller: u16, }, SetAutomationState { state: AutomationState, }, RemapParameterId { old_plugin_uid: String, old_param_id: u32, }, LatencySamples, TailSamples, MidiCcToParameter { bus: i32, channel: i16, cc: u16, }, TakeParameterEdits, TakeParameterChanges, TakeHostNotifications, TakeDataExchangeBlocks, ExecuteContextMenuItem { menu_id: u64, item_id: u32, }, DismissContextMenu { menu_id: u64, }, TakeRestartFlags, ServiceHostRequests, 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.

§class_id: Option<String>

Specific current or moduleinfo-retired audio class id to instantiate.

§

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.

§

Reconfigure

Re-run the plugin’s setupProcessing at a new sample rate / block size.

Fields

§sample_rate: f64

New sample rate in Hz.

§block_size: u32

New block size in frames.

§

SetProcessMode

Switch the plugin between real-time and offline (kOffline) processing.

Fields

§mode: ProcessMode

Desired process mode.

§

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.

§

SetTempo

Set the transport tempo (BPM) advertised in the plugin’s host ProcessContext, taking effect on the next processed block.

Fields

§bpm: f64

Transport tempo in beats per minute (validated > 0 on the host side).

§

SetTimeSignature

Set the transport time signature advertised in the plugin’s host ProcessContext, taking effect on the next processed block.

Fields

§numerator: i32

Time signature numerator (validated > 0 on the host side).

§denominator: i32

Time signature denominator (validated 1|2|4|8|16 on the host side).

§

SetPlaying

Toggle the transport playing state (kPlaying) in the plugin’s host ProcessContext, taking effect on the next processed block.

Fields

§playing: bool

Whether the transport is playing.

§

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.

§

SendMidiAt

Schedule a MIDI event at a sample offset within the next process block.

Fields

§event: MidiEvent

The event to deliver.

§sample_offset: i32

Sample offset within the next processed block.

§

SendPluginEvent

Send a fully owned VST3 event, including pointer-backed SysEx/text payloads.

Fields

§event: PluginEvent

The event to deliver.

§

MidiPanic

Release all notes currently tracked by the plugin.

§

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]), carried as base64 bit patterns.

§frames: u32

Number of frames in this block.

§

ProcessBuses

Process one block while preserving every VST3 audio bus.

Fields

§inputs: Vec<AudioBusBuffer>

Input buses in bus-index order, including inactive buses.

§outputs: Vec<AudioBusConfig>

Output bus shapes and activation flags.

§frames: u32

Number of frames in this block.

§

AudioBusLayout

Query per-bus channel counts and activation state.

§

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.

§context: StateContext

Where the bytes came from, so the helper’s setState stream carries the same IStreamAttributes an in-process restore would.

Absent on the wire means crate::plugin::StateContext::Project, which is what every release before this field sent — so a new helper reads an old host’s LoadState, and an old helper simply ignores a field it does not know.

§

NoteOn

Start a note (MPE). The helper’s plugin allocates the per-voice note id and returns it in HostResponse::NoteStarted (in isolation the helper owns the real plugin).

Fields

§channel: u8

MIDI channel, 0-based index (MidiChannel::as_index).

§note: u8

Note number (0-127).

§velocity: u8

Velocity (0-127).

§sample_offset: i32

Sample offset within the next processed block.

§

NoteOff

Release a note previously started with HostCommand::NoteOn.

Fields

§note_id: i32

Raw note id returned by NoteOn.

§sample_offset: i32

Sample offset within the next processed block.

§

SendNoteExpression

Send a per-note expression value (normalized 0..1) for a voice. The expression dimension crosses the boundary as the serializable NoteExpressionType enum.

Fields

§note_id: i32

Raw note id returned by NoteOn.

§kind: NoteExpressionType

Which note-expression dimension to set.

§value: f64

Normalized expression value (0..1).

§sample_offset: i32

Sample offset within the next processed block.

§

NoteExpressions

Enumerate the per-note expressions the plugin advertises (INoteExpressionController).

Fields

§bus: i32

Event bus index.

§channel: i16

Channel index.

§

SelectProgram

Select a program in a unit’s program list (IUnitInfo).

Fields

§unit_id: i32

Unit id (the root unit is 0).

§program_index: i32

0-based index into the unit’s program list.

§

SetBusActive

Activate or deactivate a single bus (IComponent::activateBus).

Fields

§media_type: MediaType

Whether the bus carries audio or events.

§direction: BusDirection

Whether the bus is an input or an output.

§bus_index: i32

0-based bus index within its (media_type, direction) group.

§active: bool

true to activate, false to deactivate.

§

BusArrangements

Query each audio bus’s current speaker arrangement (IAudioProcessor::getBusArrangement).

§

SetBusArrangements

Request specific speaker arrangements for the audio buses (re-runs setupProcessing).

Fields

§inputs: Vec<SpeakerArrangement>

Desired arrangement per input bus, in bus-index order.

§outputs: Vec<SpeakerArrangement>

Desired arrangement per output bus, in bus-index order.

§

GetUnits

Enumerate the plugin’s units and their program lists (IUnitInfo).

§

GetSelectedUnit

Query the currently selected unit.

§

SelectUnit

Select a unit.

Fields

§unit_id: i32

Unit id.

§

ProgramPitchNames

Query pitch names for a program.

Fields

§program_list_id: i32

Program-list id.

§program_index: i32

Program index.

§

GetProgramData

Read opaque data for a program.

Fields

§program_list_id: i32

Program-list id.

§program_index: i32

Program index.

§

SetProgramData

Restore opaque data for a program.

Fields

§program_list_id: i32

Program-list id.

§program_index: i32

Program index.

§data: Vec<u8>

Opaque plugin data.

§

GetUnitData

Read opaque data for a unit.

Fields

§unit_id: i32

Unit id.

§

SetUnitData

Restore opaque data for a unit.

Fields

§unit_id: i32

Unit id.

§data: Vec<u8>

Opaque plugin data.

§

BeginHostEdit

Begin a host-edit session.

Fields

§parameter_id: u32

Parameter id.

§

EndHostEdit

End a host-edit session.

Fields

§parameter_id: u32

Parameter id.

§

SendMidiLearn

Forward live MIDI controller input to IMidiLearn.

Fields

§bus: i32

Event bus.

§channel: i16

MIDI channel.

§controller: u16

MIDI controller number.

§

SetAutomationState

Report the current automation state.

Fields

§state: AutomationState

Automation state.

§

RemapParameterId

Map a parameter id from a plugin class this controller replaces (IRemapParamID).

Fields

§old_plugin_uid: String

Canonical separator-free 32-hex-character VST3 class id.

§old_param_id: u32

Parameter id used by the replaced plugin class.

§

LatencySamples

Query the plugin’s reported processing latency in samples (IAudioProcessor::getLatencySamples).

§

TailSamples

Query the plugin’s reported tail length in samples (IAudioProcessor::getTailSamples).

§

MidiCcToParameter

Resolve a MIDI controller to the parameter it’s mapped to (IMidiMapping).

Fields

§bus: i32

Event input bus index.

§channel: i16

0-based MIDI channel.

§cc: u16

MIDI controller number (0-127, or a VST3 special such as aftertouch/pitch-bend).

§

TakeParameterEdits

Drain the ordered parameter-edit gesture log (begin/change/end) the helper’s plugin has accumulated from its editor since the last poll.

§

TakeParameterChanges

Drain processor- and controller-originated parameter value feedback.

§

TakeHostNotifications

Drain ordered IComponentHandler2 requests from the helper.

§

TakeDataExchangeBlocks

Dispatch and drain owned VST3 data-exchange blocks from the helper.

§

ExecuteContextMenuItem

Execute an item from a pending plugin-provided context menu.

Fields

§menu_id: u64

Host-assigned popup id.

§item_id: u32

Host-assigned item id within the popup.

§

DismissContextMenu

Dismiss a pending plugin-provided context menu.

Fields

§menu_id: u64

Host-assigned popup id.

§

TakeRestartFlags

Drain accumulated restartComponent flags without applying lifecycle changes.

§

ServiceHostRequests

Drain restart flags and apply required lifecycle changes in the helper.

§

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.