Skip to main content

default_io_channels

Function default_io_channels 

Source
pub fn default_io_channels<P: PluginExport>() -> Option<(u32, u32)>
Expand description

(input_channels, output_channels) for the plugin’s default bus layout, or None when the plugin declares no layouts. Used by every format’s vtable / descriptor to advertise channel counts at registration time.

Note for aumi (MIDI processor) plugins: the convention is bus_layouts: [BusLayout::new()], which has zero input and zero output channels. This helper returns Some((0, 0)) for that case, which is correct for AU (the AU shim’s channelCapabilities returns [0, 0] and the host treats the plugin as MIDI-only) but wrong for AAX, which requires every plugin to advertise at least stereo audio I/O. AAX maps (0, 0) to (2, 2) (synthesizing a stereo passthrough) after this helper returns. Don’t push that remap into this helper; only AAX needs it.

None indicates a plugin-author bug: zero-bus plugins must return vec![BusLayout::new()] explicitly. Callers should log a diagnostic and skip registration (see how each register_* entry point handles this) rather than substitute a silent default that would misreport channel counts to the host.