mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2026-04-07 18:03:35 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2562c02b7e | |||
| aaa2c72668 | |||
| 7648b68b85 | |||
| 5069db97da | |||
| 681bf8e85c | |||
| 8424558f3d | |||
| 39bd5f21ea | |||
| 77dfd00541 | |||
| 790ac10d4a |
12
README.md
12
README.md
@@ -42,7 +42,7 @@ with voicemeeterlib.api(KIND_ID, sync=True) as vm:
|
|||||||
window.run()
|
window.run()
|
||||||
```
|
```
|
||||||
|
|
||||||
### `KIND_ID`
|
### KIND_ID
|
||||||
|
|
||||||
May be one of the following:
|
May be one of the following:
|
||||||
|
|
||||||
@@ -84,6 +84,16 @@ The `Save Settings` option opens a popup window with two buttons, `Browse` and `
|
|||||||
|
|
||||||
If you have any questions/suggestions feel free to raise an issue or open a new discussion.
|
If you have any questions/suggestions feel free to raise an issue or open a new discussion.
|
||||||
|
|
||||||
|
### Special Thanks
|
||||||
|
|
||||||
|
[Mario Loreti](https://www.marioloreti.net/en/) for his help in testing and offering feedback during development.
|
||||||
|
|
||||||
|
[NVAccess](https://www.nvaccess.org/) for creating the open source NVDA screen reader and its controller client.
|
||||||
|
|
||||||
|
[Vincent Burel](https://github.com/vburel2018) for creating Voicemeeter and its SDK.
|
||||||
|
|
||||||
|
[PySimpleGUI](https://github.com/PySimpleGUI) team for creating an awesome GUI framework.
|
||||||
|
|
||||||
[voicemeeter]: https://voicemeeter.com/
|
[voicemeeter]: https://voicemeeter.com/
|
||||||
[nvda]: https://www.nvaccess.org/
|
[nvda]: https://www.nvaccess.org/
|
||||||
[controller_client]: https://github.com/nvaccess/nvda/tree/master/extras/controllerClient
|
[controller_client]: https://github.com/nvaccess/nvda/tree/master/extras/controllerClient
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "nvda_voicemeeter"
|
name = "nvda_voicemeeter"
|
||||||
version = "0.1.1"
|
version = "0.1.5"
|
||||||
description = "A Voicemeeter app compatible with NVDA"
|
description = "A Voicemeeter app compatible with NVDA"
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "onyx-and-iris", email = "code@onyxandiris.online" },
|
{ name = "onyx-and-iris", email = "code@onyxandiris.online" },
|
||||||
|
|||||||
@@ -102,8 +102,6 @@ class Builder:
|
|||||||
"""tab0 row1 represents hardware outs"""
|
"""tab0 row1 represents hardware outs"""
|
||||||
|
|
||||||
def add_physical_device_opts(layout):
|
def add_physical_device_opts(layout):
|
||||||
devices = get_output_device_list(self.vm)
|
|
||||||
devices.append("- remove device selection -")
|
|
||||||
if self.kind.name == "basic":
|
if self.kind.name == "basic":
|
||||||
num_outs = self.kind.phys_out + self.kind.virt_out
|
num_outs = self.kind.phys_out + self.kind.virt_out
|
||||||
else:
|
else:
|
||||||
@@ -113,7 +111,7 @@ class Builder:
|
|||||||
psg.ButtonMenu(
|
psg.ButtonMenu(
|
||||||
f"A{i + 1}",
|
f"A{i + 1}",
|
||||||
size=(6, 3),
|
size=(6, 3),
|
||||||
menu_def=["", devices],
|
menu_def=["", get_output_device_list(i, self.vm)],
|
||||||
key=f"HARDWARE OUT||A{i + 1}",
|
key=f"HARDWARE OUT||A{i + 1}",
|
||||||
)
|
)
|
||||||
for i in range(num_outs)
|
for i in range(num_outs)
|
||||||
@@ -325,12 +323,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
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,32 @@ def get_insert_checkbox_index(kind, channel, num) -> int:
|
|||||||
return (2 * kind.phys_in) + (8 * (num - kind.phys_in - 1)) + channel
|
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:
|
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(vm) -> list:
|
def get_output_device_list(i, vm) -> list:
|
||||||
return ["{type}: {name}".format(**vm.device.output(i)) for i 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 -")
|
||||||
|
return [device for device in devices if not device.startswith("asio")]
|
||||||
|
|
||||||
|
|
||||||
def get_patch_composite_list(kind) -> list:
|
def get_patch_composite_list(kind) -> list:
|
||||||
@@ -94,7 +114,14 @@ def get_channel_identifier_list(vm) -> list:
|
|||||||
return identifiers
|
return identifiers
|
||||||
|
|
||||||
|
|
||||||
def get_bus_modes() -> list:
|
def get_bus_modes(vm) -> list:
|
||||||
|
if vm.kind.name == "basic":
|
||||||
|
return [
|
||||||
|
"normal",
|
||||||
|
"amix",
|
||||||
|
"repeat",
|
||||||
|
"composite",
|
||||||
|
]
|
||||||
return [
|
return [
|
||||||
"normal",
|
"normal",
|
||||||
"amix",
|
"amix",
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|
||||||
@@ -234,9 +237,9 @@ class NVDAVMWindow(psg.Window):
|
|||||||
|
|
||||||
def popup_rename(self, message, title=None, tab=None):
|
def popup_rename(self, message, title=None, tab=None):
|
||||||
if tab == "Physical Strip":
|
if tab == "Physical Strip":
|
||||||
upper = self.kind.phys_out + 1
|
upper = self.kind.phys_in + 1
|
||||||
elif tab == "Virtual Strip":
|
elif tab == "Virtual Strip":
|
||||||
upper = self.kind.virt_out + 1
|
upper = self.kind.virt_in + 1
|
||||||
elif tab == "Buses":
|
elif tab == "Buses":
|
||||||
upper = self.kind.num_bus + 1
|
upper = self.kind.num_bus + 1
|
||||||
|
|
||||||
@@ -320,7 +323,8 @@ class NVDAVMWindow(psg.Window):
|
|||||||
self[f"STRIP {index}||LABEL"].update(value=label)
|
self[f"STRIP {index}||LABEL"].update(value=label)
|
||||||
self.cache["labels"][f"STRIP {index}||LABEL"] = label
|
self.cache["labels"][f"STRIP {index}||LABEL"] = label
|
||||||
case "Virtual Strip":
|
case "Virtual Strip":
|
||||||
label = data.get("Edit") or f"Virtual Input {index + 1}"
|
index += self.kind.phys_in
|
||||||
|
label = data.get("Edit") or f"Virtual Input {index - self.kind.phys_in + 1}"
|
||||||
self.vm.strip[index].label = label
|
self.vm.strip[index].label = label
|
||||||
self[f"STRIP {index}||LABEL"].update(value=label)
|
self[f"STRIP {index}||LABEL"].update(value=label)
|
||||||
self.cache["labels"][f"STRIP {index}||LABEL"] = label
|
self.cache["labels"][f"STRIP {index}||LABEL"] = label
|
||||||
@@ -406,7 +410,7 @@ class NVDAVMWindow(psg.Window):
|
|||||||
setattr(self.vm.strip[index].device, "wdm", "")
|
setattr(self.vm.strip[index].device, "wdm", "")
|
||||||
self.TKroot.after(200, self.nvda.speak, f"HARDWARE IN {key} device selection removed")
|
self.TKroot.after(200, self.nvda.speak, f"HARDWARE IN {key} device selection removed")
|
||||||
case [driver, device_name]:
|
case [driver, device_name]:
|
||||||
setattr(self.vm.strip[index].device, driver, device_name.strip())
|
setattr(self.vm.strip[index].device, driver, device_name.lstrip())
|
||||||
phonetic = {"mme": "em em e"}
|
phonetic = {"mme": "em em e"}
|
||||||
self.TKroot.after(
|
self.TKroot.after(
|
||||||
200,
|
200,
|
||||||
@@ -427,7 +431,7 @@ class NVDAVMWindow(psg.Window):
|
|||||||
setattr(self.vm.bus[index].device, "wdm", "")
|
setattr(self.vm.bus[index].device, "wdm", "")
|
||||||
self.TKroot.after(200, self.nvda.speak, f"HARDWARE OUT {key} device selection removed")
|
self.TKroot.after(200, self.nvda.speak, f"HARDWARE OUT {key} device selection removed")
|
||||||
case [driver, device_name]:
|
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"}
|
phonetic = {"mme": "em em e"}
|
||||||
self.TKroot.after(
|
self.TKroot.after(
|
||||||
200,
|
200,
|
||||||
@@ -583,7 +587,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
|
||||||
|
|||||||
Reference in New Issue
Block a user