Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin<S: Sample>: PluginCore {
    // Required method
    fn process(
        &mut self,
        buffer: &mut AudioBuffer<'_, S>,
        events: &EventList,
        context: &mut ProcessContext<'_>,
    ) -> Result<ProcessStatus>;
}
Expand description

Sample-precision-typed leaf trait. Pairs PluginCore with the process callback at a specific sample type.

Most format wrappers implement Plugin<f32>; ones that support host-chosen 64-bit (VST3, AU v2/v3, AAX) implement both Plugin<f32> and Plugin<f64> on the same instance type or on a precision-specialised wrapper.

Required Methods§

Source

fn process( &mut self, buffer: &mut AudioBuffer<'_, S>, events: &EventList, context: &mut ProcessContext<'_>, ) -> Result<ProcessStatus>

Process one audio block.

§Real-time-safety contract

This callback runs on the host’s audio thread. The wrapper guarantees no allocator-touching work inside this crate on the call edge; the plugin code itself is expected to honor the same: no Box::new, no Vec::push past pre-grown capacity, no mutex locking, no I/O, no panic!. A panic is caught by the wrapper (see crate::wrapper::run_audio_block_with) and turned into ProcessStatus::Error but the host’s block is still lost.

§Errors

Returns crate::Error::NotActivated when the plugin hasn’t been activated; wrapper-specific errors otherwise.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§