swap COMPOSITE for BUSMODE

This commit is contained in:
onyx-and-iris 2023-08-28 21:21:26 +01:00
parent 417a35764b
commit 786b2658d9
3 changed files with 13 additions and 13 deletions

View File

@ -271,7 +271,7 @@ class Builder:
"""tab3 row represents bus composite toggle"""
def add_strip_outputs(layout):
layout.append([psg.Button(f"COMPOSITE", size=(16, 2), key=f"BUS {i}||COMPOSITE")])
layout.append([psg.Button(f"BUSMODE", size=(16, 2), key=f"BUS {i}||MODE")])
buses = list()
[step(buses) for step in (add_strip_outputs,)]

View File

@ -27,4 +27,4 @@ def _make_output_cache(vm) -> dict:
def _make_bus_mode_cache(vm) -> dict:
return {**{f"BUS {i}||COMPOSITE": vm.bus[i].mode.get() for i in range(vm.kind.num_bus)}}
return {**{f"BUS {i}||MODE": vm.bus[i].mode.get() for i in range(vm.kind.num_bus)}}

View File

@ -37,7 +37,7 @@ class NVDAVMWindow(psg.Window):
self[f"HARDWARE OUT||A{i + 1}"].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["ASIO BUFFER"].Widget.config(**buttonmenu_opts)
self["ASIO BUFFER"].Widget.config(**buttonmenu_opts)
self.register_events()
self.current_focus = None
@ -92,15 +92,15 @@ class NVDAVMWindow(psg.Window):
self[f"STRIP {i}||B{j + 1}"].bind("<FocusIn>", "||FOCUS IN")
self[f"STRIP {i}||B{j + 1}"].bind("<Return>", "||KEY ENTER")
# Bus Composites
# Bus Modes
for i in range(self.kind.num_bus):
self[f"BUS {i}||COMPOSITE"].bind("<FocusIn>", "||FOCUS IN")
self["ASIO BUFFER"].bind("<Return>", "||KEY ENTER")
self[f"BUS {i}||MODE"].bind("<FocusIn>", "||FOCUS IN")
# ASIO Buffer
self["ASIO BUFFER"].bind("<FocusIn>", "||FOCUS IN")
self["ASIO BUFFER"].bind("<space>", "||KEY SPACE", propagate=False)
self["ASIO BUFFER"].bind("<Return>", "||KEY ENTER", propagate=False)
if self.kind.name != "basic":
self["ASIO BUFFER"].bind("<FocusIn>", "||FOCUS IN")
self["ASIO BUFFER"].bind("<space>", "||KEY SPACE", propagate=False)
self["ASIO BUFFER"].bind("<Return>", "||KEY ENTER", propagate=False)
def run(self):
"""
@ -246,8 +246,8 @@ class NVDAVMWindow(psg.Window):
case [["STRIP", index], [output], ["KEY", "ENTER"]]:
self.find_element_with_focus().click()
# Bus composite
case [["BUS", index], ["COMPOSITE"]]:
# Bus modes
case [["BUS", index], ["MODE"]]:
val = self.cache["busmode"][event]
if val != "normal":
self.vm.bus[int(index)].mode.normal = True
@ -261,10 +261,10 @@ class NVDAVMWindow(psg.Window):
self.nvda.speak,
f"BUS {index} {label if label else ''} bus mode {self.cache['busmode'][event]}",
)
case [["BUS", index], ["COMPOSITE"], ["FOCUS", "IN"]]:
case [["BUS", index], ["MODE"], ["FOCUS", "IN"]]:
label = self.vm.bus[int(index)].label
self.nvda.speak(
f"BUS {index} {label if label else ''} bus mode {self.cache['busmode'][f'BUS {index}||COMPOSITE']}"
f"BUS {index} {label if label else ''} bus mode {self.cache['busmode'][f'BUS {index}||MODE']}"
)
# Unknown