#[non_exhaustive]pub struct BusLayout {
pub inputs: Vec<BusConfig>,
pub outputs: Vec<BusConfig>,
}Expand description
Describes the audio bus configuration of a plugin.
By convention, the first input bus is the main audio in
(effects + analyzers) and any subsequent input buses are sidechain
inputs. The first output bus is the main audio out. Format
wrappers (CLAP / VST3 / AU / AAX / LV2) rely on this ordering when
they translate into format-specific main/aux bus designations, and
BusConfig::kind lets call-sites that need it ask the bus
directly rather than re-deriving the convention.
Construct via Self::new / Self::mono / Self::stereo + the with_*
builders rather than struct literal - #[non_exhaustive] so
pre-1.0 future fields don’t break downstream.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.inputs: Vec<BusConfig>§outputs: Vec<BusConfig>Implementations§
Source§impl BusLayout
impl BusLayout
pub fn new() -> Self
pub fn mono() -> Self
pub fn stereo() -> Self
Sourcepub fn stereo_and_mono() -> Vec<Self>
pub fn stereo_and_mono() -> Vec<Self>
The default audio-effect layout set: stereo and mono (stereo
first, so it’s the default width). Return this from bus_layouts()
for an ordinary in/out effect and the host offers it on both stereo
and mono tracks, instead of a stereo-only effect that’s hidden on
mono ones. The effect’s process must handle either width - loop
over buffer.channels() rather than assuming two.
Sourcepub fn stereo_and_mono_output() -> Vec<Self>
pub fn stereo_and_mono_output() -> Vec<Self>
The output-only counterpart of Self::stereo_and_mono: stereo and
mono output buses with no input, for an instrument that produces
audio from MIDI. Offered on both stereo and mono tracks. The
instrument’s process must handle either output width - guard any
write past the first channel with buffer.num_output_channels().
Sourcepub fn with_input(self, name: &'static str, channels: ChannelConfig) -> Self
pub fn with_input(self, name: &'static str, channels: ChannelConfig) -> Self
Append a main audio input bus. First call → main audio in;
subsequent calls → sidechain inputs (use Self::with_sidechain_input
if you prefer to be explicit).
Sourcepub fn with_sidechain_input(
self,
name: &'static str,
channels: ChannelConfig,
) -> Self
pub fn with_sidechain_input( self, name: &'static str, channels: ChannelConfig, ) -> Self
Append a sidechain input bus. Equivalent to Self::with_input
after the first input has already been added, but lets call
sites express intent.
pub fn with_output(self, name: &'static str, channels: ChannelConfig) -> Self
Sourcepub fn sidechain_input_indices(&self) -> impl Iterator<Item = usize> + '_
pub fn sidechain_input_indices(&self) -> impl Iterator<Item = usize> + '_
Return the indices of all sidechain input buses.