From bfdc0306e3c33db9676af9f8694a898ddbb24c2c Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 13 Sep 2023 12:16:28 +0100 Subject: [PATCH] update default values for each driver type open advanced settings popup if current tab is settings. minor version bump --- pyproject.toml | 2 +- src/nvda_voicemeeter/window.py | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 931c0b6..0f258e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nvda_voicemeeter" -version = "0.1.5" +version = "0.2.0" description = "A Voicemeeter app compatible with NVDA" authors = [ { name = "onyx-and-iris", email = "code@onyxandiris.online" }, diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index bbdeceb..1e9ed3a 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -168,6 +168,7 @@ class NVDAVMWindow(psg.Window): # Advanced Settings if self.kind.name != "basic": + self["ADVANCED SETTINGS"].bind("", "||FOCUS IN") self["ADVANCED SETTINGS"].bind("", "||KEY ENTER") # Strip Params @@ -297,8 +298,11 @@ class NVDAVMWindow(psg.Window): ] return psg.Frame("BUFFERING", buffer) - buffer_frame = _make_buffering_frame() - layout = [[buffer_frame], [psg.Button("Exit")]] + layout = [] + steps = (_make_buffering_frame,) + for step in steps: + layout.append([step()]) + layout.append([psg.Button("Exit", size=(8, 2))]) window = psg.Window(title, layout, finalize=True) buttonmenu_opts = {"takefocus": 1, "highlightthickness": 1} @@ -318,7 +322,12 @@ class NVDAVMWindow(psg.Window): match parsed_cmd := self.parser.match.parseString(event): case ["BUFFER MME" | "BUFFER WDM" | "BUFFER KS" | "BUFFER ASIO"]: if values[event] == "Default": - val = 0 + if "MME" in event: + val = 1024 + elif "WDM" in event or "KS" in event: + val = 512 + else: + val = 0 else: val = int(values[event]) driver = event.split()[1] @@ -546,7 +555,10 @@ class NVDAVMWindow(psg.Window): # Advanced Settings case ["ADVANCED SETTINGS"] | ["CTRL-A"]: - self.popup_advanced_settings(title="Advanced Settings") + if values["tabs"] == "Settings": + self.popup_advanced_settings(title="Advanced Settings") + case [["ADVANCED", "SETTINGS"], ["FOCUS", "IN"]]: + self.nvda.speak("ADVANCED SETTINGS") case [["ADVANCED", "SETTINGS"], ["KEY", "ENTER"]]: self.find_element_with_focus().click()