remove EQ button and events if kind is basic

This commit is contained in:
onyx-and-iris 2023-09-06 19:18:14 +01:00
parent ed5f9ae45b
commit 790ac10d4a
2 changed files with 15 additions and 6 deletions

View File

@ -325,12 +325,18 @@ class Builder:
"""tab3 row represents bus composite toggle""" """tab3 row represents bus composite toggle"""
def add_strip_outputs(layout): def add_strip_outputs(layout):
params = ["MONO", "EQ", "MUTE", "MODE"]
if self.vm.kind.name == "basic":
params.remove("EQ")
label = {"MODE": "BUSMODE"}
layout.append( layout.append(
[ [
psg.Button("Mono", size=(6, 2), key=f"BUS {i}||MONO"), psg.Button(
psg.Button("EQ", size=(6, 2), key=f"BUS {i}||EQ"), label.get(param, param.capitalize()),
psg.Button("Mute", size=(6, 2), key=f"BUS {i}||MUTE"), size=(12 if param == "MODE" else 6, 2),
psg.Button(f"BUSMODE", size=(12, 2), key=f"BUS {i}||MODE"), key=f"BUS {i}||{param}",
)
for param in params
] ]
) )

View File

@ -185,8 +185,11 @@ class NVDAVMWindow(psg.Window):
self[f"STRIP {i}||{param}"].bind("<Return>", "||KEY ENTER") self[f"STRIP {i}||{param}"].bind("<Return>", "||KEY ENTER")
# Bus Params # Bus Params
params = ["MONO", "EQ", "MUTE", "MODE"]
if self.vm.kind.name == "basic":
params.remove("EQ")
for i in range(self.kind.num_bus): for i in range(self.kind.num_bus):
for param in ("MONO", "EQ", "MUTE", "MODE"): for param in params:
self[f"BUS {i}||{param}"].bind("<FocusIn>", "||FOCUS IN") self[f"BUS {i}||{param}"].bind("<FocusIn>", "||FOCUS IN")
self[f"BUS {i}||{param}"].bind("<Return>", "||KEY ENTER") self[f"BUS {i}||{param}"].bind("<Return>", "||KEY ENTER")
@ -583,7 +586,7 @@ class NVDAVMWindow(psg.Window):
f"{label} bus {param} {'on' if val else 'off'}", f"{label} bus {param} {'on' if val else 'off'}",
) )
case "MODE": case "MODE":
bus_modes = get_bus_modes() bus_modes = get_bus_modes(self.vm)
next_index = bus_modes.index(val) + 1 next_index = bus_modes.index(val) + 1
if next_index == len(bus_modes): if next_index == len(bus_modes):
next_index = 0 next_index = 0