From 912eb8c14d5975312052aaf87c81382213f8292f Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 29 Sep 2023 01:09:18 +0100 Subject: [PATCH] number of patch composite buttons fixed for banana and potato kinds voicemeeter-api dependency bump patch bump --- pdm.lock | 6 +++--- pyproject.toml | 4 ++-- src/nvda_voicemeeter/builder.py | 2 +- src/nvda_voicemeeter/window.py | 12 ++++++++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pdm.lock b/pdm.lock index 34e4f5d..e3f5501 100644 --- a/pdm.lock +++ b/pdm.lock @@ -251,13 +251,13 @@ files = [ [[package]] name = "voicemeeter-api" -version = "2.4.10" +version = "2.4.11" requires_python = ">=3.10,<4.0" summary = "A Python wrapper for the Voiceemeter API" dependencies = [ "tomli<3.0.0,>=2.0.1; python_version < \"3.11\"", ] files = [ - {file = "voicemeeter_api-2.4.10-py3-none-any.whl", hash = "sha256:2f75acb7b472e56b6bd8d4f1141f32d948c55ef9b30d5a08e085a1c8e76e2464"}, - {file = "voicemeeter_api-2.4.10.tar.gz", hash = "sha256:1d8dfc1e8922179f8b97c90b90b9ed051082018c6af5feb1d48250140a02d40c"}, + {file = "voicemeeter_api-2.4.11-py3-none-any.whl", hash = "sha256:7a1b290d90c851204438c18e2d343e568c242fcd1e664c5b88d4019a553d44e1"}, + {file = "voicemeeter_api-2.4.11.tar.gz", hash = "sha256:875591ad326a7a13ef141536cca83953edcda81da256191bab3844bac46a0e70"}, ] diff --git a/pyproject.toml b/pyproject.toml index 13b5e11..a2abb33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nvda_voicemeeter" -version = "0.5.1" +version = "0.5.3" description = "A Voicemeeter app compatible with NVDA" authors = [ { name = "onyx-and-iris", email = "code@onyxandiris.online" }, @@ -8,7 +8,7 @@ authors = [ dependencies = [ "pysimplegui>=4.60.5", "pyparsing>=3.1.1", - "voicemeeter-api>=2.4.10", + "voicemeeter-api>=2.4.11", ] requires-python = ">=3.10,<3.12" readme = "README.md" diff --git a/src/nvda_voicemeeter/builder.py b/src/nvda_voicemeeter/builder.py index 674e05b..87e50f6 100644 --- a/src/nvda_voicemeeter/builder.py +++ b/src/nvda_voicemeeter/builder.py @@ -206,7 +206,7 @@ class Builder: menu_def=["", outputs], key=f"PATCH COMPOSITE||PC{i + 1}", ) - for i in range(self.kind.phys_out) + for i in range(self.kind.composite) ] ) diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index f42e86d..9ee078a 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -47,7 +47,7 @@ class NVDAVMWindow(psg.Window): if self.kind.name == "basic": self["HARDWARE OUT||A2"].Widget.config(**buttonmenu_opts) if self.kind.name != "basic": - [self[f"PATCH COMPOSITE||PC{i + 1}"].Widget.config(**buttonmenu_opts) for i in range(self.kind.phys_out)] + [self[f"PATCH COMPOSITE||PC{i + 1}"].Widget.config(**buttonmenu_opts) for i in range(self.kind.composite)] slider_opts = {"takefocus": 1, "highlightthickness": 1} for i in range(self.kind.num_strip): for param in util.get_slider_params(i, self.kind): @@ -203,7 +203,7 @@ class NVDAVMWindow(psg.Window): # Patch Composite if self.kind.name != "basic": - for i in range(self.vm.kind.phys_out): + for i in range(self.kind.composite): self[f"PATCH COMPOSITE||PC{i + 1}"].bind("", "||FOCUS IN") self[f"PATCH COMPOSITE||PC{i + 1}"].bind("", "||KEY SPACE", propagate=False) self[f"PATCH COMPOSITE||PC{i + 1}"].bind("", "||KEY ENTER", propagate=False) @@ -605,14 +605,18 @@ class NVDAVMWindow(psg.Window): val = values[f"PATCH COMPOSITE||{key}"] index = int(key[-1]) - 1 self.vm.patch.composite[index].set(util.get_patch_composite_list(self.kind).index(val) + 1) - self.TKroot.after(200, self.nvda.speak, f"PATCH COMPOSITE {key[-1]} set {val}") + self.TKroot.after(200, self.nvda.speak, val) case [["PATCH", "COMPOSITE"], [key], ["FOCUS", "IN"]]: if self.find_element_with_focus() is not None: if values[f"PATCH COMPOSITE||{key}"]: val = values[f"PATCH COMPOSITE||{key}"] else: index = int(key[-1]) - 1 - val = util.get_patch_composite_list(self.kind)[self.vm.patch.composite[index].get() - 1] + comp_index = self.vm.patch.composite[index].get() + if self.kind.name == "banana": + if comp_index == 64: # bus channel + comp_index = 0 + val = util.get_patch_composite_list(self.kind)[comp_index - 1] self.nvda.speak(f"Patch COMPOSITE {key[-1]} {val}") case [["PATCH", "COMPOSITE"], [key], ["KEY", "SPACE" | "ENTER"]]: util.open_context_menu_for_buttonmenu(self, f"PATCH COMPOSITE||{key}")