Skip to main content

PluginSetup

Trait PluginSetup 

Source
pub trait PluginSetup:
    Clone
    + Send
    + 'static {
    // Required method
    fn extract(host: &HostSetup) -> Self;
}
Expand description

Trait for plugin setup requirements.

Plugins declare what host information they need via Descriptor::Setup. The framework extracts only the requested data from the host.

§Composable Setup Types

Request exactly what you need using individual types or tuples:

type Setup = ();                                  // No setup needed
type Setup = SampleRate;                          // Just sample rate
type Setup = (SampleRate, MaxBufferSize);         // Sample rate + buffer size
type Setup = (SampleRate, MainOutputChannels);    // Sample rate + channels

§Available Types

TypeValueUse Case
()-Stateless plugins (gain, pan)
SampleRatef64Time-based DSP (delay, filter, envelope)
MaxBufferSizeusizeFFT, lookahead buffers
MainInputChannelsu32Per-channel input processing
MainOutputChannelsu32Per-channel output state
AuxInputCountusizeSidechain-aware processing
AuxOutputCountusizeMulti-bus output
ProcessModeenumQuality settings for offline rendering

Required Methods§

Source

fn extract(host: &HostSetup) -> Self

Extract this setup from the host-provided information.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PluginSetup for ()

Use () for stateless plugins that don’t depend on sample rate.

§Example

impl Descriptor for GainPlugin {
    type Setup = ();
    fn prepare(self, _: ()) -> GainProcessor {
        GainProcessor { parameters: self.parameters }
    }
}
Source§

fn extract(_: &HostSetup) -> Self

Source§

impl<A, B> PluginSetup for (A, B)
where A: PluginSetup, B: PluginSetup,

Source§

fn extract(host: &HostSetup) -> Self

Source§

impl<A, B, C> PluginSetup for (A, B, C)

Source§

fn extract(host: &HostSetup) -> Self

Source§

impl<A, B, C, D> PluginSetup for (A, B, C, D)

Source§

fn extract(host: &HostSetup) -> Self

Source§

impl<A, B, C, D, E> PluginSetup for (A, B, C, D, E)

Source§

fn extract(host: &HostSetup) -> Self

Implementors§