Struct nih_plug::audio_setup::AudioIOLayout
source · pub struct AudioIOLayout {
pub main_input_channels: Option<NonZeroU32>,
pub main_output_channels: Option<NonZeroU32>,
pub aux_input_ports: &'static [NonZeroU32],
pub aux_output_ports: &'static [NonZeroU32],
pub names: PortNames,
}
Expand description
A description of a plugin’s audio IO configuration. The Plugin
defines a list of supported audio IO configs, with the first one acting as the default layout.
Depending on the plugin API, the host may pick a different configuration from the list and use
that instead. The final chosen configuration is passed as an argument to the
Plugin::initialize()
function so the plugin can allocate
its data structures based on the number of audio channels it needs to process.
Fields§
§main_input_channels: Option<NonZeroU32>
The number of main input channels for the plugin, if it has a main input port. This can be
set to None
if the plugin does not have one.
main_output_channels: Option<NonZeroU32>
The number of main output channels for the plugin, if it has a main output port. This can be
set to None
if the plugin does not have one.
aux_input_ports: &'static [NonZeroU32]
The plugin’s additional sidechain inputs, if it has any. Use the new_nonzero_u32()
function to construct these values until const Option::unwrap()
gets stabilized
(https://github.com/rust-lang/rust/issues/67441).
aux_output_ports: &'static [NonZeroU32]
The plugin’s additional outputs, if it has any. Use the new_nonzero_u32()
function to
construct these values until const Option::unwrap()
gets stabilized
(https://github.com/rust-lang/rust/issues/67441).
names: PortNames
Optional names for the audio ports. Defining these can be useful for plugins with multiple output and input ports.
Implementations§
source§impl AudioIOLayout
impl AudioIOLayout
sourcepub const fn const_default() -> Self
pub const fn const_default() -> Self
AudioIOLayout::default()
, but as a const function. Used when initializing
Plugin::AUDIO_IO_LAYOUTS
. (https://github.com/rust-lang/rust/issues/67792)
sourcepub fn name(&self) -> String
pub fn name(&self) -> String
A descriptive name for the layout. This is taken from PortNames::layout
if set. Otherwise
it is generated based on the layout.
sourcepub fn main_input_name(&self) -> String
pub fn main_input_name(&self) -> String
The name for the main input port. Either generated or taken from the names
field.
sourcepub fn main_output_name(&self) -> String
pub fn main_output_name(&self) -> String
The name for the main output port. Either generated or taken from the names
field.
sourcepub fn aux_input_name(&self, idx: usize) -> Option<String>
pub fn aux_input_name(&self, idx: usize) -> Option<String>
The name for the auxiliary input port with the given index. Either generated or taken from
the names
field.
sourcepub fn aux_output_name(&self, idx: usize) -> Option<String>
pub fn aux_output_name(&self, idx: usize) -> Option<String>
The name for the auxiliary output port with the given index. Either generated or taken from
the names
field.
Trait Implementations§
source§impl Clone for AudioIOLayout
impl Clone for AudioIOLayout
source§fn clone(&self) -> AudioIOLayout
fn clone(&self) -> AudioIOLayout
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AudioIOLayout
impl Debug for AudioIOLayout
source§impl Default for AudioIOLayout
impl Default for AudioIOLayout
source§fn default() -> AudioIOLayout
fn default() -> AudioIOLayout
source§impl Hash for AudioIOLayout
impl Hash for AudioIOLayout
source§impl PartialEq<AudioIOLayout> for AudioIOLayout
impl PartialEq<AudioIOLayout> for AudioIOLayout
source§fn eq(&self, other: &AudioIOLayout) -> bool
fn eq(&self, other: &AudioIOLayout) -> bool
self
and other
values to be equal, and is used
by ==
.