1
0
Fork 0

Handle the output channel map

I apparently committed this a bit too early.
This commit is contained in:
Robbert van der Helm 2022-01-30 01:43:28 +01:00
parent 0c24398234
commit 6ddae6a506

View file

@ -642,10 +642,7 @@ impl<P: Plugin> IAudioProcessor for Wrapper<'_, P> {
) -> tresult {
check_null_ptr!(arr);
let config = self.current_bus_config.borrow();
match (dir, index) {
(d, 0) if d == vst3_sys::vst::BusDirections::kInput as i32 => {
let channel_map = match config.num_input_channels {
let channel_count_to_map = |count| match count {
0 => vst3_sys::vst::kEmpty,
1 => vst3_sys::vst::kMono,
2 => vst3_sys::vst::kStereo,
@ -662,14 +659,21 @@ impl<P: Plugin> IAudioProcessor for Wrapper<'_, P> {
}
};
let config = self.current_bus_config.borrow();
let num_channels = match (dir, index) {
(d, 0) if d == vst3_sys::vst::BusDirections::kInput as i32 => config.num_input_channels,
(d, 0) if d == vst3_sys::vst::BusDirections::kOutput as i32 => {
config.num_output_channels
}
_ => return kInvalidArgument,
};
let channel_map = channel_count_to_map(num_channels);
nih_debug_assert_eq!(config.num_input_channels, channel_map.count_ones());
*arr = channel_map;
kResultOk
}
_ => kInvalidArgument,
}
}
unsafe fn can_process_sample_size(&self, symbolic_sample_size: i32) -> tresult {
if symbolic_sample_size == vst3_sys::vst::SymbolicSampleSizes::kSample32 as i32 {