#[non_exhaustive]pub struct AudioConfig {
pub sample_rate: f64,
pub max_block_size: usize,
pub sample_format: SampleFormat,
pub mode: ProcessMode,
pub configuration: Option<u64>,
pub inputs: Vec<AudioBusConfig>,
pub outputs: Vec<AudioBusConfig>,
pub events: EventConfig,
}Expand description
Requested native buses. Buses omitted from a direction are inactive. Native layout/precision negotiation follows validation; successful preparation returns the complete negotiated map.
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.sample_rate: f64Samples per second; must be finite and greater than zero.
max_block_size: usizeMaximum frames per processing call, from 1 through i32::MAX.
sample_format: SampleFormatSample precision shared by all buses and slots.
mode: ProcessModeProcessing mode reported to the plugin.
configuration: Option<u64>Native named configuration to select, or None to retain the current selection.
inputs: Vec<AudioBusConfig>Requested input buses; omitted buses are inactive.
outputs: Vec<AudioBusConfig>Requested output buses; omitted buses are inactive.
events: EventConfigNative event ports to activate; ports not named are left inactive where the format allows.
Implementations§
Source§impl AudioConfig
impl AudioConfig
Sourcepub fn new(
sample_rate: f64,
max_block_size: usize,
sample_format: SampleFormat,
inputs: Vec<AudioBusConfig>,
outputs: Vec<AudioBusConfig>,
) -> AudioConfig
pub fn new( sample_rate: f64, max_block_size: usize, sample_format: SampleFormat, inputs: Vec<AudioBusConfig>, outputs: Vec<AudioBusConfig>, ) -> AudioConfig
One plugin’s inputs and outputs offline, keeping its current named configuration and
leaving its event ports inactive.
Sourcepub fn with_mode(self, mode: ProcessMode) -> AudioConfig
pub fn with_mode(self, mode: ProcessMode) -> AudioConfig
Reports mode to the plugin.
Sourcepub fn with_configuration(self, configuration: u64) -> AudioConfig
pub fn with_configuration(self, configuration: u64) -> AudioConfig
Selects the native named configuration configuration first.
Sourcepub fn with_events(self, events: EventConfig) -> AudioConfig
pub fn with_events(self, events: EventConfig) -> AudioConfig
Activates the native event ports events names.
Sourcepub fn validate(&self) -> Result<(), InputError>
pub fn validate(&self) -> Result<(), InputError>
Checks scalar processing values, unique bus IDs, layouts, and audio capacity limits.
Sourcepub fn input_channels(&self) -> usize
pub fn input_channels(&self) -> usize
Total active input channels across the requested native buses.
Sourcepub fn output_channels(&self) -> usize
pub fn output_channels(&self) -> usize
Total active output channels across the requested native buses.