Skip to main content

Plugin

Trait Plugin 

Source
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§

Source

fn id(&self) -> &'static str

The stable id, for example "weirdnet.gain". Saved in projects, so it never changes.

Source

fn params(&self) -> &[ParamSpec]

The parameters this plugin takes.

Source

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§

Source

fn version(&self) -> u32

A version that changes whenever the output for the same input and values would change. It is part of the cache key.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§