mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2025-04-20 04:23:45 +01:00
Compare commits
No commits in common. "9d8ea5f7471509d0edf933148861eb4719f5097b" and "893f9f59ffedd4a661a950ebedd7017a608d300b" have entirely different histories.
9d8ea5f747
...
893f9f59ff
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "nvda_voicemeeter"
|
name = "nvda_voicemeeter"
|
||||||
version = "0.4.1"
|
version = "0.3.1"
|
||||||
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" },
|
||||||
|
@ -38,7 +38,7 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.popup = Popup(self)
|
self.popup = Popup(self)
|
||||||
self.builder = Builder(self)
|
self.builder = Builder(self)
|
||||||
layout = self.builder.run()
|
layout = self.builder.run()
|
||||||
super().__init__(title, layout, return_keyboard_events=False, finalize=True)
|
super().__init__(title, layout, return_keyboard_events=True, finalize=True)
|
||||||
buttonmenu_opts = {"takefocus": 1, "highlightthickness": 1}
|
buttonmenu_opts = {"takefocus": 1, "highlightthickness": 1}
|
||||||
for i in range(self.kind.phys_in):
|
for i in range(self.kind.phys_in):
|
||||||
self[f"HARDWARE IN||{i + 1}"].Widget.config(**buttonmenu_opts)
|
self[f"HARDWARE IN||{i + 1}"].Widget.config(**buttonmenu_opts)
|
||||||
@ -142,7 +142,6 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self[f"tabgroup||{tabname}"].bind("<Shift-KeyPress-Tab>", "||KEY SHIFT TAB")
|
self[f"tabgroup||{tabname}"].bind("<Shift-KeyPress-Tab>", "||KEY SHIFT TAB")
|
||||||
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("<F2>", "F2")
|
|
||||||
|
|
||||||
# NAV
|
# NAV
|
||||||
self.bind("<Control-a>", "CTRL-A")
|
self.bind("<Control-a>", "CTRL-A")
|
||||||
@ -169,14 +168,13 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.bind("<Control-t>", "GATE MODE")
|
self.bind("<Control-t>", "GATE MODE")
|
||||||
self.bind("<Control-d>", "DENOISER MODE")
|
self.bind("<Control-d>", "DENOISER MODE")
|
||||||
self.bind("<Control-l>", "LIMIT MODE")
|
self.bind("<Control-l>", "LIMIT MODE")
|
||||||
self.bind("<Escape>", "ESCAPE")
|
|
||||||
|
|
||||||
for event in ("KeyPress", "KeyRelease"):
|
self.bind("<Alt-Left>", "LEFT")
|
||||||
event_id = event.removeprefix("Key").upper()
|
self.bind("<Alt-Right>", "RIGHT")
|
||||||
for direction in ("Left", "Right", "Up", "Down"):
|
self.bind("<Alt-Shift-KeyPress-Left>", "SHIFT-LEFT")
|
||||||
self.bind(f"<Alt-{event}-{direction}>", f"ALT {direction.upper()}||{event_id}")
|
self.bind("<Alt-Shift-KeyPress-Right>", "SHIFT-RIGHT")
|
||||||
self.bind(f"<Alt-Shift-{event}-{direction}>", f"ALT SHIFT {direction.upper()}||{event_id}")
|
self.bind("<Alt-Control-KeyPress-Left>", "CTRL-LEFT")
|
||||||
self.bind(f"<Alt-Control-{event}-{direction}>", f"ALT CTRL {direction.upper()}||{event_id}")
|
self.bind("<Alt-Control-KeyPress-Right>", "CTRL-RIGHT")
|
||||||
|
|
||||||
# Hardware In
|
# Hardware In
|
||||||
for i in range(self.vm.kind.phys_in):
|
for i in range(self.vm.kind.phys_in):
|
||||||
@ -245,18 +243,18 @@ class NVDAVMWindow(psg.Window):
|
|||||||
for param in util.get_full_slider_params(i, self.kind):
|
for param in util.get_full_slider_params(i, self.kind):
|
||||||
self[f"STRIP {i}||SLIDER {param}"].bind("<FocusIn>", "||FOCUS IN")
|
self[f"STRIP {i}||SLIDER {param}"].bind("<FocusIn>", "||FOCUS IN")
|
||||||
self[f"STRIP {i}||SLIDER {param}"].bind("<FocusOut>", "||FOCUS OUT")
|
self[f"STRIP {i}||SLIDER {param}"].bind("<FocusOut>", "||FOCUS OUT")
|
||||||
for event in ("KeyPress", "KeyRelease"):
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Left>", "||KEY LEFT")
|
||||||
event_id = event.removeprefix("Key").upper()
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Right>", "||KEY RIGHT")
|
||||||
for direction in ("Left", "Right", "Up", "Down"):
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Shift-KeyPress-Left>", "||KEY SHIFT LEFT")
|
||||||
self[f"STRIP {i}||SLIDER {param}"].bind(
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Shift-KeyPress-Right>", "||KEY SHIFT RIGHT")
|
||||||
f"<{event}-{direction}>", f"||KEY {direction.upper()} {event_id}"
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Control-KeyPress-Left>", "||KEY CTRL LEFT")
|
||||||
)
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Control-KeyPress-Right>", "||KEY CTRL RIGHT")
|
||||||
self[f"STRIP {i}||SLIDER {param}"].bind(
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Up>", "||KEY UP")
|
||||||
f"<Shift-{event}-{direction}>", f"||KEY SHIFT {direction.upper()} {event_id}"
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Down>", "||KEY DOWN")
|
||||||
)
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Shift-KeyPress-Up>", "||KEY SHIFT UP")
|
||||||
self[f"STRIP {i}||SLIDER {param}"].bind(
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Shift-KeyPress-Down>", "||KEY SHIFT DOWN")
|
||||||
f"<Control-{event}-{direction}>", f"||KEY CTRL {direction.upper()} {event_id}"
|
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-Shift-KeyPress-R>", "||KEY CTRL SHIFT R")
|
self[f"STRIP {i}||SLIDER {param}"].bind("<Control-Shift-KeyPress-R>", "||KEY CTRL SHIFT R")
|
||||||
|
|
||||||
# Bus Params
|
# Bus Params
|
||||||
@ -272,18 +270,18 @@ class NVDAVMWindow(psg.Window):
|
|||||||
for i in range(self.kind.num_bus):
|
for i in range(self.kind.num_bus):
|
||||||
self[f"BUS {i}||SLIDER GAIN"].bind("<FocusIn>", "||FOCUS IN")
|
self[f"BUS {i}||SLIDER GAIN"].bind("<FocusIn>", "||FOCUS IN")
|
||||||
self[f"BUS {i}||SLIDER GAIN"].bind("<FocusOut>", "||FOCUS OUT")
|
self[f"BUS {i}||SLIDER GAIN"].bind("<FocusOut>", "||FOCUS OUT")
|
||||||
for event in ("KeyPress", "KeyRelease"):
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Left>", "||KEY LEFT")
|
||||||
event_id = event.removeprefix("Key").upper()
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Right>", "||KEY RIGHT")
|
||||||
for direction in ("Left", "Right", "Up", "Down"):
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Shift-KeyPress-Left>", "||KEY SHIFT LEFT")
|
||||||
self[f"BUS {i}||SLIDER GAIN"].bind(
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Shift-KeyPress-Right>", "||KEY SHIFT RIGHT")
|
||||||
f"<{event}-{direction}>", f"||KEY {direction.upper()} {event_id}"
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Control-KeyPress-Left>", "||KEY CTRL LEFT")
|
||||||
)
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Control-KeyPress-Right>", "||KEY CTRL RIGHT")
|
||||||
self[f"BUS {i}||SLIDER GAIN"].bind(
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Up>", "||KEY UP")
|
||||||
f"<Shift-{event}-{direction}>", f"||KEY SHIFT {direction.upper()} {event_id}"
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Down>", "||KEY DOWN")
|
||||||
)
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Shift-KeyPress-Up>", "||KEY SHIFT UP")
|
||||||
self[f"BUS {i}||SLIDER GAIN"].bind(
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Shift-KeyPress-Down>", "||KEY SHIFT DOWN")
|
||||||
f"<Control-{event}-{direction}>", f"||KEY CTRL {direction.upper()} {event_id}"
|
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-Shift-KeyPress-R>", "||KEY CTRL SHIFT R")
|
self[f"BUS {i}||SLIDER GAIN"].bind("<Control-Shift-KeyPress-R>", "||KEY CTRL SHIFT R")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -303,25 +301,17 @@ class NVDAVMWindow(psg.Window):
|
|||||||
elif event.endswith("MODE"):
|
elif event.endswith("MODE"):
|
||||||
mode = event
|
mode = event
|
||||||
self.nvda.speak(f"{mode} enabled")
|
self.nvda.speak(f"{mode} enabled")
|
||||||
continue
|
elif event == "Escape:27":
|
||||||
elif event == "ESCAPE":
|
|
||||||
if mode:
|
if mode:
|
||||||
self.nvda.speak(f"{mode} disabled")
|
self.nvda.speak(f"{mode} disabled")
|
||||||
mode = None
|
mode = None
|
||||||
|
|
||||||
|
if mode:
|
||||||
|
if event in ("LEFT", "RIGHT", "SHIFT-LEFT", "SHIFT-RIGHT", "CTRL-LEFT", "CTRL-RIGHT"):
|
||||||
|
self.write_event_value(f"SLIDER-MODE-{event}", mode.split()[0])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
match parsed_cmd := self.parser.match.parseString(event):
|
match parsed_cmd := self.parser.match.parseString(event):
|
||||||
# Slide mode
|
|
||||||
case [["ALT", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction], ["PRESS" | "RELEASE" as e]]:
|
|
||||||
if mode:
|
|
||||||
self.write_event_value(f"SLIDER MODE {direction}||{e}", mode.split()[0])
|
|
||||||
case [
|
|
||||||
["ALT", "SHIFT" | "CTRL" as modifier, "LEFT" | "RIGHT" | "UP" | "DOWN" as direction],
|
|
||||||
["PRESS" | "RELEASE" as e],
|
|
||||||
]:
|
|
||||||
if mode:
|
|
||||||
self.write_event_value(f"SLIDER MODE {modifier} {direction}||{e}", mode.split()[0])
|
|
||||||
|
|
||||||
# Focus tabgroup
|
# Focus tabgroup
|
||||||
case ["CTRL-TAB"] | ["CTRL-SHIFT-TAB"]:
|
case ["CTRL-TAB"] | ["CTRL-SHIFT-TAB"]:
|
||||||
self["tabgroup"].set_focus()
|
self["tabgroup"].set_focus()
|
||||||
@ -389,19 +379,13 @@ class NVDAVMWindow(psg.Window):
|
|||||||
if focus := self.find_element_with_focus():
|
if focus := self.find_element_with_focus():
|
||||||
identifier, param = focus.Key.split("||")
|
identifier, param = focus.Key.split("||")
|
||||||
self.write_event_value(f"{identifier}||MUTE", None)
|
self.write_event_value(f"{identifier}||MUTE", None)
|
||||||
case [["SLIDER", "MODE", direction], ["PRESS" | "RELEASE" as e]]:
|
|
||||||
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
|
|
||||||
continue
|
|
||||||
param = values[event]
|
|
||||||
if focus := self.find_element_with_focus():
|
|
||||||
identifier, partial = focus.Key.split("||")
|
|
||||||
_, index = identifier.split()
|
|
||||||
if param in util.get_full_slider_params(int(index), self.kind):
|
|
||||||
if "SLIDER" not in partial:
|
|
||||||
self.write_event_value(f"{identifier}||SLIDER {param}||KEY {direction} {e}", None)
|
|
||||||
case [
|
case [
|
||||||
["SLIDER", "MODE", "SHIFT" | "CTRL" as modifier, direction],
|
"SLIDER-MODE-LEFT"
|
||||||
["PRESS" | "RELEASE" as e],
|
| "SLIDER-MODE-RIGHT"
|
||||||
|
| "SLIDER-MODE-SHIFT-LEFT"
|
||||||
|
| "SLIDER-MODE-SHIFT-RIGHT"
|
||||||
|
| "SLIDER-MODE-CTRL-LEFT"
|
||||||
|
| "SLIDER-MODE-CTRL-RIGHT" as op
|
||||||
]:
|
]:
|
||||||
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
|
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
|
||||||
continue
|
continue
|
||||||
@ -411,12 +395,11 @@ class NVDAVMWindow(psg.Window):
|
|||||||
_, index = identifier.split()
|
_, index = identifier.split()
|
||||||
if param in util.get_full_slider_params(int(index), self.kind):
|
if param in util.get_full_slider_params(int(index), self.kind):
|
||||||
if "SLIDER" not in partial:
|
if "SLIDER" not in partial:
|
||||||
self.write_event_value(
|
op = op.removeprefix("SLIDER-MODE-").split("-")
|
||||||
f"{identifier}||SLIDER {param}||KEY {modifier} {direction} {e}", None
|
self.write_event_value(f"{identifier}||SLIDER {param}||KEY {' '.join(op)}", None)
|
||||||
)
|
|
||||||
|
|
||||||
# Rename popups
|
# Rename popups
|
||||||
case ["F2"]:
|
case ["F2:113"]:
|
||||||
tab = values["tabgroup"].split("||")[1]
|
tab = values["tabgroup"].split("||")[1]
|
||||||
if tab in ("Physical Strip", "Virtual Strip", "Buses"):
|
if tab in ("Physical Strip", "Virtual Strip", "Buses"):
|
||||||
if focus := self.find_element_with_focus():
|
if focus := self.find_element_with_focus():
|
||||||
@ -728,6 +711,7 @@ class NVDAVMWindow(psg.Window):
|
|||||||
["FOCUS", "IN"],
|
["FOCUS", "IN"],
|
||||||
]:
|
]:
|
||||||
if self.find_element_with_focus() is not None:
|
if self.find_element_with_focus() is not None:
|
||||||
|
self.vm.event.pdirty = False
|
||||||
val = values[f"STRIP {index}||SLIDER {param}"]
|
val = values[f"STRIP {index}||SLIDER {param}"]
|
||||||
label = self.cache["labels"][f"STRIP {index}||LABEL"]
|
label = self.cache["labels"][f"STRIP {index}||LABEL"]
|
||||||
self.nvda.speak(f"{label} {param} {int(val) if param == 'LIMIT' else val}")
|
self.nvda.speak(f"{label} {param} {int(val) if param == 'LIMIT' else val}")
|
||||||
@ -739,7 +723,7 @@ class NVDAVMWindow(psg.Window):
|
|||||||
],
|
],
|
||||||
["FOCUS", "OUT"],
|
["FOCUS", "OUT"],
|
||||||
]:
|
]:
|
||||||
pass
|
self.vm.event.pdirty = True
|
||||||
case [
|
case [
|
||||||
["STRIP", index],
|
["STRIP", index],
|
||||||
[
|
[
|
||||||
@ -754,10 +738,8 @@ class NVDAVMWindow(psg.Window):
|
|||||||
| "MID"
|
| "MID"
|
||||||
| "TREBLE" as param,
|
| "TREBLE" as param,
|
||||||
],
|
],
|
||||||
["KEY", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction, "PRESS" | "RELEASE" as e],
|
["KEY", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction],
|
||||||
]:
|
]:
|
||||||
if e == "PRESS":
|
|
||||||
self.vm.event.pdirty = False
|
|
||||||
match param:
|
match param:
|
||||||
case "GAIN":
|
case "GAIN":
|
||||||
val = self.vm.strip[int(index)].gain
|
val = self.vm.strip[int(index)].gain
|
||||||
@ -799,8 +781,6 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.vm.strip[int(index)].limit = val
|
self.vm.strip[int(index)].limit = val
|
||||||
self[f"STRIP {index}||SLIDER {param}"].update(value=val)
|
self[f"STRIP {index}||SLIDER {param}"].update(value=val)
|
||||||
self.nvda.speak(str(val))
|
self.nvda.speak(str(val))
|
||||||
else:
|
|
||||||
self.vm.event.pdirty = True
|
|
||||||
case [
|
case [
|
||||||
["STRIP", index],
|
["STRIP", index],
|
||||||
[
|
[
|
||||||
@ -815,10 +795,8 @@ class NVDAVMWindow(psg.Window):
|
|||||||
| "MID"
|
| "MID"
|
||||||
| "TREBLE" as param,
|
| "TREBLE" as param,
|
||||||
],
|
],
|
||||||
["KEY", "CTRL", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction, "PRESS" | "RELEASE" as e],
|
["KEY", "CTRL", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction],
|
||||||
]:
|
]:
|
||||||
if e == "PRESS":
|
|
||||||
self.vm.event.pdirty = False
|
|
||||||
match param:
|
match param:
|
||||||
case "GAIN":
|
case "GAIN":
|
||||||
val = self.vm.strip[int(index)].gain
|
val = self.vm.strip[int(index)].gain
|
||||||
@ -866,8 +844,6 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.vm.strip[int(index)].limit = val
|
self.vm.strip[int(index)].limit = val
|
||||||
self[f"STRIP {index}||SLIDER {param}"].update(value=val)
|
self[f"STRIP {index}||SLIDER {param}"].update(value=val)
|
||||||
self.nvda.speak(f"{param} {val}")
|
self.nvda.speak(f"{param} {val}")
|
||||||
else:
|
|
||||||
self.vm.event.pdirty = True
|
|
||||||
case [
|
case [
|
||||||
["STRIP", index],
|
["STRIP", index],
|
||||||
[
|
[
|
||||||
@ -882,10 +858,8 @@ class NVDAVMWindow(psg.Window):
|
|||||||
| "MID"
|
| "MID"
|
||||||
| "TREBLE" as param,
|
| "TREBLE" as param,
|
||||||
],
|
],
|
||||||
["KEY", "SHIFT", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction, "PRESS" | "RELEASE" as e],
|
["KEY", "SHIFT", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction],
|
||||||
]:
|
]:
|
||||||
if e == "PRESS":
|
|
||||||
self.vm.event.pdirty = False
|
|
||||||
match param:
|
match param:
|
||||||
case "GAIN":
|
case "GAIN":
|
||||||
val = self.vm.strip[int(index)].gain
|
val = self.vm.strip[int(index)].gain
|
||||||
@ -933,8 +907,6 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.vm.strip[int(index)].limit = val
|
self.vm.strip[int(index)].limit = val
|
||||||
self[f"STRIP {index}||SLIDER {param}"].update(value=val)
|
self[f"STRIP {index}||SLIDER {param}"].update(value=val)
|
||||||
self.nvda.speak(f"{param} {val}")
|
self.nvda.speak(f"{param} {val}")
|
||||||
else:
|
|
||||||
self.vm.event.pdirty = True
|
|
||||||
case [["STRIP", index], ["SLIDER", param], ["KEY", "CTRL", "SHIFT", "R"]]:
|
case [["STRIP", index], ["SLIDER", param], ["KEY", "CTRL", "SHIFT", "R"]]:
|
||||||
match param:
|
match param:
|
||||||
case "GAIN":
|
case "GAIN":
|
||||||
@ -1020,18 +992,13 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.vm.bus[int(index)].gain = val
|
self.vm.bus[int(index)].gain = val
|
||||||
case [["BUS", index], ["SLIDER", "GAIN"], ["FOCUS", "IN"]]:
|
case [["BUS", index], ["SLIDER", "GAIN"], ["FOCUS", "IN"]]:
|
||||||
if self.find_element_with_focus() is not None:
|
if self.find_element_with_focus() is not None:
|
||||||
|
self.vm.event.pdirty = False
|
||||||
label = self.cache["labels"][f"BUS {index}||LABEL"]
|
label = self.cache["labels"][f"BUS {index}||LABEL"]
|
||||||
val = values[f"BUS {index}||SLIDER GAIN"]
|
val = values[f"BUS {index}||SLIDER GAIN"]
|
||||||
self.nvda.speak(f"{label} gain {val}")
|
self.nvda.speak(f"{label} gain {val}")
|
||||||
case [["BUS", index], ["SLIDER", "GAIN"], ["FOCUS", "OUT"]]:
|
case [["BUS", index], ["SLIDER", "GAIN"], ["FOCUS", "OUT"]]:
|
||||||
pass
|
self.vm.event.pdirty = True
|
||||||
case [
|
case [["BUS", index], ["SLIDER", "GAIN"], ["KEY", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction]]:
|
||||||
["BUS", index],
|
|
||||||
["SLIDER", "GAIN"],
|
|
||||||
["KEY", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction, "PRESS" | "RELEASE" as e],
|
|
||||||
]:
|
|
||||||
if e == "PRESS":
|
|
||||||
self.vm.event.pdirty = False
|
|
||||||
val = self.vm.bus[int(index)].gain
|
val = self.vm.bus[int(index)].gain
|
||||||
match direction:
|
match direction:
|
||||||
case "RIGHT" | "UP":
|
case "RIGHT" | "UP":
|
||||||
@ -1042,15 +1009,11 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.vm.bus[int(index)].gain = val
|
self.vm.bus[int(index)].gain = val
|
||||||
self[f"BUS {index}||SLIDER GAIN"].update(value=val)
|
self[f"BUS {index}||SLIDER GAIN"].update(value=val)
|
||||||
self.nvda.speak(str(val))
|
self.nvda.speak(str(val))
|
||||||
else:
|
|
||||||
self.vm.event.pdirty = True
|
|
||||||
case [
|
case [
|
||||||
["BUS", index],
|
["BUS", index],
|
||||||
["SLIDER", "GAIN"],
|
["SLIDER", "GAIN"],
|
||||||
["KEY", "CTRL", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction, "PRESS" | "RELEASE" as e],
|
["KEY", "CTRL", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction],
|
||||||
]:
|
]:
|
||||||
if e == "PRESS":
|
|
||||||
self.vm.event.pdirty = False
|
|
||||||
val = self.vm.bus[int(index)].gain
|
val = self.vm.bus[int(index)].gain
|
||||||
match direction:
|
match direction:
|
||||||
case "RIGHT" | "UP":
|
case "RIGHT" | "UP":
|
||||||
@ -1061,15 +1024,11 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.vm.bus[int(index)].gain = val
|
self.vm.bus[int(index)].gain = val
|
||||||
self[f"BUS {index}||SLIDER GAIN"].update(value=val)
|
self[f"BUS {index}||SLIDER GAIN"].update(value=val)
|
||||||
self.nvda.speak(str(val))
|
self.nvda.speak(str(val))
|
||||||
else:
|
|
||||||
self.vm.event.pdirty = True
|
|
||||||
case [
|
case [
|
||||||
["BUS", index],
|
["BUS", index],
|
||||||
["SLIDER", "GAIN"],
|
["SLIDER", "GAIN"],
|
||||||
["KEY", "SHIFT", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction, "PRESS" | "RELEASE" as e],
|
["KEY", "SHIFT", "LEFT" | "RIGHT" | "UP" | "DOWN" as direction],
|
||||||
]:
|
]:
|
||||||
if e == "PRESS":
|
|
||||||
self.vm.event.pdirty = False
|
|
||||||
val = self.vm.bus[int(index)].gain
|
val = self.vm.bus[int(index)].gain
|
||||||
match direction:
|
match direction:
|
||||||
case "RIGHT" | "UP":
|
case "RIGHT" | "UP":
|
||||||
@ -1080,8 +1039,6 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self.vm.bus[int(index)].gain = val
|
self.vm.bus[int(index)].gain = val
|
||||||
self[f"BUS {index}||SLIDER GAIN"].update(value=val)
|
self[f"BUS {index}||SLIDER GAIN"].update(value=val)
|
||||||
self.nvda.speak(str(val))
|
self.nvda.speak(str(val))
|
||||||
else:
|
|
||||||
self.vm.event.pdirty = True
|
|
||||||
case [["BUS", index], ["SLIDER", "GAIN"], ["KEY", "CTRL", "SHIFT", "R"]]:
|
case [["BUS", index], ["SLIDER", "GAIN"], ["KEY", "CTRL", "SHIFT", "R"]]:
|
||||||
self.vm.bus[int(index)].gain = 0
|
self.vm.bus[int(index)].gain = 0
|
||||||
self[f"BUS {index}||SLIDER GAIN"].update(value=0)
|
self[f"BUS {index}||SLIDER GAIN"].update(value=0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user