Skip to content

Commit

Permalink
remove asio devices from hardware out context menus
Browse files Browse the repository at this point in the history
if not A1

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

patch bump

fixes #7
  • Loading branch information
onyx-and-iris committed Sep 11, 2023
1 parent 5069db9 commit 7648b68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" },
Expand Down
4 changes: 1 addition & 3 deletions src/nvda_voicemeeter/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ def make_tab0_row1(self) -> psg.Frame:
"""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:
Expand All @@ -113,7 +111,7 @@ def add_physical_device_opts(layout):
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)
Expand Down
8 changes: 6 additions & 2 deletions src/nvda_voicemeeter/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7648b68

Please sign in to comment.