Compare commits

..

5 Commits

Author SHA1 Message Date
645361c731 bump to pre-release a1 2023-09-18 09:38:37 +01:00
6baa0000c8 Merge remote-tracking branch 'origin/dev' into add-nav-binds 2023-09-18 09:18:44 +01:00
d722154325 adds ctrl+shift+r slider reset bind
closes #9

patch bump
2023-09-18 09:12:12 +01:00
c94d763569 adds some quick navigation binds 2023-09-18 00:07:35 +01:00
ac14b7ad0d adds sliders to on_pdirty
bump to b2
2023-09-17 14:49:42 +01:00
2 changed files with 66 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "nvda_voicemeeter" name = "nvda_voicemeeter"
version = "0.2.1b1" version = "0.2.2a1"
description = "A Voicemeeter app compatible with NVDA" description = "A Voicemeeter app compatible with NVDA"
authors = [ authors = [
{ name = "onyx-and-iris", email = "code@onyxandiris.online" }, { name = "onyx-and-iris", email = "code@onyxandiris.online" },

View File

@@ -48,12 +48,8 @@ class NVDAVMWindow(psg.Window):
[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.phys_out)]
slider_opts = {"takefocus": 1, "highlightthickness": 1} slider_opts = {"takefocus": 1, "highlightthickness": 1}
for i in range(self.kind.num_strip): for i in range(self.kind.num_strip):
if i < self.kind.phys_in: for param in util.get_slider_params(i, self.vm):
for param in util.get_slider_params(i, self.vm): self[f"STRIP {i}||SLIDER {param}"].Widget.config(**slider_opts)
self[f"STRIP {i}||SLIDER {param}"].Widget.config(**slider_opts)
else:
for param in ("BASS", "MID", "TREBLE"):
self[f"STRIP {i}||SLIDER {param}"].Widget.config(**slider_opts)
self[f"STRIP {i}||SLIDER GAIN"].Widget.config(**slider_opts) self[f"STRIP {i}||SLIDER GAIN"].Widget.config(**slider_opts)
if self.kind.name != "basic": if self.kind.name != "basic":
self[f"STRIP {i}||SLIDER LIMIT"].Widget.config(**slider_opts) self[f"STRIP {i}||SLIDER LIMIT"].Widget.config(**slider_opts)
@@ -109,6 +105,15 @@ class NVDAVMWindow(psg.Window):
self[f"{key}||SLIDER"].update(value=value) self[f"{key}||SLIDER"].update(value=value)
for i in range(self.kind.num_strip): for i in range(self.kind.num_strip):
self[f"STRIP {i}||SLIDER GAIN"].update(value=self.vm.strip[i].gain) self[f"STRIP {i}||SLIDER GAIN"].update(value=self.vm.strip[i].gain)
if self.kind.name != "basic":
self[f"STRIP {i}||SLIDER LIMIT"].update(value=self.vm.strip[i].limit)
for param in util.get_slider_params(i, self.vm):
if param in ("AUDIBILITY", "BASS", "MID", "TREBLE"):
val = getattr(self.vm.strip[i], param.lower())
else:
target = getattr(self.vm.strip[i], param.lower())
val = target.knob
self[f"STRIP {i}||SLIDER {param}"].update(value=val)
for i in range(self.kind.num_bus): for i in range(self.kind.num_bus):
self[f"BUS {i}||SLIDER GAIN"].update(value=self.vm.bus[i].gain) self[f"BUS {i}||SLIDER GAIN"].update(value=self.vm.bus[i].gain)
if self.kind.name != "basic": if self.kind.name != "basic":
@@ -132,6 +137,8 @@ class NVDAVMWindow(psg.Window):
self.bind("<Control-KeyPress-Tab>", "CTRL-TAB") self.bind("<Control-KeyPress-Tab>", "CTRL-TAB")
self.bind("<Control-Shift-KeyPress-Tab>", "CTRL-SHIFT-TAB") self.bind("<Control-Shift-KeyPress-Tab>", "CTRL-SHIFT-TAB")
self.bind("<Control-a>", "CTRL-A") self.bind("<Control-a>", "CTRL-A")
for i in range(1, 10):
self.bind(f"<Control-Key-{i}>", f"CTRL-{i}")
# Hardware In # Hardware In
for i in range(self.vm.kind.phys_in): for i in range(self.vm.kind.phys_in):
@@ -211,6 +218,7 @@ class NVDAVMWindow(psg.Window):
self[f"STRIP {i}||SLIDER {param}"].bind("<Shift-KeyPress-Down>", "||KEY SHIFT DOWN") self[f"STRIP {i}||SLIDER {param}"].bind("<Shift-KeyPress-Down>", "||KEY SHIFT DOWN")
self[f"STRIP {i}||SLIDER {param}"].bind("<Control-KeyPress-Up>", "||KEY CTRL UP") self[f"STRIP {i}||SLIDER {param}"].bind("<Control-KeyPress-Up>", "||KEY CTRL UP")
self[f"STRIP {i}||SLIDER {param}"].bind("<Control-KeyPress-Down>", "||KEY CTRL DOWN") self[f"STRIP {i}||SLIDER {param}"].bind("<Control-KeyPress-Down>", "||KEY CTRL DOWN")
self[f"STRIP {i}||SLIDER {param}"].bind("<Control-Shift-KeyPress-R>", "||KEY CTRL SHIFT R")
# Bus Params # Bus Params
params = ["MONO", "EQ", "MUTE", "MODE"] params = ["MONO", "EQ", "MUTE", "MODE"]
@@ -237,6 +245,7 @@ class NVDAVMWindow(psg.Window):
self[f"BUS {i}||SLIDER GAIN"].bind("<Shift-KeyPress-Down>", "||KEY SHIFT DOWN") self[f"BUS {i}||SLIDER GAIN"].bind("<Shift-KeyPress-Down>", "||KEY SHIFT DOWN")
self[f"BUS {i}||SLIDER GAIN"].bind("<Control-KeyPress-Up>", "||KEY CTRL UP") self[f"BUS {i}||SLIDER GAIN"].bind("<Control-KeyPress-Up>", "||KEY CTRL UP")
self[f"BUS {i}||SLIDER GAIN"].bind("<Control-KeyPress-Down>", "||KEY CTRL DOWN") self[f"BUS {i}||SLIDER GAIN"].bind("<Control-KeyPress-Down>", "||KEY CTRL DOWN")
self[f"BUS {i}||SLIDER GAIN"].bind("<Control-Shift-KeyPress-R>", "||KEY CTRL SHIFT R")
def popup_save_as(self, message, title=None, initial_folder=None): def popup_save_as(self, message, title=None, initial_folder=None):
layout = [ layout = [
@@ -406,6 +415,35 @@ class NVDAVMWindow(psg.Window):
self["tabgroup"].set_focus() self["tabgroup"].set_focus()
self.nvda.speak(f"{values['tabgroup']}") self.nvda.speak(f"{values['tabgroup']}")
# Quick Navigation
case ["CTRL-1" | "CTRL-2" | "CTRL-3" | "CTRL-4" | "CTRL-5" | "CTRL-6" | "CTRL-7" | "CTRL-8" as bind]:
key, index = bind.split("-")
match values["tabgroup"]:
case "tab||Physical Strip":
self[f"STRIP {int(index) - 1}||A1"].set_focus()
if (
self.find_element_with_focus() is None
or self.find_element_with_focus().Key != f"STRIP {int(index) - 1}||A1"
):
self[f"STRIP {int(index) - 1}||SLIDER GAIN"].set_focus()
case "tab||Virtual Strip":
index = int(index) + self.kind.phys_in
if index > self.kind.num_strip:
continue
self[f"STRIP {index - 1}||A1"].set_focus()
if (
self.find_element_with_focus() is None
or self.find_element_with_focus().Key != f"STRIP {int(index) - 1}||A1"
):
self[f"STRIP {int(index) - 1}||SLIDER GAIN"].set_focus()
case "tab||Buses":
self[f"BUS {int(index) - 1}||MONO"].set_focus()
if (
self.find_element_with_focus() is None
or self.find_element_with_focus().Key != f"BUS {int(index) - 1}||MONO"
):
self[f"BUS {int(index) - 1}||SLIDER GAIN"].set_focus()
# Rename popups # Rename popups
case ["F2:113"]: case ["F2:113"]:
tab = values["tabgroup"] tab = values["tabgroup"]
@@ -723,9 +761,7 @@ class NVDAVMWindow(psg.Window):
self.vm.event.pdirty = False self.vm.event.pdirty = False
label = self.cache["labels"][f"STRIP {index}||LABEL"] label = self.cache["labels"][f"STRIP {index}||LABEL"]
val = values[f"STRIP {index}||SLIDER {param}"] val = values[f"STRIP {index}||SLIDER {param}"]
if param == "LIMIT": self.nvda.speak(f"{label} {param} slider {int(val) if param == 'LIMIT' else val}")
val = int(val)
self.nvda.speak(f"{label} {param} slider {val}")
case [ case [
["STRIP", index], ["STRIP", index],
[ [
@@ -900,6 +936,23 @@ class NVDAVMWindow(psg.Window):
case "LIMIT": case "LIMIT":
self.vm.strip[int(index)].limit = util.check_bounds(val, (-40, 12)) self.vm.strip[int(index)].limit = util.check_bounds(val, (-40, 12))
self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-40, 12))) self[f"STRIP {index}||SLIDER {param}"].update(value=util.check_bounds(val, (-40, 12)))
case [["STRIP", index], ["SLIDER", param], ["KEY", "CTRL", "SHIFT", "R"]]:
match param:
case "GAIN":
self.vm.strip[int(index)].gain = 0
self[f"STRIP {index}||SLIDER {param}"].update(value=0)
case "COMP" | "GATE" | "DENOISER":
setattr(target, "knob", 0)
self[f"STRIP {index}||SLIDER {param}"].update(value=0)
case "AUDIBILITY":
self.vm.strip[int(index)].audibility = 0
self[f"STRIP {index}||SLIDER {param}"].update(value=0)
case "BASS" | "MID" | "TREBLE":
setattr(self.vm.strip[int(index)], param.lower(), 0)
self[f"STRIP {index}||SLIDER {param}"].update(value=0)
case "LIMIT":
self.vm.strip[int(index)].limit = 12
self[f"STRIP {index}||SLIDER {param}"].update(value=12)
# Bus Params # Bus Params
case [["BUS", index], [param]]: case [["BUS", index], [param]]:
@@ -1009,6 +1062,9 @@ class NVDAVMWindow(psg.Window):
val -= 0.1 val -= 0.1
self.vm.bus[int(index)].gain = util.check_bounds(val, (-60, 12)) self.vm.bus[int(index)].gain = util.check_bounds(val, (-60, 12))
self[f"BUS {index}||SLIDER GAIN"].update(value=val) self[f"BUS {index}||SLIDER GAIN"].update(value=val)
case [["BUS", index], ["SLIDER", "GAIN"], ["KEY", "CTRL", "SHIFT", "R"]]:
self.vm.bus[int(index)].gain = 0
self[f"BUS {index}||SLIDER GAIN"].update(value=0)
# Unknown # Unknown
case _: case _: