mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2026-04-07 18:03:35 +00:00
Compare commits
41 Commits
ml-1
...
v.0.2.1.b1
| Author | SHA1 | Date | |
|---|---|---|---|
| 78b7e01fa6 | |||
| 42fad86905 | |||
| 6c54d28210 | |||
| d958167ded | |||
| 0570138963 | |||
| 1fdb39a041 | |||
| 3d7b33c8be | |||
| cf5c8f81aa | |||
| c248808c7b | |||
| d93f078365 | |||
| e0f36b2411 | |||
| 719328c6de | |||
| 65a148aa7b | |||
| ba1fb28187 | |||
| e35bad9e1e | |||
| 804af85e65 | |||
| 96de917b64 | |||
| bc14116cd7 | |||
| 086fbc1b8c | |||
| 047577265c | |||
| 7ab7c30e80 | |||
| bfdc0306e3 | |||
| 245476adfd | |||
| 2562c02b7e | |||
| aaa2c72668 | |||
| 7648b68b85 | |||
| 14c6b937d1 | |||
| 5069db97da | |||
| 681bf8e85c | |||
| 8424558f3d | |||
| 39bd5f21ea | |||
| 77dfd00541 | |||
| 790ac10d4a | |||
| ed5f9ae45b | |||
| 962b61f60a | |||
| b2e03aace1 | |||
| 3a52655811 | |||
| 178d6e451b | |||
| fc8ae11555 | |||
| e4afe35fb2 | |||
| e2edd29b87 |
136
README.md
136
README.md
@@ -1 +1,135 @@
|
|||||||
# example-package
|
[](https://pdm.fming.dev)
|
||||||
|
[](https://github.com/psf/black)
|
||||||
|
[](https://pycqa.github.io/isort/)
|
||||||
|
|
||||||
|
# NVDA Voicemeeter
|
||||||
|
|
||||||
|
A remote control app for [Voicemeeter][voicemeeter], designed to be used with the [NVDA screen reader][nvda].
|
||||||
|
|
||||||
|
For an outline of this projects goals see the [SPECIFICATION][spec].
|
||||||
|
|
||||||
|
<img src="./img/settings.png" width=350 alt="Image of Voicemeeter NVDA app settings tab">
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- [NVDA screen reader][nvda]
|
||||||
|
- [NVDA's Controller Client files][controller_client]
|
||||||
|
- Python 3.10 or greater
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
#### `From Source`
|
||||||
|
|
||||||
|
First clone the source files from this repository and install the dependencies.
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/onyx-and-iris/nvda-voicemeeter.git
|
||||||
|
cd nvda-voicemeeter
|
||||||
|
pip install .
|
||||||
|
```
|
||||||
|
|
||||||
|
Then download the [Controller Client][controller_client] and place the dll files into the directory `controllerClient`.
|
||||||
|
|
||||||
|
Your directory structure should look like this:
|
||||||
|
|
||||||
|
├── `controllerClient/`
|
||||||
|
|
||||||
|
├── `x64/`
|
||||||
|
|
||||||
|
├── nvdaControllerClient64.dll
|
||||||
|
|
||||||
|
├── `x86/`
|
||||||
|
|
||||||
|
├── nvdaControllerClient32.dll
|
||||||
|
|
||||||
|
#### `From Releases`
|
||||||
|
|
||||||
|
If you want to get started quickly and easily I have uploaded some compiled versions of the app in the [Releases][releases] section.
|
||||||
|
|
||||||
|
### Run
|
||||||
|
|
||||||
|
Once the repository is downloaded and the controller client files in place you can launch the GUI with the following `__main__.py`:
|
||||||
|
|
||||||
|
```python
|
||||||
|
import voicemeeterlib
|
||||||
|
|
||||||
|
import nvda_voicemeeter
|
||||||
|
|
||||||
|
KIND_ID = "potato"
|
||||||
|
|
||||||
|
with voicemeeterlib.api(KIND_ID, sync=True) as vm:
|
||||||
|
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
|
||||||
|
window.run()
|
||||||
|
```
|
||||||
|
|
||||||
|
### KIND_ID
|
||||||
|
|
||||||
|
May be one of the following:
|
||||||
|
|
||||||
|
- `basic`
|
||||||
|
- `banana`
|
||||||
|
- `potato`
|
||||||
|
|
||||||
|
### Use
|
||||||
|
|
||||||
|
#### `Tabs`
|
||||||
|
|
||||||
|
The app presents four tabs `Settings`, `Physical Strip`, `Virtual Strip` and `Buses`. Navigate between the tabs with `Control + TAB` and `Control + SHIFT + TAB` or once focused on any tab, `Left` and `Right` arrow keys.
|
||||||
|
|
||||||
|
All controls within the tabs may be navigated between using `TAB`.
|
||||||
|
|
||||||
|
#### `Settings`
|
||||||
|
|
||||||
|
The following controls offer context menus accessed by pressing `SPACE` or `ENTER`:
|
||||||
|
|
||||||
|
- Hardware In
|
||||||
|
- Hardware Out
|
||||||
|
- Patch Composite
|
||||||
|
|
||||||
|
Press `ESCAPE` to exit any context menu.
|
||||||
|
|
||||||
|
All other buttons can be triggered by pressing `SPACE` or `ENTER`.
|
||||||
|
|
||||||
|
To adjust Patch Asio Inputs to Strips and Patch Insert values use `UP` and `DOWN` arrows when in focus.
|
||||||
|
|
||||||
|
To access Advanced Settings you may press the Advanced Settings button or use `Control + A` when in the `Settings` tab.
|
||||||
|
|
||||||
|
#### `Strip/Bus`
|
||||||
|
|
||||||
|
To rename a strip/bus channel navigate to the relevant tab, then press `F2`. This will open a popup window where you can set the channel index (with a spinbox) and set the new label using a text input box.
|
||||||
|
|
||||||
|
Pressing the `OK` button with an empty text input will clear the label. In this case the label will be read as a default value for that channel. For example, if the leftmost Strip label were cleared, the screen reader will now read `Hardware Input 1`.
|
||||||
|
|
||||||
|
Pressing `Cancel` will close the popup window with no affect on the label.
|
||||||
|
|
||||||
|
#### `Menu`
|
||||||
|
|
||||||
|
A single menu item `Voicemeeter` can be opened using `Alt` and then `v`. The menu allows you to:
|
||||||
|
|
||||||
|
- Restart Voicemeeter audio engine
|
||||||
|
- Save/Load current settings (as an xml file)
|
||||||
|
- Set a config to load automatically on app startup.
|
||||||
|
|
||||||
|
The `Save Settings` option opens a popup window with two buttons, `Browse` and `Cancel`. Browse opens a Save As dialog, Cancel returns to the main app window.
|
||||||
|
|
||||||
|
`Load Settings` and `Load on Startup` both open an Open dialog box immediately.
|
||||||
|
|
||||||
|
### Issues
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
[spec]: ./SPECIFICATION.md
|
||||||
|
[voicemeeter]: https://voicemeeter.com/
|
||||||
|
[nvda]: https://www.nvaccess.org/
|
||||||
|
[controller_client]: https://github.com/nvaccess/nvda/tree/master/extras/controllerClient
|
||||||
|
[releases]: https://github.com/onyx-and-iris/nvda-voicemeeter/releases
|
||||||
|
|||||||
30
SPECIFICATION.md
Normal file
30
SPECIFICATION.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Software Specification
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
A remote control utility for Voicemeeter designed to be used with the NVDA screen reader.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
#### Functional Goals
|
||||||
|
|
||||||
|
- Parameter updates caused by user input should be read back to the user via the screen reader.
|
||||||
|
- When focusing a control the current value for that control should be read back to the user.
|
||||||
|
- The application should scale correctly according to each kind of Voicemeeter (basic, banana, potato). This means the following:
|
||||||
|
- Correct number of strips/buses.
|
||||||
|
- Correct number of bus assignments for each strip.
|
||||||
|
- Where certain controls are valid for one kind they may not be for another.
|
||||||
|
- Where possible set limits on data entry and keep controls appropriate for the type of parameter.
|
||||||
|
|
||||||
|
#### Accessibility Goals
|
||||||
|
|
||||||
|
- Every control must be usable with a keyboard.
|
||||||
|
- Navigation around the application must be doable with a keyboard.
|
||||||
|
- Should use standard Windows controls only.
|
||||||
|
|
||||||
|
## Limitations
|
||||||
|
|
||||||
|
- May not cover 100% of the Voicemeeter GUI, for example the many EQ parameters.
|
||||||
|
- Only designed to work with the NVDA screen reader. Other screen readers not supported.
|
||||||
|
- Only the main Voicemeeter GUI supported by this application. No support for Matrix or other Voicemeeter products.
|
||||||
|
- Runs on Python version 3.10 or greater.
|
||||||
BIN
img/buses.png
Normal file
BIN
img/buses.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
img/physical_strip.png
Normal file
BIN
img/physical_strip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
img/settings.png
Normal file
BIN
img/settings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
BIN
img/virtual_strip.png
Normal file
BIN
img/virtual_strip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
8
pdm.lock
generated
8
pdm.lock
generated
@@ -6,7 +6,7 @@ groups = ["default", "build", "lint", "test"]
|
|||||||
cross_platform = true
|
cross_platform = true
|
||||||
static_urls = false
|
static_urls = false
|
||||||
lock_version = "4.3"
|
lock_version = "4.3"
|
||||||
content_hash = "sha256:2aaf88f0abb701968bc22eb31fd189810850a505bb93553f67216e4d1d259750"
|
content_hash = "sha256:ba53368b628b713c9cf4eb54e6f5c5c4af207c8e247d473417e4c2a4b47f645d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "altgraph"
|
name = "altgraph"
|
||||||
@@ -271,13 +271,13 @@ files = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "voicemeeter-api"
|
name = "voicemeeter-api"
|
||||||
version = "2.4.8"
|
version = "2.4.9"
|
||||||
requires_python = ">=3.10,<4.0"
|
requires_python = ">=3.10,<4.0"
|
||||||
summary = "A Python wrapper for the Voiceemeter API"
|
summary = "A Python wrapper for the Voiceemeter API"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tomli<3.0.0,>=2.0.1; python_version < \"3.11\"",
|
"tomli<3.0.0,>=2.0.1; python_version < \"3.11\"",
|
||||||
]
|
]
|
||||||
files = [
|
files = [
|
||||||
{file = "voicemeeter_api-2.4.8-py3-none-any.whl", hash = "sha256:a3ff9e6f7516d2adedde93f6976526b385d8ae6d86598bfe541a44f498f42ea6"},
|
{file = "voicemeeter_api-2.4.9-py3-none-any.whl", hash = "sha256:a09fd07fe3799cd5c880d491048da81d94e49aa97ec753aa1f9289acd27be965"},
|
||||||
{file = "voicemeeter_api-2.4.8.tar.gz", hash = "sha256:0d37a9f2af0f68087aa9c76a8cfb2ba44c6b75bb344e8dfa9fd18ad2c862730c"},
|
{file = "voicemeeter_api-2.4.9.tar.gz", hash = "sha256:47ad614a8b9ccb0b4e47acf65666ce0f0537a0890fffda9949e995bea70e679c"},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "nvda_voicemeeter"
|
name = "nvda_voicemeeter"
|
||||||
version = "0.1.0"
|
version = "0.2.1b1"
|
||||||
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" },
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pysimplegui>=4.60.5",
|
"pysimplegui>=4.60.5",
|
||||||
"pyparsing>=3.1.1",
|
"pyparsing>=3.1.1",
|
||||||
"voicemeeter-api>=2.4.8",
|
"voicemeeter-api>=2.4.9",
|
||||||
]
|
]
|
||||||
requires-python = ">=3.10,<3.11"
|
requires-python = ">=3.10,<3.12"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = {text = "MIT"}
|
|
||||||
|
[project.license]
|
||||||
|
text = "MIT"
|
||||||
|
|
||||||
[tool.pdm.dev-dependencies]
|
[tool.pdm.dev-dependencies]
|
||||||
build = [
|
build = [
|
||||||
@@ -26,5 +28,5 @@ test = [
|
|||||||
"psgdemos>=1.12.1",
|
"psgdemos>=1.12.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.pdm.scripts]
|
[tool.pdm.scripts.build]
|
||||||
build = {shell = "build.ps1"}
|
shell = "build.ps1"
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
import PySimpleGUI as psg
|
import PySimpleGUI as psg
|
||||||
|
|
||||||
from .util import (
|
from . import util
|
||||||
get_asio_checkbox_index,
|
from .compound import LabelSlider
|
||||||
get_asio_samples_list,
|
|
||||||
get_input_device_list,
|
|
||||||
get_insert_checkbox_index,
|
|
||||||
get_patch_composite_list,
|
|
||||||
get_tabs_labels,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class Builder:
|
class Builder:
|
||||||
@@ -23,7 +17,11 @@ class Builder:
|
|||||||
|
|
||||||
layout0 = []
|
layout0 = []
|
||||||
if self.kind.name == "basic":
|
if self.kind.name == "basic":
|
||||||
steps = (self.make_tab0_row0,)
|
steps = (
|
||||||
|
self.make_tab0_row0,
|
||||||
|
self.make_tab0_row1,
|
||||||
|
self.make_tab0_row5,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
steps = (
|
steps = (
|
||||||
self.make_tab0_row0,
|
self.make_tab0_row0,
|
||||||
@@ -31,29 +29,66 @@ class Builder:
|
|||||||
self.make_tab0_row2,
|
self.make_tab0_row2,
|
||||||
self.make_tab0_row3,
|
self.make_tab0_row3,
|
||||||
self.make_tab0_row4,
|
self.make_tab0_row4,
|
||||||
|
self.make_tab0_row5,
|
||||||
)
|
)
|
||||||
for step in steps:
|
for step in steps:
|
||||||
layout0.append([step()])
|
layout0.append([step()])
|
||||||
|
|
||||||
layout1 = []
|
layout1_1 = []
|
||||||
steps = (self.make_tab1_rows,)
|
steps = (self.make_tab1_button_rows,)
|
||||||
for step in steps:
|
for step in steps:
|
||||||
layout1.append([step()])
|
layout1_1.append([step()])
|
||||||
|
layout1_2 = []
|
||||||
layout2 = []
|
steps = (self.make_tab1_slider_rows,)
|
||||||
steps = (self.make_tab2_rows,)
|
|
||||||
for step in steps:
|
for step in steps:
|
||||||
layout2.append([step()])
|
layout1_2.append([step()])
|
||||||
|
|
||||||
layout3 = []
|
layout2_1 = []
|
||||||
steps = (self.make_tab3_rows,)
|
steps = (self.make_tab2_button_rows,)
|
||||||
for step in steps:
|
for step in steps:
|
||||||
layout3.append([step()])
|
layout2_1.append([step()])
|
||||||
|
layout2_2 = []
|
||||||
|
steps = (self.make_tab2_slider_rows,)
|
||||||
|
for step in steps:
|
||||||
|
layout2_2.append([step()])
|
||||||
|
|
||||||
layouts = [layout0, layout1, layout2, layout3]
|
layout3_1 = []
|
||||||
|
steps = (self.make_tab3_button_rows,)
|
||||||
|
for step in steps:
|
||||||
|
layout3_1.append([step()])
|
||||||
|
layout3_2 = []
|
||||||
|
steps = (self.make_tab3_slider_rows,)
|
||||||
|
for step in steps:
|
||||||
|
layout3_2.append([step()])
|
||||||
|
|
||||||
tabs = [psg.Tab(identifier, layouts[i], key=identifier) for i, identifier in enumerate(get_tabs_labels())]
|
def _make_inner_tabgroup(layouts, identifier) -> psg.TabGroup:
|
||||||
tab_group = psg.TabGroup([tabs], change_submits=True, key="tabs")
|
inner_layout = []
|
||||||
|
for i, tabname in enumerate(("buttons", "sliders")):
|
||||||
|
inner_layout.append([psg.Tab(tabname.capitalize(), layouts[i], key=f"tab||{identifier}||{tabname}")])
|
||||||
|
return psg.TabGroup(
|
||||||
|
inner_layout,
|
||||||
|
change_submits=True,
|
||||||
|
enable_events=True,
|
||||||
|
key=f"tabgroup||{identifier}",
|
||||||
|
)
|
||||||
|
|
||||||
|
def _make_tabs(identifier) -> psg.Tab:
|
||||||
|
match identifier:
|
||||||
|
case "Settings":
|
||||||
|
return psg.Tab("Settings", layout0, key="tab||Settings")
|
||||||
|
case "Physical Strip":
|
||||||
|
tabgroup = _make_inner_tabgroup((layout1_1, layout1_2), identifier)
|
||||||
|
case "Virtual Strip":
|
||||||
|
tabgroup = _make_inner_tabgroup((layout2_1, layout2_2), identifier)
|
||||||
|
case "Buses":
|
||||||
|
tabgroup = _make_inner_tabgroup((layout3_1, layout3_2), identifier)
|
||||||
|
return psg.Tab(identifier, [[tabgroup]], key=f"tab||{identifier}")
|
||||||
|
|
||||||
|
tabs = []
|
||||||
|
for tab in util.get_tabs_labels():
|
||||||
|
tabs.append(_make_tabs(tab))
|
||||||
|
|
||||||
|
tab_group = psg.TabGroup([tabs], change_submits=True, enable_events=True, key="tabgroup")
|
||||||
|
|
||||||
return [[menu], [tab_group]]
|
return [[menu], [tab_group]]
|
||||||
|
|
||||||
@@ -72,11 +107,31 @@ class Builder:
|
|||||||
return psg.Menu(menu_def, key="menus")
|
return psg.Menu(menu_def, key="menus")
|
||||||
|
|
||||||
def make_tab0_row0(self) -> psg.Frame:
|
def make_tab0_row0(self) -> psg.Frame:
|
||||||
"""tab0 row0 represents hardware outs"""
|
"""tab0 row0 represents hardware ins"""
|
||||||
|
|
||||||
def add_physical_device_opts(layout):
|
def add_physical_device_opts(layout):
|
||||||
devices = get_input_device_list(self.vm)
|
devices = util.get_input_device_list(self.vm)
|
||||||
devices.append("- remove device selection -")
|
devices.append("- remove device selection -")
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.ButtonMenu(
|
||||||
|
f"IN {i + 1}",
|
||||||
|
size=(6, 3),
|
||||||
|
menu_def=["", devices],
|
||||||
|
key=f"HARDWARE IN||{i + 1}",
|
||||||
|
)
|
||||||
|
for i in range(self.kind.phys_in)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
hardware_in = []
|
||||||
|
[step(hardware_in) for step in (add_physical_device_opts,)]
|
||||||
|
return psg.Frame("Hardware In", hardware_in)
|
||||||
|
|
||||||
|
def make_tab0_row1(self) -> psg.Frame:
|
||||||
|
"""tab0 row1 represents hardware outs"""
|
||||||
|
|
||||||
|
def add_physical_device_opts(layout):
|
||||||
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:
|
||||||
@@ -86,19 +141,19 @@ 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=["", util.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)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
hardware_out = list()
|
hardware_out = []
|
||||||
[step(hardware_out) for step in (add_physical_device_opts,)]
|
[step(hardware_out) for step in (add_physical_device_opts,)]
|
||||||
return psg.Frame("Hardware Out", hardware_out)
|
return psg.Frame("Hardware Out", hardware_out)
|
||||||
|
|
||||||
def make_tab0_row1(self) -> psg.Frame:
|
def make_tab0_row2(self) -> psg.Frame:
|
||||||
"""tab0 row1 represents patch asio inputs to strips"""
|
"""tab0 row2 represents patch asio inputs to strips"""
|
||||||
|
|
||||||
def add_asio_checkboxes(layout, i):
|
def add_asio_checkboxes(layout, i):
|
||||||
nums = list(range(99))
|
nums = list(range(99))
|
||||||
@@ -106,7 +161,7 @@ class Builder:
|
|||||||
[
|
[
|
||||||
psg.Spin(
|
psg.Spin(
|
||||||
nums,
|
nums,
|
||||||
initial_value=self.window.cache["asio"][f"ASIO CHECKBOX||{get_asio_checkbox_index(0, i)}"],
|
initial_value=self.window.cache["asio"][f"ASIO CHECKBOX||{util.get_asio_checkbox_index(0, i)}"],
|
||||||
size=2,
|
size=2,
|
||||||
enable_events=True,
|
enable_events=True,
|
||||||
key=f"ASIO CHECKBOX||IN{i} 0",
|
key=f"ASIO CHECKBOX||IN{i} 0",
|
||||||
@@ -117,7 +172,7 @@ class Builder:
|
|||||||
[
|
[
|
||||||
psg.Spin(
|
psg.Spin(
|
||||||
nums,
|
nums,
|
||||||
initial_value=self.window.cache["asio"][f"ASIO CHECKBOX||{get_asio_checkbox_index(1, i)}"],
|
initial_value=self.window.cache["asio"][f"ASIO CHECKBOX||{util.get_asio_checkbox_index(1, i)}"],
|
||||||
size=2,
|
size=2,
|
||||||
enable_events=True,
|
enable_events=True,
|
||||||
key=f"ASIO CHECKBOX||IN{i} 1",
|
key=f"ASIO CHECKBOX||IN{i} 1",
|
||||||
@@ -125,7 +180,7 @@ class Builder:
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
inner = list()
|
inner = []
|
||||||
asio_checkboxlists = ([] for _ in range(self.kind.phys_out))
|
asio_checkboxlists = ([] for _ in range(self.kind.phys_out))
|
||||||
for i, checkbox_list in enumerate(asio_checkboxlists):
|
for i, checkbox_list in enumerate(asio_checkboxlists):
|
||||||
[step(checkbox_list, i + 1) for step in (add_asio_checkboxes,)]
|
[step(checkbox_list, i + 1) for step in (add_asio_checkboxes,)]
|
||||||
@@ -134,11 +189,11 @@ class Builder:
|
|||||||
asio_checkboxes = [inner]
|
asio_checkboxes = [inner]
|
||||||
return psg.Frame("PATCH ASIO Inputs to Strips", asio_checkboxes)
|
return psg.Frame("PATCH ASIO Inputs to Strips", asio_checkboxes)
|
||||||
|
|
||||||
def make_tab0_row2(self) -> psg.Frame:
|
def make_tab0_row3(self) -> psg.Frame:
|
||||||
"""tab0 row2 represents patch composite"""
|
"""tab0 row3 represents patch composite"""
|
||||||
|
|
||||||
def add_physical_device_opts(layout):
|
def add_physical_device_opts(layout):
|
||||||
outputs = get_patch_composite_list(self.vm.kind)
|
outputs = util.get_patch_composite_list(self.vm.kind)
|
||||||
layout.append(
|
layout.append(
|
||||||
[
|
[
|
||||||
psg.ButtonMenu(
|
psg.ButtonMenu(
|
||||||
@@ -151,12 +206,12 @@ class Builder:
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
hardware_out = list()
|
hardware_out = []
|
||||||
[step(hardware_out) for step in (add_physical_device_opts,)]
|
[step(hardware_out) for step in (add_physical_device_opts,)]
|
||||||
return psg.Frame("PATCH COMPOSITE", hardware_out)
|
return psg.Frame("PATCH COMPOSITE", hardware_out)
|
||||||
|
|
||||||
def make_tab0_row3(self) -> psg.Frame:
|
def make_tab0_row4(self) -> psg.Frame:
|
||||||
"""tab0 row3 represents patch insert"""
|
"""tab0 row4 represents patch insert"""
|
||||||
|
|
||||||
def add_insert_checkboxes(layout, i):
|
def add_insert_checkboxes(layout, i):
|
||||||
if i <= self.kind.phys_in:
|
if i <= self.kind.phys_in:
|
||||||
@@ -165,7 +220,7 @@ class Builder:
|
|||||||
[
|
[
|
||||||
psg.Checkbox(
|
psg.Checkbox(
|
||||||
text=channel,
|
text=channel,
|
||||||
default=self.vm.patch.insert[get_insert_checkbox_index(self.kind, j, i)].on,
|
default=self.vm.patch.insert[util.get_insert_checkbox_index(self.kind, j, i)].on,
|
||||||
enable_events=True,
|
enable_events=True,
|
||||||
key=f"INSERT CHECKBOX||IN{i} {j}",
|
key=f"INSERT CHECKBOX||IN{i} {j}",
|
||||||
)
|
)
|
||||||
@@ -178,7 +233,7 @@ class Builder:
|
|||||||
[
|
[
|
||||||
psg.Checkbox(
|
psg.Checkbox(
|
||||||
text=channel,
|
text=channel,
|
||||||
default=self.vm.patch.insert[get_insert_checkbox_index(self.kind, j, i)].on,
|
default=self.vm.patch.insert[util.get_insert_checkbox_index(self.kind, j, i)].on,
|
||||||
enable_events=True,
|
enable_events=True,
|
||||||
key=f"INSERT CHECKBOX||IN{i} {j}",
|
key=f"INSERT CHECKBOX||IN{i} {j}",
|
||||||
)
|
)
|
||||||
@@ -186,8 +241,8 @@ class Builder:
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
asio_checkboxes = list()
|
asio_checkboxes = []
|
||||||
inner = list()
|
inner = []
|
||||||
checkbox_lists = ([] for _ in range(self.kind.num_strip))
|
checkbox_lists = ([] for _ in range(self.kind.num_strip))
|
||||||
for i, checkbox_list in enumerate(checkbox_lists):
|
for i, checkbox_list in enumerate(checkbox_lists):
|
||||||
if i < self.kind.phys_in:
|
if i < self.kind.phys_in:
|
||||||
@@ -200,27 +255,24 @@ class Builder:
|
|||||||
|
|
||||||
return psg.Frame("PATCH INSERT", asio_checkboxes)
|
return psg.Frame("PATCH INSERT", asio_checkboxes)
|
||||||
|
|
||||||
def make_tab0_row4(self) -> psg.Frame:
|
def make_tab0_row5(self) -> psg.Frame:
|
||||||
"""tab0 row4 represents asio buffer"""
|
"""tab0 row5 represents advanced settings"""
|
||||||
|
|
||||||
samples = get_asio_samples_list()
|
|
||||||
samples.append("Default")
|
|
||||||
|
|
||||||
return psg.Frame(
|
return psg.Frame(
|
||||||
"ASIO BUFFER",
|
"ADVANCED SETTINGS",
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
psg.ButtonMenu(
|
psg.Button(
|
||||||
"ASIO BUFFER",
|
"ADVANCED SETTINGS",
|
||||||
size=(14, 2),
|
size=(20, 2),
|
||||||
menu_def=["", samples],
|
key="ADVANCED SETTINGS",
|
||||||
key="ASIO BUFFER",
|
|
||||||
)
|
)
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
|
key="ADVANCED SETTINGS FRAME",
|
||||||
)
|
)
|
||||||
|
|
||||||
def make_tab1_row(self, i) -> psg.Frame:
|
def make_tab1_button_row(self, i) -> psg.Frame:
|
||||||
"""tab1 row represents a strip's outputs (A1-A5, B1-B3)"""
|
"""tab1 row represents a strip's outputs (A1-A5, B1-B3)"""
|
||||||
|
|
||||||
def add_strip_outputs(layout):
|
def add_strip_outputs(layout):
|
||||||
@@ -234,18 +286,74 @@ class Builder:
|
|||||||
else f"STRIP {i}||B{j - self.kind.phys_out + 1}",
|
else f"STRIP {i}||B{j - self.kind.phys_out + 1}",
|
||||||
)
|
)
|
||||||
for j in range(self.kind.phys_out + self.kind.virt_out)
|
for j in range(self.kind.phys_out + self.kind.virt_out)
|
||||||
]
|
],
|
||||||
|
)
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Button("Mono", size=(6, 2), key=f"STRIP {i}||MONO"),
|
||||||
|
psg.Button("Solo", size=(6, 2), key=f"STRIP {i}||SOLO"),
|
||||||
|
psg.Button("Mute", size=(6, 2), key=f"STRIP {i}||MUTE"),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
outputs = list()
|
outputs = []
|
||||||
[step(outputs) for step in (add_strip_outputs,)]
|
[step(outputs) for step in (add_strip_outputs,)]
|
||||||
return psg.Frame(self.window.cache["labels"][f"STRIP {i}||LABEL"], outputs, key=f"STRIP {i}||LABEL")
|
return psg.Frame(self.window.cache["labels"][f"STRIP {i}||LABEL"], outputs, key=f"STRIP {i}||LABEL")
|
||||||
|
|
||||||
def make_tab1_rows(self) -> psg.Frame:
|
def make_tab1_button_rows(self) -> psg.Frame:
|
||||||
layout = [[self.make_tab1_row(i)] for i in range(self.kind.phys_in)]
|
layout = [[self.make_tab1_button_row(i)] for i in range(self.kind.phys_in)]
|
||||||
return psg.Frame(None, layout, border_width=0)
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
def make_tab2_row(self, i) -> psg.Frame:
|
def make_tab1_slider_row(self, i) -> psg.Frame:
|
||||||
|
def add_gain_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text("Gain"),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-60, 12),
|
||||||
|
default_value=self.vm.strip[i].gain,
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation="horizontal",
|
||||||
|
key=f"STRIP {i}||SLIDER GAIN",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
def add_param_sliders(layout):
|
||||||
|
layout.append([LabelSlider(self.window, i, param) for param in util.get_slider_params(i, self.vm)])
|
||||||
|
|
||||||
|
def add_limit_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text("Limit"),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-40, 12),
|
||||||
|
default_value=self.vm.strip[i].limit,
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation="horizontal",
|
||||||
|
key=f"STRIP {i}||SLIDER LIMIT",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
layout = []
|
||||||
|
steps = (add_gain_slider, add_param_sliders)
|
||||||
|
if self.kind.name in ("banana", "potato"):
|
||||||
|
steps += (add_limit_slider,)
|
||||||
|
[step(layout) for step in steps]
|
||||||
|
return psg.Frame(self.window.cache["labels"][f"STRIP {i}||LABEL"], layout, key=f"STRIP {i}||LABEL||SLIDER")
|
||||||
|
|
||||||
|
def make_tab1_slider_rows(self) -> psg.Frame:
|
||||||
|
layout = [[self.make_tab1_slider_row(i)] for i in range(self.kind.phys_in)]
|
||||||
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
|
def make_tab2_button_row(self, i) -> psg.Frame:
|
||||||
"""tab2 row represents a strip's outputs (A1-A5, B1-B3)"""
|
"""tab2 row represents a strip's outputs (A1-A5, B1-B3)"""
|
||||||
|
|
||||||
def add_strip_outputs(layout):
|
def add_strip_outputs(layout):
|
||||||
@@ -261,25 +369,141 @@ class Builder:
|
|||||||
for j in range(self.kind.phys_out + self.kind.virt_out)
|
for j in range(self.kind.phys_out + self.kind.virt_out)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
if i == self.kind.phys_in + 1:
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Button("K", size=(6, 2), key=f"STRIP {i}||MONO"),
|
||||||
|
psg.Button("Solo", size=(6, 2), key=f"STRIP {i}||SOLO"),
|
||||||
|
psg.Button("Mute", size=(6, 2), key=f"STRIP {i}||MUTE"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Button("MC", size=(6, 2), key=f"STRIP {i}||MONO"),
|
||||||
|
psg.Button("Solo", size=(6, 2), key=f"STRIP {i}||SOLO"),
|
||||||
|
psg.Button("Mute", size=(6, 2), key=f"STRIP {i}||MUTE"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
outputs = list()
|
outputs = []
|
||||||
[step(outputs) for step in (add_strip_outputs,)]
|
[step(outputs) for step in (add_strip_outputs,)]
|
||||||
return psg.Frame(self.window.cache["labels"][f"STRIP {i}||LABEL"], outputs, key=f"STRIP {i}||LABEL")
|
return psg.Frame(self.window.cache["labels"][f"STRIP {i}||LABEL"], outputs, key=f"STRIP {i}||LABEL")
|
||||||
|
|
||||||
def make_tab2_rows(self) -> psg.Frame:
|
def make_tab2_button_rows(self) -> psg.Frame:
|
||||||
layout = [[self.make_tab2_row(i)] for i in range(self.kind.phys_in, self.kind.phys_in + self.kind.virt_in)]
|
layout = [
|
||||||
|
[self.make_tab2_button_row(i)] for i in range(self.kind.phys_in, self.kind.phys_in + self.kind.virt_in)
|
||||||
|
]
|
||||||
return psg.Frame(None, layout, border_width=0)
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
def make_tab3_row(self, i) -> psg.Frame:
|
def make_tab2_slider_row(self, i) -> psg.Frame:
|
||||||
|
def add_gain_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text("Gain"),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-60, 12),
|
||||||
|
default_value=self.vm.strip[i].gain,
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation="horizontal",
|
||||||
|
key=f"STRIP {i}||SLIDER GAIN",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
def add_param_sliders(layout):
|
||||||
|
if self.kind.name in ("basic", "banana"):
|
||||||
|
for param in util.get_slider_params(i, self.vm):
|
||||||
|
layout.append([LabelSlider(self.window, i, param, range_=(-12, 12))])
|
||||||
|
else:
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
LabelSlider(self.window, i, param, range_=(-12, 12))
|
||||||
|
for param in util.get_slider_params(i, self.vm)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
def add_limit_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text("Limit"),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-40, 12),
|
||||||
|
default_value=self.vm.strip[i].limit,
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation="horizontal",
|
||||||
|
key=f"STRIP {i}||SLIDER LIMIT",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
layout = []
|
||||||
|
steps = (add_gain_slider, add_param_sliders)
|
||||||
|
if self.kind.name in ("banana", "potato"):
|
||||||
|
steps += (add_limit_slider,)
|
||||||
|
[step(layout) for step in steps]
|
||||||
|
return psg.Frame(self.window.cache["labels"][f"STRIP {i}||LABEL"], layout, key=f"STRIP {i}||LABEL||SLIDER")
|
||||||
|
|
||||||
|
def make_tab2_slider_rows(self) -> psg.Frame:
|
||||||
|
layout = [
|
||||||
|
[self.make_tab2_slider_row(i)] for i in range(self.kind.phys_in, self.kind.phys_in + self.kind.virt_in)
|
||||||
|
]
|
||||||
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
|
def make_tab3_button_row(self, i) -> psg.Frame:
|
||||||
"""tab3 row represents bus composite toggle"""
|
"""tab3 row represents bus composite toggle"""
|
||||||
|
|
||||||
def add_strip_outputs(layout):
|
def add_strip_outputs(layout):
|
||||||
layout.append([psg.Button(f"BUSMODE", size=(12, 2), key=f"BUS {i}||MODE")])
|
params = ["MONO", "EQ", "MUTE", "MODE"]
|
||||||
|
if self.vm.kind.name == "basic":
|
||||||
|
params.remove("EQ")
|
||||||
|
label = {"MODE": "BUSMODE"}
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Button(
|
||||||
|
label.get(param, param.capitalize()),
|
||||||
|
size=(12 if param == "MODE" else 6, 2),
|
||||||
|
key=f"BUS {i}||{param}",
|
||||||
|
)
|
||||||
|
for param in params
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
outputs = list()
|
outputs = []
|
||||||
[step(outputs) for step in (add_strip_outputs,)]
|
[step(outputs) for step in (add_strip_outputs,)]
|
||||||
return psg.Frame(self.window.cache["labels"][f"BUS {i}||LABEL"], outputs, key=f"BUS {i}||LABEL")
|
return psg.Frame(self.window.cache["labels"][f"BUS {i}||LABEL"], outputs, key=f"BUS {i}||LABEL")
|
||||||
|
|
||||||
def make_tab3_rows(self) -> psg.Frame:
|
def make_tab3_button_rows(self) -> psg.Frame:
|
||||||
layout = [[self.make_tab3_row(i)] for i in range(self.kind.num_bus)]
|
layout = [[self.make_tab3_button_row(i)] for i in range(self.kind.num_bus)]
|
||||||
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
|
def make_tab3_slider_row(self, i) -> psg.Frame:
|
||||||
|
def add_gain_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Slider(
|
||||||
|
range=(-60, 12),
|
||||||
|
default_value=self.vm.bus[i].gain,
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation="horizontal",
|
||||||
|
key=f"BUS {i}||SLIDER GAIN",
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
outputs = []
|
||||||
|
[step(outputs) for step in (add_gain_slider,)]
|
||||||
|
return psg.Frame(self.window.cache["labels"][f"BUS {i}||LABEL"], outputs, key=f"BUS {i}||LABEL||SLIDER")
|
||||||
|
|
||||||
|
def make_tab3_slider_rows(self) -> psg.Frame:
|
||||||
|
layout = [[self.make_tab3_slider_row(i)] for i in range(self.kind.num_bus)]
|
||||||
return psg.Frame(None, layout, border_width=0)
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|||||||
39
src/nvda_voicemeeter/compound.py
Normal file
39
src/nvda_voicemeeter/compound.py
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import PySimpleGUI as psg
|
||||||
|
|
||||||
|
|
||||||
|
class LabelSlider(psg.Frame):
|
||||||
|
"""Compound Label Slider element"""
|
||||||
|
|
||||||
|
def __init__(self, parent, i, param, range_=(0, 10), *args, **kwargs):
|
||||||
|
self.parent = parent
|
||||||
|
if param in ("AUDIBILITY", "DENOISER"):
|
||||||
|
size = 7
|
||||||
|
else:
|
||||||
|
size = 4
|
||||||
|
if param == "LIMIT":
|
||||||
|
resolution = 1
|
||||||
|
else:
|
||||||
|
resolution = 0.1
|
||||||
|
layout = [
|
||||||
|
[
|
||||||
|
psg.Text(param.capitalize(), size=size),
|
||||||
|
psg.Slider(
|
||||||
|
range=range_,
|
||||||
|
default_value=self.default_value(i, param),
|
||||||
|
resolution=resolution,
|
||||||
|
disable_number_display=True,
|
||||||
|
size=(12, 16),
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation="horizontal",
|
||||||
|
key=f"STRIP {i}||SLIDER {param}",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
]
|
||||||
|
super().__init__(None, layout=layout, border_width=0, pad=0, *args, **kwargs)
|
||||||
|
|
||||||
|
def default_value(self, i, param):
|
||||||
|
target = getattr(self.parent.vm.strip[i], param.lower())
|
||||||
|
if param in ("COMP", "GATE", "DENOISER"):
|
||||||
|
return target.knob
|
||||||
|
return target
|
||||||
@@ -1,37 +1,55 @@
|
|||||||
|
def _make_hardware_ins_cache(vm) -> dict:
|
||||||
|
return {**{f"HARDWARE IN||{i + 1}": vm.strip[i].device.name for i in range(vm.kind.phys_in)}}
|
||||||
|
|
||||||
|
|
||||||
def _make_hardware_outs_cache(vm) -> dict:
|
def _make_hardware_outs_cache(vm) -> dict:
|
||||||
return {**{f"HARDWARE OUT||A{i + 1}": vm.bus[i].device.name for i in range(vm.kind.phys_out)}}
|
hw_outs = {**{f"HARDWARE OUT||A{i + 1}": vm.bus[i].device.name for i in range(vm.kind.phys_out)}}
|
||||||
|
if vm.kind.name == "basic":
|
||||||
|
hw_outs |= {f"HARDWARE OUT||A2": vm.bus[1].device.name}
|
||||||
|
return hw_outs
|
||||||
|
|
||||||
|
|
||||||
def _make_output_cache(vm) -> dict:
|
def _make_param_cache(vm, channel_type) -> dict:
|
||||||
match vm.kind.name:
|
params = {}
|
||||||
case "basic":
|
if channel_type == "strip":
|
||||||
return {
|
match vm.kind.name:
|
||||||
**{f"STRIP {i}||A1": vm.strip[i].A1 for i in range(vm.kind.num_strip)},
|
case "basic":
|
||||||
**{f"STRIP {i}||B1": vm.strip[i].B1 for i in range(vm.kind.num_strip)},
|
params |= {
|
||||||
}
|
**{f"STRIP {i}||A1": vm.strip[i].A1 for i in range(vm.kind.num_strip)},
|
||||||
case "banana":
|
**{f"STRIP {i}||B1": vm.strip[i].B1 for i in range(vm.kind.num_strip)},
|
||||||
return {
|
}
|
||||||
**{f"STRIP {i}||A1": vm.strip[i].A1 for i in range(vm.kind.num_strip)},
|
case "banana":
|
||||||
**{f"STRIP {i}||A2": vm.strip[i].A2 for i in range(vm.kind.num_strip)},
|
params |= {
|
||||||
**{f"STRIP {i}||A3": vm.strip[i].A3 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||A1": vm.strip[i].A1 for i in range(vm.kind.num_strip)},
|
||||||
**{f"STRIP {i}||B1": vm.strip[i].B1 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||A2": vm.strip[i].A2 for i in range(vm.kind.num_strip)},
|
||||||
**{f"STRIP {i}||B2": vm.strip[i].B2 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||A3": vm.strip[i].A3 for i in range(vm.kind.num_strip)},
|
||||||
}
|
**{f"STRIP {i}||B1": vm.strip[i].B1 for i in range(vm.kind.num_strip)},
|
||||||
case "potato":
|
**{f"STRIP {i}||B2": vm.strip[i].B2 for i in range(vm.kind.num_strip)},
|
||||||
return {
|
}
|
||||||
**{f"STRIP {i}||A1": vm.strip[i].A1 for i in range(vm.kind.num_strip)},
|
case "potato":
|
||||||
**{f"STRIP {i}||A2": vm.strip[i].A2 for i in range(vm.kind.num_strip)},
|
params |= {
|
||||||
**{f"STRIP {i}||A3": vm.strip[i].A3 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||A1": vm.strip[i].A1 for i in range(vm.kind.num_strip)},
|
||||||
**{f"STRIP {i}||A4": vm.strip[i].A4 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||A2": vm.strip[i].A2 for i in range(vm.kind.num_strip)},
|
||||||
**{f"STRIP {i}||A5": vm.strip[i].A5 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||A3": vm.strip[i].A3 for i in range(vm.kind.num_strip)},
|
||||||
**{f"STRIP {i}||B1": vm.strip[i].B1 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||A4": vm.strip[i].A4 for i in range(vm.kind.num_strip)},
|
||||||
**{f"STRIP {i}||B2": vm.strip[i].B2 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||A5": vm.strip[i].A5 for i in range(vm.kind.num_strip)},
|
||||||
**{f"STRIP {i}||B3": vm.strip[i].B3 for i in range(vm.kind.num_strip)},
|
**{f"STRIP {i}||B1": vm.strip[i].B1 for i in range(vm.kind.num_strip)},
|
||||||
}
|
**{f"STRIP {i}||B2": vm.strip[i].B2 for i in range(vm.kind.num_strip)},
|
||||||
|
**{f"STRIP {i}||B3": vm.strip[i].B3 for i in range(vm.kind.num_strip)},
|
||||||
|
}
|
||||||
def _make_bus_mode_cache(vm) -> dict:
|
params |= {
|
||||||
return {**{f"BUS {i}||MODE": vm.bus[i].mode.get() for i in range(vm.kind.num_bus)}}
|
**{f"STRIP {i}||MONO": vm.strip[i].mono for i in range(vm.kind.num_strip)},
|
||||||
|
**{f"STRIP {i}||SOLO": vm.strip[i].solo for i in range(vm.kind.num_strip)},
|
||||||
|
**{f"STRIP {i}||MUTE": vm.strip[i].mute for i in range(vm.kind.num_strip)},
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
params |= {
|
||||||
|
**{f"BUS {i}||MONO": vm.bus[i].mono for i in range(vm.kind.num_bus)},
|
||||||
|
**{f"BUS {i}||EQ": vm.bus[i].eq.on for i in range(vm.kind.num_bus)},
|
||||||
|
**{f"BUS {i}||MUTE": vm.bus[i].mute for i in range(vm.kind.num_bus)},
|
||||||
|
**{f"BUS {i}||MODE": vm.bus[i].mode.get() for i in range(vm.kind.num_bus)},
|
||||||
|
}
|
||||||
|
return params
|
||||||
|
|
||||||
|
|
||||||
def _make_label_cache(vm) -> dict:
|
def _make_label_cache(vm) -> dict:
|
||||||
@@ -56,8 +74,10 @@ def _make_label_cache(vm) -> dict:
|
|||||||
|
|
||||||
|
|
||||||
def _make_patch_asio_cache(vm) -> dict:
|
def _make_patch_asio_cache(vm) -> dict:
|
||||||
return {**{f"ASIO CHECKBOX||{i}": vm.patch.asio[i].get() for i in range(vm.kind.phys_out * 2)}}
|
if vm.kind.name != "basic":
|
||||||
|
return {**{f"ASIO CHECKBOX||{i}": vm.patch.asio[i].get() for i in range(vm.kind.phys_out * 2)}}
|
||||||
|
|
||||||
|
|
||||||
def _make_patch_insert_cache(vm) -> dict:
|
def _make_patch_insert_cache(vm) -> dict:
|
||||||
return {**{f"INSERT CHECKBOX||{i}": vm.patch.insert[i].on for i in range(vm.kind.num_strip_levels)}}
|
if vm.kind.name != "basic":
|
||||||
|
return {**{f"INSERT CHECKBOX||{i}": vm.patch.insert[i].on for i in range(vm.kind.num_strip_levels)}}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
from typing import Iterable
|
||||||
|
|
||||||
|
|
||||||
def get_asio_checkbox_index(channel, num) -> int:
|
def get_asio_checkbox_index(channel, num) -> int:
|
||||||
if channel == 0:
|
if channel == 0:
|
||||||
return 2 * num - 2
|
return 2 * num - 2
|
||||||
@@ -8,13 +11,36 @@ def get_insert_checkbox_index(kind, channel, num) -> int:
|
|||||||
if num <= kind.phys_in:
|
if num <= kind.phys_in:
|
||||||
if channel == 0:
|
if channel == 0:
|
||||||
return 2 * num - 2
|
return 2 * num - 2
|
||||||
else:
|
return 2 * num - 1
|
||||||
return 2 * num - 1
|
|
||||||
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.output(i)) for i in range(vm.device.outs)]
|
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 = []
|
||||||
|
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:
|
||||||
@@ -43,28 +69,20 @@ def get_patch_insert_channels() -> list:
|
|||||||
_patch_insert_channels = get_patch_insert_channels()
|
_patch_insert_channels = get_patch_insert_channels()
|
||||||
|
|
||||||
|
|
||||||
def get_asio_samples_list() -> list:
|
def get_asio_samples_list(driver) -> list:
|
||||||
return [
|
if driver == "MME":
|
||||||
"1024",
|
samples = ["2048", "1536", "1024", "896", "768", "704", "640", "576", "512", "480", "441"]
|
||||||
"768",
|
else:
|
||||||
"704",
|
# fmt: off
|
||||||
"640",
|
samples = [
|
||||||
"576",
|
"2048", "1536", "1024", "768", "704", "640", "576", "512", "480", "448", "441", "416", "384",
|
||||||
"512",
|
"352", "320", "288", "256", "224", "192", "160", "128"
|
||||||
"480",
|
]
|
||||||
"448",
|
# fmt: on
|
||||||
"441",
|
if driver == "ASIO":
|
||||||
"416",
|
samples = [x for x in samples if x not in ("2048", "1536")]
|
||||||
"384",
|
samples.append("Default")
|
||||||
"352",
|
return samples
|
||||||
"320",
|
|
||||||
"288",
|
|
||||||
"256",
|
|
||||||
"224",
|
|
||||||
"192",
|
|
||||||
"160",
|
|
||||||
"128",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def get_tabs_labels() -> list:
|
def get_tabs_labels() -> list:
|
||||||
@@ -88,3 +106,47 @@ def get_channel_identifier_list(vm) -> list:
|
|||||||
for j in range(8):
|
for j in range(8):
|
||||||
identifiers.append(f"IN{i + 1} {j}")
|
identifiers.append(f"IN{i + 1} {j}")
|
||||||
return identifiers
|
return identifiers
|
||||||
|
|
||||||
|
|
||||||
|
def get_bus_modes(vm) -> list:
|
||||||
|
if vm.kind.name == "basic":
|
||||||
|
return [
|
||||||
|
"normal",
|
||||||
|
"amix",
|
||||||
|
"repeat",
|
||||||
|
"composite",
|
||||||
|
]
|
||||||
|
return [
|
||||||
|
"normal",
|
||||||
|
"amix",
|
||||||
|
"bmix",
|
||||||
|
"repeat",
|
||||||
|
"composite",
|
||||||
|
"tvmix",
|
||||||
|
"upmix21",
|
||||||
|
"upmix41",
|
||||||
|
"upmix61",
|
||||||
|
"centeronly",
|
||||||
|
"lfeonly",
|
||||||
|
"rearonly",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def check_bounds(val, bounds: tuple) -> int | float:
|
||||||
|
lower, upper = bounds
|
||||||
|
if val > upper:
|
||||||
|
val = upper
|
||||||
|
elif val < lower:
|
||||||
|
val = lower
|
||||||
|
return val
|
||||||
|
|
||||||
|
|
||||||
|
def get_slider_params(i, vm) -> Iterable:
|
||||||
|
if i < vm.kind.phys_in:
|
||||||
|
if vm.kind.name == "basic":
|
||||||
|
return ("AUDIBILITY",)
|
||||||
|
if vm.kind.name == "banana":
|
||||||
|
return ("COMP", "GATE")
|
||||||
|
if vm.kind.name == "potato":
|
||||||
|
return ("COMP", "GATE", "DENOISER")
|
||||||
|
return ("BASS", "MID", "TREBLE")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user