Crate bbx_plugin

Crate bbx_plugin 

Source
Expand description

§BBX Plugin

Plugin integration crate for the bbx_audio DSP library with C FFI bindings.

This crate re-exports the bbx_dsp crate and provides a macro-based API for generating C-compatible FFI functions from any PluginDsp implementation. Consumers only need to add bbx_plugin as a dependency to access both DSP functionality and FFI generation.

§Example

use bbx_plugin::{PluginDsp, DspContext, bbx_plugin_ffi};

pub struct PluginGraph { /* DSP blocks */ }

impl PluginDsp for PluginGraph {
    fn new() -> Self { /* ... */ }
    fn prepare(&mut self, context: &DspContext) { /* ... */ }
    fn reset(&mut self) { /* ... */ }
    fn apply_parameters(&mut self, params: &[f32]) { /* ... */ }
    fn process(&mut self, inputs: &[&[f32]], outputs: &mut [&mut [f32]], midi_events: &[MidiEvent], context: &DspContext) { /* ... */ }
}

impl Default for PluginGraph {
    fn default() -> Self { Self::new() }
}

// Generate all FFI exports
bbx_plugin_ffi!(PluginGraph);

Re-exports§

pub use params::JsonParamDef;
pub use params::ParamDef;
pub use params::ParamType;
pub use params::ParamsFile;
pub use params::generate_c_header_from_defs;
pub use params::generate_rust_indices_from_defs;

Modules§

core
dsp
midi
params
Parameter definition and code generation utilities.

Macros§

bbx_plugin_ffi
Generate C FFI exports for a PluginDsp implementation.

Structs§

BbxGraph
Opaque handle representing a DSP effects chain.
DspContext
Runtime context passed to blocks during audio processing.
GraphInner
Internal wrapper holding the plugin DSP and context.

Enums§

BbxError
Error codes for bbx_audio operations.

Traits§

PluginDsp
Trait for plugin-specific DSP implementations.

Functions§

graph_from_handle
Convert a raw pointer to a GraphInner reference.
handle_from_graph
Convert a GraphInner to an opaque handle.
process_audio
Process a block of audio through the effects chain.