From 1a706ea1c7c4b0d27685d46c81c9345cf7242f8d Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 19 Aug 2022 14:34:21 +0200 Subject: [PATCH] Rename DEFAULT_NUM_INPUTS and DEFAULT_NUM_OUTPUTS --- BREAKING_CHANGES.md | 7 +++++ plugins/crisp/src/lib.rs | 4 +-- plugins/crossover/src/lib.rs | 4 +-- plugins/diopser/src/lib.rs | 6 ++-- plugins/examples/gain/src/lib.rs | 4 +-- plugins/examples/gain_gui_egui/src/lib.rs | 4 +-- plugins/examples/gain_gui_iced/src/lib.rs | 4 +-- plugins/examples/gain_gui_vizia/src/lib.rs | 4 +-- plugins/examples/midi_inverter/src/lib.rs | 4 +-- plugins/examples/poly_mod_synth/src/lib.rs | 4 +-- plugins/examples/sine/src/lib.rs | 4 +-- plugins/examples/stft/src/lib.rs | 4 +-- plugins/loudness_war_winner/src/lib.rs | 4 +-- plugins/puberty_simulator/src/lib.rs | 4 +-- plugins/safety_limiter/src/lib.rs | 4 +-- plugins/spectral_compressor/src/lib.rs | 8 ++--- src/plugin.rs | 14 ++++----- src/wrapper/clap/wrapper.rs | 8 ++--- src/wrapper/vst3/inner.rs | 4 +-- src/wrapper/vst3/wrapper.rs | 34 +++++++++++----------- 20 files changed, 70 insertions(+), 63 deletions(-) diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index 7cf80b0f..b417fb1f 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -6,6 +6,13 @@ new and what's changed, this document lists all breaking changes in reverse chronological order. If a new feature did not require any changes to existing code then it will not be listed here. +## [2022-08-19] + +- `Plugin::DEFAULT_NUM_INPUTS` and `Plugin::DEFAULT_NUM_OUTPUTS` have been + renamed to `Plugin::DEFAULT_INPUT_CHANNELS` and + `Plugin::DEFAULT_OUTPUT_CHANNELS` respectively to avoid confusion as these + constants only affect the main input and output. + ## [2022-07-18] - `IntRange` and `FloatRange` no longer have min/max methods and instead have diff --git a/plugins/crisp/src/lib.rs b/plugins/crisp/src/lib.rs index 42ca4ed7..2b6fc95e 100644 --- a/plugins/crisp/src/lib.rs +++ b/plugins/crisp/src/lib.rs @@ -302,8 +302,8 @@ impl Plugin for Crisp { const VERSION: &'static str = "0.1.0"; - const DEFAULT_NUM_INPUTS: u32 = NUM_CHANNELS; - const DEFAULT_NUM_OUTPUTS: u32 = NUM_CHANNELS; + const DEFAULT_INPUT_CHANNELS: u32 = NUM_CHANNELS; + const DEFAULT_OUTPUT_CHANNELS: u32 = NUM_CHANNELS; const SAMPLE_ACCURATE_AUTOMATION: bool = true; diff --git a/plugins/crossover/src/lib.rs b/plugins/crossover/src/lib.rs index 8ebc0519..dce42606 100644 --- a/plugins/crossover/src/lib.rs +++ b/plugins/crossover/src/lib.rs @@ -166,8 +166,8 @@ impl Plugin for Crossover { const VERSION: &'static str = "0.1.0"; - const DEFAULT_NUM_INPUTS: u32 = NUM_CHANNELS; - const DEFAULT_NUM_OUTPUTS: u32 = NUM_CHANNELS; + const DEFAULT_INPUT_CHANNELS: u32 = NUM_CHANNELS; + const DEFAULT_OUTPUT_CHANNELS: u32 = NUM_CHANNELS; const DEFAULT_AUX_OUTPUTS: Option = Some(AuxiliaryIOConfig { // Two to five of these busses will be used at a time diff --git a/plugins/diopser/src/lib.rs b/plugins/diopser/src/lib.rs index 2fea1fd6..0ac653b6 100644 --- a/plugins/diopser/src/lib.rs +++ b/plugins/diopser/src/lib.rs @@ -121,7 +121,7 @@ impl Default for Diopser { // We only do stereo right now so this is simple let (spectrum_input, spectrum_output) = - SpectrumInput::new(Self::DEFAULT_NUM_OUTPUTS as usize); + SpectrumInput::new(Self::DEFAULT_OUTPUT_CHANNELS as usize); Self { params: Arc::new(DiopserParams::new(should_update_filters.clone())), @@ -247,8 +247,8 @@ impl Plugin for Diopser { const VERSION: &'static str = "0.2.0"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; const SAMPLE_ACCURATE_AUTOMATION: bool = true; diff --git a/plugins/examples/gain/src/lib.rs b/plugins/examples/gain/src/lib.rs index de95793e..8a20996a 100644 --- a/plugins/examples/gain/src/lib.rs +++ b/plugins/examples/gain/src/lib.rs @@ -110,8 +110,8 @@ impl Plugin for Gain { const VERSION: &'static str = "0.0.1"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; const DEFAULT_AUX_INPUTS: Option = None; const DEFAULT_AUX_OUTPUTS: Option = None; diff --git a/plugins/examples/gain_gui_egui/src/lib.rs b/plugins/examples/gain_gui_egui/src/lib.rs index de66b453..27062636 100644 --- a/plugins/examples/gain_gui_egui/src/lib.rs +++ b/plugins/examples/gain_gui_egui/src/lib.rs @@ -75,8 +75,8 @@ impl Plugin for Gain { const VERSION: &'static str = "0.0.1"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; const SAMPLE_ACCURATE_AUTOMATION: bool = true; diff --git a/plugins/examples/gain_gui_iced/src/lib.rs b/plugins/examples/gain_gui_iced/src/lib.rs index 23042219..cf717324 100644 --- a/plugins/examples/gain_gui_iced/src/lib.rs +++ b/plugins/examples/gain_gui_iced/src/lib.rs @@ -72,8 +72,8 @@ impl Plugin for Gain { const VERSION: &'static str = "0.0.1"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; const SAMPLE_ACCURATE_AUTOMATION: bool = true; diff --git a/plugins/examples/gain_gui_vizia/src/lib.rs b/plugins/examples/gain_gui_vizia/src/lib.rs index f5f4ae0e..28be4a83 100644 --- a/plugins/examples/gain_gui_vizia/src/lib.rs +++ b/plugins/examples/gain_gui_vizia/src/lib.rs @@ -71,8 +71,8 @@ impl Plugin for Gain { const VERSION: &'static str = "0.0.1"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; const SAMPLE_ACCURATE_AUTOMATION: bool = true; diff --git a/plugins/examples/midi_inverter/src/lib.rs b/plugins/examples/midi_inverter/src/lib.rs index 1e09725e..4bc0733a 100644 --- a/plugins/examples/midi_inverter/src/lib.rs +++ b/plugins/examples/midi_inverter/src/lib.rs @@ -26,8 +26,8 @@ impl Plugin for MidiInverter { const VERSION: &'static str = "0.0.1"; - const DEFAULT_NUM_INPUTS: u32 = 0; - const DEFAULT_NUM_OUTPUTS: u32 = 0; + const DEFAULT_INPUT_CHANNELS: u32 = 0; + const DEFAULT_OUTPUT_CHANNELS: u32 = 0; const MIDI_INPUT: MidiConfig = MidiConfig::MidiCCs; const MIDI_OUTPUT: MidiConfig = MidiConfig::MidiCCs; diff --git a/plugins/examples/poly_mod_synth/src/lib.rs b/plugins/examples/poly_mod_synth/src/lib.rs index 0b230e5e..9e43f2f4 100644 --- a/plugins/examples/poly_mod_synth/src/lib.rs +++ b/plugins/examples/poly_mod_synth/src/lib.rs @@ -148,8 +148,8 @@ impl Plugin for PolyModSynth { const VERSION: &'static str = "0.0.1"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; // We won't need any MIDI CCs here, we just want notes and polyphonic modulation const MIDI_INPUT: MidiConfig = MidiConfig::Basic; diff --git a/plugins/examples/sine/src/lib.rs b/plugins/examples/sine/src/lib.rs index 21ff2833..edf5aabc 100644 --- a/plugins/examples/sine/src/lib.rs +++ b/plugins/examples/sine/src/lib.rs @@ -105,8 +105,8 @@ impl Plugin for Sine { const VERSION: &'static str = "0.0.1"; - const DEFAULT_NUM_INPUTS: u32 = 0; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 0; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; const MIDI_INPUT: MidiConfig = MidiConfig::Basic; const SAMPLE_ACCURATE_AUTOMATION: bool = true; diff --git a/plugins/examples/stft/src/lib.rs b/plugins/examples/stft/src/lib.rs index 766878bc..bec9aec6 100644 --- a/plugins/examples/stft/src/lib.rs +++ b/plugins/examples/stft/src/lib.rs @@ -90,8 +90,8 @@ impl Plugin for Stft { const VERSION: &'static str = "0.0.1"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; const SAMPLE_ACCURATE_AUTOMATION: bool = true; diff --git a/plugins/loudness_war_winner/src/lib.rs b/plugins/loudness_war_winner/src/lib.rs index 81ad1f0e..8cf44617 100644 --- a/plugins/loudness_war_winner/src/lib.rs +++ b/plugins/loudness_war_winner/src/lib.rs @@ -120,8 +120,8 @@ impl Plugin for LoudnessWarWinner { const VERSION: &'static str = "0.1.0"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; fn params(&self) -> Arc { self.params.clone() diff --git a/plugins/puberty_simulator/src/lib.rs b/plugins/puberty_simulator/src/lib.rs index bb16c188..336c07e6 100644 --- a/plugins/puberty_simulator/src/lib.rs +++ b/plugins/puberty_simulator/src/lib.rs @@ -165,8 +165,8 @@ impl Plugin for PubertySimulator { const VERSION: &'static str = "0.1.0"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; fn params(&self) -> Arc { self.params.clone() diff --git a/plugins/safety_limiter/src/lib.rs b/plugins/safety_limiter/src/lib.rs index d004b3c6..9040d0ab 100644 --- a/plugins/safety_limiter/src/lib.rs +++ b/plugins/safety_limiter/src/lib.rs @@ -154,8 +154,8 @@ impl Plugin for SafetyLimiter { const VERSION: &'static str = "0.1.0"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; fn params(&self) -> Arc { self.params.clone() diff --git a/plugins/spectral_compressor/src/lib.rs b/plugins/spectral_compressor/src/lib.rs index b003f4e5..74f5f986 100644 --- a/plugins/spectral_compressor/src/lib.rs +++ b/plugins/spectral_compressor/src/lib.rs @@ -137,7 +137,7 @@ impl Default for SpectralCompressor { // Changing any of the compressor threshold or ratio parameters will set an atomic flag in // this object that causes the compressor thresholds and ratios to be recalcualted let compressor_bank = compressor_bank::CompressorBank::new( - Self::DEFAULT_NUM_OUTPUTS as usize, + Self::DEFAULT_OUTPUT_CHANNELS as usize, MAX_WINDOW_SIZE, ); @@ -153,7 +153,7 @@ impl Default for SpectralCompressor { }, // These three will be set to the correct values in the initialize function - stft: util::StftHelper::new(Self::DEFAULT_NUM_OUTPUTS as usize, MAX_WINDOW_SIZE, 0), + stft: util::StftHelper::new(Self::DEFAULT_OUTPUT_CHANNELS as usize, MAX_WINDOW_SIZE, 0), window_function: Vec::with_capacity(MAX_WINDOW_SIZE), dry_wet_mixer: dry_wet_mixer::DryWetMixer::new(0, 0, 0), compressor_bank, @@ -261,8 +261,8 @@ impl Plugin for SpectralCompressor { const VERSION: &'static str = "0.2.0"; - const DEFAULT_NUM_INPUTS: u32 = 2; - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; const DEFAULT_AUX_INPUTS: Option = Some(AuxiliaryIOConfig { num_busses: 1, num_channels: 2, diff --git a/src/plugin.rs b/src/plugin.rs index 5fc6a00a..de62c1f5 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -40,20 +40,20 @@ pub trait Plugin: Default + Send + Sync + 'static { /// the defaults instead of setting up the busses properly. /// /// Setting this to zero causes the plugin to have no main input bus. - const DEFAULT_NUM_INPUTS: u32 = 2; + const DEFAULT_INPUT_CHANNELS: u32 = 2; /// The default number of output channels. All of the same caveats mentioned for - /// `DEFAULT_NUM_INPUTS` apply here. + /// `DEFAULT_INPUT_CHANNELS` apply here. /// /// Setting this to zero causes the plugin to have no main output bus. - const DEFAULT_NUM_OUTPUTS: u32 = 2; + const DEFAULT_OUTPUT_CHANNELS: u32 = 2; /// If set, then the plugin will have this many sidechain input busses with a default number of /// channels. Not all hosts support more than one sidechain input bus. Negotiating the actual - /// configuration wroks the same was as with `DEFAULT_NUM_INPUTS`. + /// configuration works the same was as with `DEFAULT_INPUT_CHANNELS`. const DEFAULT_AUX_INPUTS: Option = None; /// If set, then the plugin will have this many auxiliary output busses with a default number of /// channels. Negotiating the actual configuration wroks the same was as with - /// `DEFAULT_NUM_INPUTS`. + /// `DEFAULT_INPUT_CHANNELS`. const DEFAULT_AUX_OUTPUTS: Option = None; /// Optional names for the main and auxiliary input and output ports. Will be generated if not @@ -107,8 +107,8 @@ pub trait Plugin: Default + Send + Sync + 'static { /// Whether the plugin supports a bus config. This only acts as a check, and the plugin /// shouldn't do anything beyond returning true or false. fn accepts_bus_config(&self, config: &BusConfig) -> bool { - config.num_input_channels == Self::DEFAULT_NUM_INPUTS - && config.num_output_channels == Self::DEFAULT_NUM_OUTPUTS + config.num_input_channels == Self::DEFAULT_INPUT_CHANNELS + && config.num_output_channels == Self::DEFAULT_OUTPUT_CHANNELS } /// Initialize the plugin for the given bus and buffer configurations. These configurations will diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index f69f9b49..f64fdd40 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -506,8 +506,8 @@ impl Wrapper

{ // In the off chance that the default config specified by the plugin is not in the above // list, we'll try that as well. let default_bus_config = BusConfig { - num_input_channels: P::DEFAULT_NUM_INPUTS, - num_output_channels: P::DEFAULT_NUM_OUTPUTS, + num_input_channels: P::DEFAULT_INPUT_CHANNELS, + num_output_channels: P::DEFAULT_OUTPUT_CHANNELS, aux_input_busses: P::DEFAULT_AUX_INPUTS.unwrap_or_default(), aux_output_busses: P::DEFAULT_AUX_OUTPUTS.unwrap_or_default(), }; @@ -549,8 +549,8 @@ impl Wrapper

{ is_processing: AtomicBool::new(false), current_bus_config: AtomicCell::new(BusConfig { - num_input_channels: P::DEFAULT_NUM_INPUTS, - num_output_channels: P::DEFAULT_NUM_OUTPUTS, + num_input_channels: P::DEFAULT_INPUT_CHANNELS, + num_output_channels: P::DEFAULT_OUTPUT_CHANNELS, aux_input_busses: P::DEFAULT_AUX_INPUTS.unwrap_or_default(), aux_output_busses: P::DEFAULT_AUX_OUTPUTS.unwrap_or_default(), }), diff --git a/src/wrapper/vst3/inner.rs b/src/wrapper/vst3/inner.rs index b66812d2..4a5a79d6 100644 --- a/src/wrapper/vst3/inner.rs +++ b/src/wrapper/vst3/inner.rs @@ -289,8 +289,8 @@ impl WrapperInner

{ // that, we'll always initialize this configuration even before the host requests a // channel layout. current_bus_config: AtomicCell::new(BusConfig { - num_input_channels: P::DEFAULT_NUM_INPUTS, - num_output_channels: P::DEFAULT_NUM_OUTPUTS, + num_input_channels: P::DEFAULT_INPUT_CHANNELS, + num_output_channels: P::DEFAULT_OUTPUT_CHANNELS, aux_input_busses: P::DEFAULT_AUX_INPUTS.unwrap_or_default(), aux_output_busses: P::DEFAULT_AUX_OUTPUTS.unwrap_or_default(), }), diff --git a/src/wrapper/vst3/wrapper.rs b/src/wrapper/vst3/wrapper.rs index 349dd684..c2c89514 100644 --- a/src/wrapper/vst3/wrapper.rs +++ b/src/wrapper/vst3/wrapper.rs @@ -91,7 +91,7 @@ impl IComponent for Wrapper

{ // HACK: Bitwig will not call the process function at all if the plugin does not have any // audio IO, so we'll add a zero channel output to work around this if that is the // case - let no_main_audio_io = P::DEFAULT_NUM_INPUTS == 0 && P::DEFAULT_NUM_OUTPUTS == 0; + let no_main_audio_io = P::DEFAULT_INPUT_CHANNELS == 0 && P::DEFAULT_OUTPUT_CHANNELS == 0; // A plugin has a main input and output bus if the default number of channels is non-zero, // and a plugin can also have auxiliary input and output busses @@ -99,7 +99,7 @@ impl IComponent for Wrapper

{ x if x == vst3_sys::vst::MediaTypes::kAudio as i32 && dir == vst3_sys::vst::BusDirections::kInput as i32 => { - let main_busses = if P::DEFAULT_NUM_INPUTS > 0 { 1 } else { 0 }; + let main_busses = if P::DEFAULT_INPUT_CHANNELS > 0 { 1 } else { 0 }; let aux_busses = P::DEFAULT_AUX_INPUTS.unwrap_or_default().num_busses as i32; main_busses + aux_busses @@ -107,7 +107,7 @@ impl IComponent for Wrapper

{ x if x == vst3_sys::vst::MediaTypes::kAudio as i32 && dir == vst3_sys::vst::BusDirections::kOutput as i32 => { - let main_busses = if P::DEFAULT_NUM_OUTPUTS > 0 { 1 } else { 0 }; + let main_busses = if P::DEFAULT_OUTPUT_CHANNELS > 0 { 1 } else { 0 }; let aux_busses = P::DEFAULT_AUX_OUTPUTS.unwrap_or_default().num_busses as i32; if no_main_audio_io { @@ -144,7 +144,7 @@ impl IComponent for Wrapper

{ // HACK: Bitwig will not call the process function at all if the plugin does not have any // audio IO, so we'll add a zero channel output to work around this if that is the // case - let no_main_audio_io = P::DEFAULT_NUM_INPUTS == 0 && P::DEFAULT_NUM_OUTPUTS == 0; + let no_main_audio_io = P::DEFAULT_INPUT_CHANNELS == 0 && P::DEFAULT_OUTPUT_CHANNELS == 0; match (type_, dir, index) { (t, _, _) if t == vst3_sys::vst::MediaTypes::kAudio as i32 => { @@ -159,7 +159,7 @@ impl IComponent for Wrapper

{ let bus_config = self.inner.current_bus_config.load(); if dir == vst3_sys::vst::BusDirections::kInput as i32 { let aux_inputs_only = - P::DEFAULT_NUM_INPUTS == 0 && P::DEFAULT_AUX_INPUTS.is_some(); + P::DEFAULT_INPUT_CHANNELS == 0 && P::DEFAULT_AUX_INPUTS.is_some(); let aux_input_start_idx = if aux_inputs_only { 0 } else { 1 }; if !aux_inputs_only && index == 0 { info.bus_type = vst3_sys::vst::BusTypes::kMain as i32; @@ -197,7 +197,7 @@ impl IComponent for Wrapper

{ } } else if dir == vst3_sys::vst::BusDirections::kOutput as i32 { let aux_outputs_only = - P::DEFAULT_NUM_OUTPUTS == 0 && P::DEFAULT_AUX_OUTPUTS.is_some(); + P::DEFAULT_OUTPUT_CHANNELS == 0 && P::DEFAULT_AUX_OUTPUTS.is_some(); let aux_output_start_idx = if aux_outputs_only { 0 } else { 1 }; if (!aux_outputs_only || no_main_audio_io) && index == 0 { info.bus_type = vst3_sys::vst::BusTypes::kMain as i32; @@ -291,8 +291,8 @@ impl IComponent for Wrapper

{ (t, 0) if t == vst3_sys::vst::MediaTypes::kAudio as i32 // We only have an IO pair when the plugin has both a main input and a main output - && P::DEFAULT_NUM_INPUTS > 0 - && P::DEFAULT_NUM_OUTPUTS > 0 => + && P::DEFAULT_INPUT_CHANNELS > 0 + && P::DEFAULT_OUTPUT_CHANNELS > 0 => { out_info.media_type = vst3_sys::vst::MediaTypes::kAudio as i32; out_info.bus_index = in_info.bus_index; @@ -325,7 +325,7 @@ impl IComponent for Wrapper

{ // HACK: Bitwig will not call the process function at all if the plugin does not have any // audio IO, so we'll add a zero channel output to work around this if that is the // case - let no_main_audio_io = P::DEFAULT_NUM_INPUTS == 0 && P::DEFAULT_NUM_OUTPUTS == 0; + let no_main_audio_io = P::DEFAULT_INPUT_CHANNELS == 0 && P::DEFAULT_OUTPUT_CHANNELS == 0; // We don't need any special handling here match (type_, dir, index) { @@ -333,7 +333,7 @@ impl IComponent for Wrapper

{ if t == vst3_sys::vst::MediaTypes::kAudio as i32 && d == vst3_sys::vst::BusDirections::kInput as i32 => { - let main_busses = if P::DEFAULT_NUM_INPUTS > 0 { 1 } else { 0 }; + let main_busses = if P::DEFAULT_INPUT_CHANNELS > 0 { 1 } else { 0 }; let aux_busses = P::DEFAULT_AUX_INPUTS.unwrap_or_default().num_busses as i32; if (0..main_busses + aux_busses).contains(&index) { @@ -346,7 +346,7 @@ impl IComponent for Wrapper

{ if t == vst3_sys::vst::MediaTypes::kAudio as i32 && d == vst3_sys::vst::BusDirections::kOutput as i32 => { - let main_busses = if P::DEFAULT_NUM_OUTPUTS > 0 || no_main_audio_io { + let main_busses = if P::DEFAULT_OUTPUT_CHANNELS > 0 || no_main_audio_io { 1 } else { 0 @@ -785,7 +785,7 @@ impl IAudioProcessor for Wrapper

{ // HACK: Bitwig will not call the process function at all if the plugin does not have any // audio IO, so we'll add a zero channel output to work around this if that is the // case - let no_main_audio_io = P::DEFAULT_NUM_INPUTS == 0 && P::DEFAULT_NUM_OUTPUTS == 0; + let no_main_audio_io = P::DEFAULT_INPUT_CHANNELS == 0 && P::DEFAULT_OUTPUT_CHANNELS == 0; // Why are these signed integers again? if num_ins < 0 || num_outs < 0 { @@ -796,7 +796,7 @@ impl IAudioProcessor for Wrapper

{ // support plugins with no main IO but with auxiliary IO, we'll need to take that into // account when asserting this. If that's the case, then the first bus for that direction // will have been marked auxiliary. - let aux_inputs_only = P::DEFAULT_NUM_INPUTS == 0 && P::DEFAULT_AUX_INPUTS.is_some(); + let aux_inputs_only = P::DEFAULT_INPUT_CHANNELS == 0 && P::DEFAULT_AUX_INPUTS.is_some(); let num_input_channels = if aux_inputs_only || num_ins < 1 { 0 } else { @@ -819,7 +819,7 @@ impl IAudioProcessor for Wrapper

{ } } - let aux_outputs_only = P::DEFAULT_NUM_OUTPUTS == 0 && P::DEFAULT_AUX_OUTPUTS.is_some(); + let aux_outputs_only = P::DEFAULT_OUTPUT_CHANNELS == 0 && P::DEFAULT_AUX_OUTPUTS.is_some(); let num_output_channels = if (aux_outputs_only && !no_main_audio_io) || num_outs < 1 { 0 } else { @@ -879,7 +879,7 @@ impl IAudioProcessor for Wrapper

{ // HACK: Bitwig will not call the process function at all if the plugin does not have any // audio IO, so we'll add a zero channel output to work around this if that is the // case - let no_main_audio_io = P::DEFAULT_NUM_INPUTS == 0 && P::DEFAULT_NUM_OUTPUTS == 0; + let no_main_audio_io = P::DEFAULT_INPUT_CHANNELS == 0 && P::DEFAULT_OUTPUT_CHANNELS == 0; let channel_count_to_map = |count| match count { 0 => vst3_sys::vst::kEmpty, @@ -900,7 +900,7 @@ impl IAudioProcessor for Wrapper

{ let bus_config = self.inner.current_bus_config.load(); let num_channels = if dir == vst3_sys::vst::BusDirections::kInput as i32 { - let aux_inputs_only = P::DEFAULT_NUM_INPUTS == 0 && P::DEFAULT_AUX_INPUTS.is_some(); + let aux_inputs_only = P::DEFAULT_INPUT_CHANNELS == 0 && P::DEFAULT_AUX_INPUTS.is_some(); let aux_input_start_idx = if aux_inputs_only { 0 } else { 1 }; if !aux_inputs_only && index == 0 { bus_config.num_input_channels @@ -913,7 +913,7 @@ impl IAudioProcessor for Wrapper

{ return kInvalidArgument; } } else if dir == vst3_sys::vst::BusDirections::kOutput as i32 { - let aux_outputs_only = P::DEFAULT_NUM_OUTPUTS == 0 && P::DEFAULT_AUX_OUTPUTS.is_some(); + let aux_outputs_only = P::DEFAULT_OUTPUT_CHANNELS == 0 && P::DEFAULT_AUX_OUTPUTS.is_some(); let aux_output_start_idx = if aux_outputs_only { 0 } else { 1 }; if (!aux_outputs_only || no_main_audio_io) && index == 0 { bus_config.num_output_channels