Skip to main content

PurePluginLogic64

Trait PurePluginLogic64 

Source
pub trait PurePluginLogic64: 'static {
    type Params: Params;

    // Required methods
    fn process(
        params: &Self::Params,
        buffer: &mut AudioBuffer<'_, f64>,
        events: &EventList,
        context: &mut ProcessContext<'_>,
    ) -> ProcessStatus;
    fn editor(params: Arc<Self::Params>) -> Box<dyn Editor>;

    // Provided methods
    fn supports_in_place() -> bool { ... }
    fn bus_layouts() -> Vec<BusLayout> { ... }
    fn migrate_state(foreign: &ForeignState<'_>) -> Option<MigratedState> { ... }
}
Expand description

The stateless f64 plugin trait. Same surface as PurePluginLogic but with the audio buffer pinned to f64; blanket-implements PluginLogic64. truce::prelude64 re-exports it as PurePluginLogic, so the impl header reads the same regardless of precision.

Required Associated Types§

Source

type Params: Params

The plugin’s parameter struct (#[derive(Params)]). Shared, immutable during a block - it arrives by reference every call from the shell, which owns the Arc.

Required Methods§

Source

fn process( params: &Self::Params, buffer: &mut AudioBuffer<'_, f64>, events: &EventList, context: &mut ProcessContext<'_>, ) -> ProcessStatus

Process one block of audio as a pure function of params and input. Same real-time contract as the stateful leaf’s process, minus the state argument.

Source

fn editor(params: Arc<Self::Params>) -> Box<dyn Editor>

Construct the editor for this plugin. Required. Same contract as the stateful leaf’s editor.

Provided Methods§

Source

fn supports_in_place() -> bool

Opt into zero-copy in-place I/O. Same contract as the stateful leaf’s supports_in_place.

Source

fn bus_layouts() -> Vec<BusLayout>

Supported audio bus configurations. Same contract as the stateful leaf’s bus_layouts. Default: stereo in, stereo out.

Source

fn migrate_state(foreign: &ForeignState<'_>) -> Option<MigratedState>

Translate foreign state into truce shape. Same contract as the stateful leaf’s migrate_state - a stateless plugin may still inherit params from a previous framework’s blob.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§