AUDIO
Source snapshot · 11 November 2026

API reference / ravet_clap::MultiBusBridge

Struct MultiBusBridge 

pub struct MultiBusBridge<P, S: ClapSample = f32> { /* private fields */ }
Expand description

Native f32/f64 main bus plus up to eight ordered auxiliary buses. Native input and output port numbering each starts at zero, visits the main bus then auxiliaries in declaration order, and skips buses with zero channels in that direction. Exporters must advertise this same mapping and precision. All input samples are copied before any output write, preserving cross-bus host aliases. Both-precision buffers reject; there is no conversion.

Preparation bounds frames to 65,536, each input/output event capacity to 1,024 and combined audio/event scratch to 64 MiB. It allocates; processing, parameter-only flush and reset avoid heap operations, locks and I/O. Invalid host input rejects before DSP progression and silences every output port. Processor faults may follow internal progression; output event delivery has the same prefix/refusal contract as crate::MainBusBridge. No exporter or DAW auxiliary-bus compatibility is implied by constructing this adapter.

Implementations§

§

impl<P: Processor<S>, S: ClapSample> MultiBusBridge<P, S>

pub fn prepare( processor: P, config: ProcessConfig, midi_port: Option<u16>, output_midi_port: Option<u16>, ) -> Result<Self, BridgeError>

Prepare the complete portable configuration. MIDI ports are selected independently of audio ports; absent input maps only global parameters.

pub fn with_clap_note_input_port( self, port: Option<u16>, ) -> Result<Self, BridgeError>

Select explicit native CLAP note/expression input (0..256), independent of raw MIDI/UMP selection. Requires exporter-advertised processor support; no voice behavior/metadata is inferred. None restores default filtering.

pub fn with_note_end_output_port( self, port: Option<u16>, ) -> Result<Self, BridgeError>

Select the originating note INPUT endpoint for generated completion notifications (0..256), independently of performance output and scoped parameters. Native timestamp/velocity carry no termination semantics. IDs must fit nonnegative i32; missing routes reject whole delivery. Flush rejects completion output. No voice tracking or metadata is inferred.

pub fn with_clap_note_output_port( self, port: Option<u16>, ) -> Result<Self, BridgeError>

Select native CLAP generated On/Off, identified notes and expressions (0..256). Legacy notes retain unquantized f32 velocity; IDs must fit i32. Raw MIDI/UMP still use their independently selected port. Whole delivery preflight prevents identity/scope loss. Native performance in parameter flush is unrepresentable; audio/DSP already progressed before delivery.

pub fn with_scoped_parameter_input_port( self, port: Option<u16>, ) -> Result<Self, BridgeError>

Select scoped physical values/modulation on a note input endpoint below 256. Independent of note translation and global modulation; no metadata, parameter range/state/voice behavior is inferred. None restores filtering.

pub fn with_scoped_parameter_output_port( self, port: Option<u16>, ) -> Result<Self, BridgeError>

Select the originating note input endpoint for generated scoped physical parameter values/modulation (0..256), including zero-time parameter flush. This index is independent of note output and raw MIDI/UMP selectors. Full finite f64 values/scope are retained; native IDs must fit nonnegative i32.

pub fn with_parameter_gesture_input(self, enabled: bool) -> Self

Enable raw parameter begin/end input; no automatic pairing/state edits.

pub fn with_global_parameter_modulation(self, enabled: bool) -> Self

Opt in to global parameter modulation input without changing metadata or saved values. The processor must explicitly implement modulation semantics; scoped events require their separate selector. Default is disabled, including flush.

pub fn processor(&self) -> &P

pub fn reset(&mut self)

pub fn try_reset(&mut self) -> Result<(), ProcessError>

Preserve refused history reset and stop subsequent DSP dispatch.

pub fn reset_error(&self) -> Option<ProcessError>

Original refused reset, until a complete successful reset.

pub fn deactivate(&mut self)

pub fn flush( &mut self, input: &InputEvents<'_>, output: &mut OutputEvents<'_>, ) -> Result<BridgeReport, BridgeError>

Apply global parameter events at zero time across all prepared buses.

pub fn process( &mut self, audio: &mut Audio<'_>, events: &InputEvents<'_>, transport: Option<&TransportEvent>, output: &mut OutputEvents<'_>, ) -> Result<BridgeReport, BridgeError>

Process the whole native block; a rejected block silences all native outputs.

Auto Trait Implementations§

§

impl<P, S> Freeze for MultiBusBridge<P, S>
where P: Freeze,

§

impl<P, S> RefUnwindSafe for MultiBusBridge<P, S>

§

impl<P, S> Send for MultiBusBridge<P, S>
where P: Send, S: Send,

§

impl<P, S> Sync for MultiBusBridge<P, S>
where P: Sync, S: Sync,

§

impl<P, S> Unpin for MultiBusBridge<P, S>
where P: Unpin, S: Unpin,

§

impl<P, S> UnsafeUnpin for MultiBusBridge<P, S>
where P: UnsafeUnpin,

§

impl<P, S> UnwindSafe for MultiBusBridge<P, S>
where P: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.