Struct Multi BusBridge
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>
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>
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>
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>
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>
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>
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>
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
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
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>
pub fn try_reset(&mut self) -> Result<(), ProcessError>
Preserve refused history reset and stop subsequent DSP dispatch.
pub fn reset_error(&self) -> Option<ProcessError>
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>
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>
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.