From 4a6ca2a353eb9bd864a7292f719258fe5f3c6d0f Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 28 Sep 2023 22:43:06 +0100 Subject: [PATCH] check against slider modes explicitly add enter/exit slider mode debug logging --- src/nvda_voicemeeter/util.py | 14 ++++++++++++++ src/nvda_voicemeeter/window.py | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/nvda_voicemeeter/util.py b/src/nvda_voicemeeter/util.py index 23f4c84..7c3cb32 100644 --- a/src/nvda_voicemeeter/util.py +++ b/src/nvda_voicemeeter/util.py @@ -178,3 +178,17 @@ def get_full_slider_params(i, kind) -> Iterable: if kind.name == "basic": params.remove("LIMIT") return params + + +def get_slider_modes() -> Iterable: + return ( + "GAIN MODE", + "BASS MODE", + "MID MODE", + "TREBLE MODE", + "AUDIBILITY MODE", + "COMP MODE", + "GATE MODE", + "DENOISER MODE", + "LIMIT MODE", + ) diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index 87a5870..f42e86d 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -304,13 +304,15 @@ class NVDAVMWindow(psg.Window): self.logger.debug(f"values::{values}") if event in (psg.WIN_CLOSED, "Exit"): break - elif not event.startswith("BUS") and event.endswith("MODE"): + elif event in util.get_slider_modes(): mode = event self.nvda.speak(f"{mode} enabled") + self.logger.debug(f"entered slider mode {mode}") continue elif event == "ESCAPE": if mode: self.nvda.speak(f"{mode} disabled") + self.logger.debug(f"exited from slider mode {mode}") mode = None continue