pub trait PluginInstance: Send {
// Required methods
fn descriptor(&self) -> &PluginDescriptor;
fn prepare(&mut self, cfg: PrepareConfig);
fn reset(&mut self);
fn process(&mut self, block: &mut ProcessBlock<'_>);
// Provided methods
fn state(&self) -> PluginState { ... }
fn set_state(&mut self, _state: PluginState) { ... }
fn latency_frames(&self) -> u32 { ... }
}Expand description
A live, format-agnostic plugin instance the host can prepare and run.
Implementors are the format-specific backends (vst3/clap/lv2 and the native
sim format). The trait pairs a static PluginDescriptor with the
mutable, real-time processing entry points shared by every backend and is
Send so instances can move between threads.
Required Methods§
Sourcefn descriptor(&self) -> &PluginDescriptor
fn descriptor(&self) -> &PluginDescriptor
Returns the descriptor that identifies this instance and its port and parameter layout.
Sourcefn prepare(&mut self, cfg: PrepareConfig)
fn prepare(&mut self, cfg: PrepareConfig)
Prepares the instance for processing under the given configuration.
Sourcefn process(&mut self, block: &mut ProcessBlock<'_>)
fn process(&mut self, block: &mut ProcessBlock<'_>)
Processes one audio block in place.
Provided Methods§
Sourcefn state(&self) -> PluginState
fn state(&self) -> PluginState
Captures the instance’s current persistable state.
The default returns an empty PluginState; backends that carry
parameter or opaque data override this.
Sourcefn set_state(&mut self, _state: PluginState)
fn set_state(&mut self, _state: PluginState)
Restores the instance from a previously captured PluginState.
The default ignores the state; stateful backends override this.
Sourcefn latency_frames(&self) -> u32
fn latency_frames(&self) -> u32
Returns the instance’s reported latency in frames.
The default reports the descriptor’s PluginDescriptor::latency_frames.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".