mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2024-11-22 18:00:50 +00:00
add deselect device to hardware outs
This commit is contained in:
parent
65cd21203b
commit
740cf1ac02
@ -31,6 +31,7 @@ class Window(psg.Window):
|
|||||||
|
|
||||||
def add_physical_device_opts(layout):
|
def add_physical_device_opts(layout):
|
||||||
devices = ["{type}: {name}".format(**self.vm.device.output(i)) for i in range(self.vm.device.outs)]
|
devices = ["{type}: {name}".format(**self.vm.device.output(i)) for i in range(self.vm.device.outs)]
|
||||||
|
devices.append("Deselect Device")
|
||||||
layout.append(
|
layout.append(
|
||||||
[
|
[
|
||||||
psg.Combo(
|
psg.Combo(
|
||||||
@ -38,6 +39,7 @@ class Window(psg.Window):
|
|||||||
size=(22, 4),
|
size=(22, 4),
|
||||||
expand_x=True,
|
expand_x=True,
|
||||||
enable_events=True,
|
enable_events=True,
|
||||||
|
readonly=True,
|
||||||
key=f"HARDWARE OUT||A{i}",
|
key=f"HARDWARE OUT||A{i}",
|
||||||
)
|
)
|
||||||
for i in range(1, self.kind.phys_out + 1)
|
for i in range(1, self.kind.phys_out + 1)
|
||||||
@ -98,7 +100,11 @@ class Window(psg.Window):
|
|||||||
match self.parser.match.parseString(event):
|
match self.parser.match.parseString(event):
|
||||||
case [["HARDWARE", "OUT"], [key]]:
|
case [["HARDWARE", "OUT"], [key]]:
|
||||||
selection = values[f"HARDWARE OUT||{key}"]
|
selection = values[f"HARDWARE OUT||{key}"]
|
||||||
driver, device_name = selection.split(":")
|
match selection.split(":"):
|
||||||
|
case [device_name]:
|
||||||
|
device_name = ""
|
||||||
|
self.nvda.speak(f"HARDWARE OUT {key} device deselected")
|
||||||
|
case [driver, device_name]:
|
||||||
index = int(key[1]) - 1
|
index = int(key[1]) - 1
|
||||||
setattr(self.vm.bus[index].device, driver, device_name.strip())
|
setattr(self.vm.bus[index].device, driver, device_name.strip())
|
||||||
self.nvda.speak(f"{driver} {selection}")
|
self.nvda.speak(f"{driver} {selection}")
|
||||||
|
Loading…
Reference in New Issue
Block a user