From 990aea2b420d998afecc8f7ef656e3a8e56b406b Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 23 Aug 2023 00:26:40 +0100 Subject: [PATCH] utility methods that fetch index numbers --- src/nvda_voicemeeter/util.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/nvda_voicemeeter/util.py diff --git a/src/nvda_voicemeeter/util.py b/src/nvda_voicemeeter/util.py new file mode 100644 index 0000000..11249e5 --- /dev/null +++ b/src/nvda_voicemeeter/util.py @@ -0,0 +1,13 @@ +def get_asio_checkbox_index(channel, num): + if channel == 0: + return 2 * num - 2 + return 2 * num - 1 + + +def get_insert_checkbox_index(kind, channel, num): + if num <= kind.phys_in: + if channel == 0: + return 2 * num - 2 + else: + return 2 * num - 1 + return (2 * kind.phys_in) + (8 * (num - kind.phys_in - 1)) + channel