From 05fd7fa075348da7cffbf94ce9166218306c8aec Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 27 Jun 2022 18:33:13 +0200 Subject: [PATCH] Revert "Fix audio port in-place pair indices" This reverts commit 791dc446507db4afc8fd03e9ec36c4b22e3470b5. This was actually correct, this should use stable indices instead of list indices. --- src/wrapper/clap/wrapper.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index 035c403c..bc68e29d 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -2286,7 +2286,13 @@ impl Wrapper

{ } else { index + num_input_ports }; - let pair_stable_id = if is_main_port { 0 } else { CLAP_INVALID_ID }; + let pair_stable_id = match (is_input, is_main_port) { + // Ports are named linearly with inputs coming before outputs, so this is the index of + // the first output port + (true, true) => num_input_ports, + (false, true) => 0, + (_, false) => CLAP_INVALID_ID, + }; let channel_count = match (is_input, is_main_port) { (true, true) => current_bus_config.num_input_channels,