pub trait Plugin: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn params(&self) -> &[ParamSpec];
fn process(
&self,
input: &Waveform,
values: &ParamValues,
) -> Result<Waveform, PluginError>;
// Provided method
fn version(&self) -> u32 { ... }
}Expand description
An audio effect. Implementations are pure: the same input and values give the same output, which is what lets results be cached.
Required Methods§
Sourcefn id(&self) -> &'static str
fn id(&self) -> &'static str
The stable id, for example "weirdnet.gain". Saved in projects, so it never changes.
Sourcefn process(
&self,
input: &Waveform,
values: &ParamValues,
) -> Result<Waveform, PluginError>
fn process( &self, input: &Waveform, values: &ParamValues, ) -> Result<Waveform, PluginError>
Processes input. values are already resolved against Plugin::params: complete, typed and in range.
Returns a new waveform (which may share the input’s samples when nothing changed) or an error.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".