diff --git a/pyproject.toml b/pyproject.toml index 5e21e95..931c0b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nvda_voicemeeter" -version = "0.1.4" +version = "0.1.5" description = "A Voicemeeter app compatible with NVDA" authors = [ { name = "onyx-and-iris", email = "code@onyxandiris.online" }, diff --git a/src/nvda_voicemeeter/util.py b/src/nvda_voicemeeter/util.py index f38a2bd..02ad543 100644 --- a/src/nvda_voicemeeter/util.py +++ b/src/nvda_voicemeeter/util.py @@ -13,12 +13,28 @@ def get_insert_checkbox_index(kind, channel, num) -> int: return (2 * kind.phys_in) + (8 * (num - kind.phys_in - 1)) + channel +_rejected_ids = ( + "VBAudio100VMVAIO3", + "{F5735BD4-6EAF-4758-9710-9886E5AD0FF3}", + "{0239BE07-CEEF-4236-A900-AA778D432FD4}", +) + + def get_input_device_list(vm) -> list: - return ["{type}: {name}".format(**vm.device.input(i)) for i in range(vm.device.ins)] + devices = [] + for j in range(vm.device.ins): + device = vm.device.input(j) + if device["id"] not in _rejected_ids: + devices.append("{type}: {name}".format(**device)) + return devices def get_output_device_list(i, vm) -> list: - devices = ["{type}: {name}".format(**vm.device.output(j)) for j in range(vm.device.outs)] + devices = [] + for j in range(vm.device.outs): + device = vm.device.output(j) + if device["id"] not in _rejected_ids: + devices.append("{type}: {name}".format(**device)) if i == 0: return devices devices.append("- remove device selection -") diff --git a/src/nvda_voicemeeter/window.py b/src/nvda_voicemeeter/window.py index d677716..ecfbcfa 100644 --- a/src/nvda_voicemeeter/window.py +++ b/src/nvda_voicemeeter/window.py @@ -431,7 +431,7 @@ class NVDAVMWindow(psg.Window): setattr(self.vm.bus[index].device, "wdm", "") self.TKroot.after(200, self.nvda.speak, f"HARDWARE OUT {key} device selection removed") case [driver, device_name]: - setattr(self.vm.bus[index].device, driver, device_name.strip()) + setattr(self.vm.bus[index].device, driver, device_name.lstrip()) phonetic = {"mme": "em em e"} self.TKroot.after( 200,