remove asio devices from hardware out context menus

if not A1

removes `-remove device selection-` from hardware out A1 context menu

patch bump

fixes #7
This commit is contained in:
onyx-and-iris 2023-09-11 12:36:40 +01:00
parent 5069db97da
commit 7648b68b85
3 changed files with 8 additions and 6 deletions

View File

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

View File

@ -102,8 +102,6 @@ class Builder:
"""tab0 row1 represents hardware outs"""
def add_physical_device_opts(layout):
devices = get_output_device_list(self.vm)
devices.append("- remove device selection -")
if self.kind.name == "basic":
num_outs = self.kind.phys_out + self.kind.virt_out
else:
@ -113,7 +111,7 @@ class Builder:
psg.ButtonMenu(
f"A{i + 1}",
size=(6, 3),
menu_def=["", devices],
menu_def=["", get_output_device_list(i, self.vm)],
key=f"HARDWARE OUT||A{i + 1}",
)
for i in range(num_outs)

View File

@ -17,8 +17,12 @@ def get_input_device_list(vm) -> list:
return ["{type}: {name}".format(**vm.device.input(i)) for i in range(vm.device.ins)]
def get_output_device_list(vm) -> list:
return ["{type}: {name}".format(**vm.device.output(i)) for i in range(vm.device.outs)]
def get_output_device_list(i, vm) -> list:
devices = ["{type}: {name}".format(**vm.device.output(j)) for j in range(vm.device.outs)]
if i == 0:
return devices
devices.append("- remove device selection -")
return [device for device in devices if not device.startswith("asio")]
def get_patch_composite_list(kind) -> list: