Compare commits

...

57 Commits
v.0.3.0 ... dev

Author SHA1 Message Date
cc0a1de07b call task from pdm
remove build.ps1
2025-02-13 16:47:20 +00:00
9ee0dac610 run through formatter 2025-02-07 23:00:07 +00:00
c7b8622aac Merge branch 'dev' of https://github.com/onyx-and-iris/nvda-voicemeeter into dev 2025-02-07 16:07:51 +00:00
2706338fcb add Taskfile 2025-02-07 16:07:45 +00:00
ff98aa5f89 run through ruff 2025-02-03 00:14:41 +00:00
03252fe30f rename entry points 2025-01-25 15:08:55 +00:00
055e92ab24 bump to major version 1.0.0 2025-01-20 16:33:12 +00:00
32b3ec8a2e add controllerClient files to repo 2025-01-20 16:31:59 +00:00
fbd4962fb2 re-run files through ruff formatter 2025-01-20 16:29:47 +00:00
b5ea41c604 update dll name to support latest version.
See https://github.com/nvaccess/nvda/tree/master/extras/controllerClient
2025-01-20 16:28:27 +00:00
f48983d08a add gui entry points 2025-01-20 16:24:35 +00:00
1c5c8893ad bump dependency ver 2024-07-03 08:41:23 +01:00
e645437d1d patch bump 2024-07-03 08:33:20 +01:00
9969506698 switch to freesimplegui 2024-07-02 22:11:18 +01:00
3a1143199a pin pysimplegui version due to license changes 2024-06-07 23:16:14 +01:00
79f739f250 upd controller_path to reflect changes to pyinstaller
patch  bump
2024-01-30 14:34:11 +00:00
b45b2da4aa dependency update 2024-01-30 13:04:51 +00:00
0adfec2e63 fixes regression loading config on startup
patch bump
2023-11-19 23:09:02 +00:00
dacc972b17 rename section in readme 2023-11-19 22:50:29 +00:00
2ed1cad666 minor bump
closes #19
2023-11-19 22:45:57 +00:00
64361b2011 High Contrast theme added.
Sets GUI font to Arial, size 14

version bumped to 0.5.7b2

Issue #19
2023-11-19 01:22:40 +00:00
36003fe73f theme list updated.
themes section added to readme

version bumped to 0.5.7b1

Issue #19
2023-11-16 15:43:39 +00:00
cb82033e1c theme menu initial implementation
bump to 0.5.7a1

Issue #19
2023-11-15 23:34:53 +00:00
bde9020471 closes #17 2023-10-29 19:26:03 +00:00
364b0deeb4 bump to v0.5.6b1
addresses issue #17
2023-10-26 21:06:06 +01:00
a80e4e2d83 Patch BUS to A1 ASIO Outputs implemented
Patch ASIO Inputs to Strips moved to Advanced Settings
2023-10-26 20:12:49 +01:00
6e146bac50 upd images 2023-10-04 05:22:08 +01:00
c385476cc4 adjust cache to match strip layout
event keys updated

_get_bus_assignments added to util.py

patch bump
2023-09-29 20:08:18 +01:00
1c09556c61 adds missing karaoke mode k v
patch bump
2023-09-29 18:30:53 +01:00
421688eff8 resizes the patch composite buttons
fixes possible (but unlikely) index out of range.

patch bump
2023-09-29 13:38:40 +01:00
bdd570738a fix version bump... 2023-09-29 01:18:57 +01:00
71b137a9c2 use self.kind 2023-09-29 01:16:48 +01:00
912eb8c14d number of patch composite buttons fixed
for banana and potato kinds

voicemeeter-api dependency bump

patch bump
2023-09-29 01:09:18 +01:00
9cd65737e5 bump to version 0.5.1
closes #16
2023-09-28 23:35:02 +01:00
4a6ca2a353 check against slider modes explicitly
add enter/exit slider mode debug logging
2023-09-28 22:43:06 +01:00
cc99b14e89 define space bind event for bus buttons 2023-09-28 21:35:05 +01:00
23458debaa initial busmode buttonmenu implementation
bump to 0.5.1a1
Issue #16
2023-09-28 19:44:42 +01:00
496cc35321 fixes comp output gain resolution 2023-09-28 18:18:26 +01:00
d758db9dee lint/format fixes 2023-09-28 16:32:52 +01:00
876de55ad2 Advanced Comp|Gate sliders implemented
bump to 0.5.0

closes #14
2023-09-27 23:34:07 +01:00
eab4b1c6a9 fixes unboundlocalerror 2023-09-27 13:36:48 +01:00
0aeb33608f implements reset binds
Advanced Comp|Gate section added to README.

bump to version 0.5.0b1
2023-09-26 23:51:34 +01:00
5befe72ca1 adds pdirty events for advanced comp/gate 2023-09-26 19:38:55 +01:00
abab560281 +10, +50 step binds added for gate
bump to version 0.5.0a2
Initial gate slider implementation
for Issue #14
2023-09-26 17:20:15 +01:00
6882adb47b gate as no Knee parameter 2023-09-26 15:56:12 +01:00
af602e087d GateSlider added to compound
Advanced Gate slider layout and events defined
needs more testing.
2023-09-26 15:53:43 +01:00
01e80dc4f6 replace flake8 with ruff
add tool.ruff to pyproject

update lint dependencies

removes settings.json

ruff badge added to readme

bump to version 0.4.2.a1
Initial compressor slider implementation
for Issue #14
2023-09-26 14:37:41 +01:00
7262af4bcf disable default keyboard/mouse events
for gain sliders
2023-09-26 13:33:13 +01:00
ef10b224d7 remove redundant if statement 2023-09-25 18:24:43 +01:00
89d0253591 add advanced comproessor slider events
voicemeeter-api version bumped

some of the spoken feedback for sliders corrected.
2023-09-25 18:22:17 +01:00
85527e0749 defines layout for compressor popup 2023-09-25 12:14:29 +01:00
9d8ea5f747 fixes regression, bus focus in/out readded
patch bump
2023-09-23 17:04:33 +01:00
0dd6c89f96 implements up/down slider mode binds
adjustments to pdirty event toggling.

press/release events defined for slider binds

note:
the main window no longer returns keyboard events

minor bump
2023-09-23 16:36:48 +01:00
893f9f59ff patch asio spinboxes set as readonly
patch insert checkboxes enter bind added
2023-09-21 16:39:21 +01:00
3ca9e14e96 adds bass, mid and treble slider modes
patch bump
2023-09-21 09:33:22 +01:00
4ca64f94bc re 2023-09-21 08:35:55 +01:00
22bf109499 removes the spinbox from the rename popup
updates README

fixes #12

b1 bump
2023-09-20 18:24:24 +01:00
30 changed files with 2428 additions and 1316 deletions

12
.gitignore vendored
View File

@ -85,7 +85,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
@ -161,14 +161,8 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
# nvda files
controllerClient/*
!.gitkeep
# build files
basic.py
banana.py
potato.py
# spec files
spec/
# persistent storage
settings.json

View File

@ -1,5 +0,0 @@
{
"black-formatter.args": [
"--line-length=120"
]
}

View File

@ -1,6 +1,5 @@
[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm.fming.dev)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
# NVDA Voicemeeter
@ -28,19 +27,17 @@ 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:
The [Controller Client][controller_client] files are included with the source files. If you decide to download them yourself make sure you keep the directory structure as follows:
├── `controllerClient/`
        ├── `x64/`
                ├── nvdaControllerClient64.dll
                ├── nvdaControllerClient.dll
        ├── `x86/`
                ├── nvdaControllerClient32.dll
                ├── nvdaControllerClient.dll
#### `From Releases`
@ -55,7 +52,7 @@ import voicemeeterlib
import nvda_voicemeeter
KIND_ID = "potato"
KIND_ID = 'potato'
with voicemeeterlib.api(KIND_ID) as vm:
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
@ -106,15 +103,35 @@ All sliders may be controlled in three different ways:
- `Shift + Left|Right arrow` to move a slider by 0.1 steps.
- `Control + Left|Right arrow` to move a slider by 3 steps.
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.
To reset a slider back to its default value you may use `Control + Shift + R`.
To rename a strip/bus channel focus on the channel in question and press `F2`. Then enter the new channel name into the text input widget and press the `Ok` button.
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`
#### `Advanced Compressor|Gate`
A single menu item `Voicemeeter` can be opened using `Alt` and then `v`. The menu allows you to:
For potato version only, you may access advanced Compressor and Gate sliders. Simply focus any Gate or Compressor slider and press `Control + A`. This will open a popup window where you can navigate between the different sliders with `TAB`. Move the sliders with the same binds you would for normal sliders. However, there are a couple of extra binds for certain controls.
For Compressor Release you may use:
- `Alt + Left|Right arrow` to move the slider by 10 steps.
- `Alt + Control + Left|Right arrow` to move the slider by 50 steps.
For Gate BP Sidechain, Attack, Hold, Release you may use:
- `Alt + Left|Right arrow` to move the slider by 10 steps.
- `Alt + Control + Left|Right arrow` to move the slider by 50 steps.
To reset a slider back to its default value you may use `Control + Shift + R`.
### Menu
#### `Voicemeeter`
The `Voicemeeter` menu can be opened using `Alt` and then `v`. It offers the following options:
- Restart Voicemeeter audio engine
- Save/Load current settings (as an xml file)
@ -124,7 +141,11 @@ The `Save Settings` option opens a popup window with two buttons, `Browse` and `
`Load Settings` and `Load on Startup` both open an Open dialog box immediately.
### `Quick access binds`
#### `Theme`
The `Theme` menu can be opened using `Alt` and then `t`. Use this menu to select from a list of coloured themes. Some themes offer higher contrast colours. An application restart is required to load a new theme. Once a theme is selected it will become the default for future startups.
### Quick access binds
There are a number of quick binds available to assist with faster navigation and general use.
@ -143,6 +164,9 @@ You may also enter slider modes which allow for control of the channels sliders
- `Control + G` will enter Gain mode
- `Control + T` will enter Gate mode
- `Control + L` will enter Limit mode
- `Control + B` will enter Bass mode
- `Control + I` will enter Mid mode
- `Control + R` will enter Treble mode
To exit any of the slider modes press `Escape`.
@ -160,7 +184,7 @@ If you have any questions/suggestions feel free to raise an issue or open a new
[Vincent Burel](https://github.com/vburel2018) for creating Voicemeeter and its SDK.
[PySimpleGUI](https://github.com/PySimpleGUI) team for creating an awesome GUI framework.
[FreeSimpleGUI](https://github.com/spyoungtech/FreeSimpleGUI) a fork of the now closed source PySimpleGUI project.
[spec]: ./SPECIFICATION.md
[voicemeeter]: https://voicemeeter.com/

40
Taskfile.yml Normal file
View File

@ -0,0 +1,40 @@
version: '3'
vars:
SHELL: pwsh
tasks:
default:
desc: Prepare artifacts for release
cmds:
- task: release
release:
desc: Build and compress all artifacts
cmds:
- task: build
- task: compress
build:
desc: Build the project
cmds:
- for:
matrix:
KIND: [basic, banana, potato]
cmd: pdm run pyinstaller --noconfirm --distpath dist/{{.ITEM.KIND}} spec/{{.ITEM.KIND}}.spec
compress:
desc: Compress the build artifacts
cmds:
- for:
matrix:
KIND: [basic, banana, potato]
cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/{{.ITEM.KIND}} -DestinationPath dist/{{.ITEM.KIND}}.zip -Force"'
clean:
desc: Clean the project
cmds:
- |
{{.SHELL}} -Command "
Remove-Item -Recurse -Force build/basic,build/banana,build/potato
Remove-Item -Recurse -Force dist/*"

View File

@ -2,7 +2,7 @@ import voicemeeterlib
import nvda_voicemeeter
KIND_ID = "potato"
KIND_ID = 'potato'
with voicemeeterlib.api(KIND_ID) as vm:
with nvda_voicemeeter.draw(KIND_ID, vm) as window:

View File

@ -1,20 +0,0 @@
function Compress-Builds {
$target = Join-Path -Path $PSScriptRoot -ChildPath "dist"
@("basic", "banana", "potato") | ForEach-Object {
Compress-Archive -Path $(Join-Path -Path $target -ChildPath $_) -DestinationPath $(Join-Path -Path $target -ChildPath "${_}.zip") -Force
}
}
function Get-Builds {
@("basic", "banana", "potato") | ForEach-Object {
pdm run pyinstaller "${_}.spec" --noconfirm
}
}
function main {
Get-Builds
Compress-Builds
}
if ($MyInvocation.InvocationName -ne '.') { main }

Binary file not shown.

Binary file not shown.

BIN
img/busmode_buttonmenu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 KiB

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 38 KiB

335
pdm.lock generated
View File

@ -2,132 +2,57 @@
# It is not intended for manual editing.
[metadata]
groups = ["default", "build", "lint", "test"]
cross_platform = true
static_urls = false
lock_version = "4.3"
content_hash = "sha256:ba53368b628b713c9cf4eb54e6f5c5c4af207c8e247d473417e4c2a4b47f645d"
groups = ["default", "build", "format"]
strategy = ["inherit_metadata"]
lock_version = "4.5.0"
content_hash = "sha256:177dea67a7eadb6b161d3ac62fb09415d2d4f295c59914a9c5d0cbef7f0a5b65"
[[metadata.targets]]
requires_python = ">=3.10,<3.13"
[[package]]
name = "altgraph"
version = "0.17.3"
version = "0.17.4"
summary = "Python graph (network) package"
groups = ["build"]
files = [
{file = "altgraph-0.17.3-py2.py3-none-any.whl", hash = "sha256:c8ac1ca6772207179ed8003ce7687757c04b0b71536f81e2ac5755c6226458fe"},
{file = "altgraph-0.17.3.tar.gz", hash = "sha256:ad33358114df7c9416cdb8fa1eaa5852166c505118717021c6a8c7c7abbd03dd"},
{file = "altgraph-0.17.4-py2.py3-none-any.whl", hash = "sha256:642743b4750de17e655e6711601b077bc6598dbfa3ba5fa2b2a35ce12b508dff"},
{file = "altgraph-0.17.4.tar.gz", hash = "sha256:1b5afbb98f6c4dcadb2e2ae6ab9fa994bbb8c1d75f4fa96d340f9437ae454406"},
]
[[package]]
name = "black"
version = "23.7.0"
requires_python = ">=3.8"
summary = "The uncompromising code formatter."
dependencies = [
"click>=8.0.0",
"mypy-extensions>=0.4.3",
"packaging>=22.0",
"pathspec>=0.9.0",
"platformdirs>=2",
"tomli>=1.1.0; python_version < \"3.11\"",
]
name = "freesimplegui"
version = "5.1.1"
summary = "The free-forever Python GUI framework."
groups = ["default"]
files = [
{file = "black-23.7.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:5c4bc552ab52f6c1c506ccae05681fab58c3f72d59ae6e6639e8885e94fe2587"},
{file = "black-23.7.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:552513d5cd5694590d7ef6f46e1767a4df9af168d449ff767b13b084c020e63f"},
{file = "black-23.7.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:86cee259349b4448adb4ef9b204bb4467aae74a386bce85d56ba4f5dc0da27be"},
{file = "black-23.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:501387a9edcb75d7ae8a4412bb8749900386eaef258f1aefab18adddea1936bc"},
{file = "black-23.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:fb074d8b213749fa1d077d630db0d5f8cc3b2ae63587ad4116e8a436e9bbe995"},
{file = "black-23.7.0-py3-none-any.whl", hash = "sha256:9fd59d418c60c0348505f2ddf9609c1e1de8e7493eab96198fc89d9f865e7a96"},
{file = "black-23.7.0.tar.gz", hash = "sha256:022a582720b0d9480ed82576c920a8c1dde97cc38ff11d8d8859b3bd6ca9eedb"},
]
[[package]]
name = "click"
version = "8.1.7"
requires_python = ">=3.7"
summary = "Composable command line interface toolkit"
dependencies = [
"colorama; platform_system == \"Windows\"",
]
files = [
{file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"},
{file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"},
]
[[package]]
name = "colorama"
version = "0.4.6"
requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
summary = "Cross-platform colored terminal text."
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "flake8"
version = "6.1.0"
requires_python = ">=3.8.1"
summary = "the modular source code checker: pep8 pyflakes and co"
dependencies = [
"mccabe<0.8.0,>=0.7.0",
"pycodestyle<2.12.0,>=2.11.0",
"pyflakes<3.2.0,>=3.1.0",
]
files = [
{file = "flake8-6.1.0-py2.py3-none-any.whl", hash = "sha256:ffdfce58ea94c6580c77888a86506937f9a1a227dfcd15f245d694ae20a6b6e5"},
{file = "flake8-6.1.0.tar.gz", hash = "sha256:d5b3857f07c030bdb5bf41c7f53799571d75c4491748a3adcd47de929e34cd23"},
{file = "FreeSimpleGUI-5.1.1-py3-none-any.whl", hash = "sha256:d7629d5c94b55264d119bd2a89f52667d863ea7914d808e619aea29922ff842e"},
{file = "freesimplegui-5.1.1.tar.gz", hash = "sha256:2f0946c7ac221c997929181cbe7526e342fff5fc291a26d1d726287a5dd964fb"},
]
[[package]]
name = "macholib"
version = "1.16.2"
version = "1.16.3"
summary = "Mach-O header analysis and editing"
groups = ["build"]
marker = "sys_platform == \"darwin\""
dependencies = [
"altgraph>=0.17",
]
files = [
{file = "macholib-1.16.2-py2.py3-none-any.whl", hash = "sha256:44c40f2cd7d6726af8fa6fe22549178d3a4dfecc35a9cd15ea916d9c83a688e0"},
{file = "macholib-1.16.2.tar.gz", hash = "sha256:557bbfa1bb255c20e9abafe7ed6cd8046b48d9525db2f9b77d3122a63a2a8bf8"},
]
[[package]]
name = "mccabe"
version = "0.7.0"
requires_python = ">=3.6"
summary = "McCabe checker, plugin for flake8"
files = [
{file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"},
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
]
[[package]]
name = "mypy-extensions"
version = "1.0.0"
requires_python = ">=3.5"
summary = "Type system extensions for programs checked with the mypy type checker."
files = [
{file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"},
{file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"},
{file = "macholib-1.16.3-py2.py3-none-any.whl", hash = "sha256:0e315d7583d38b8c77e815b1ecbdbf504a8258d8b3e17b61165c6feb60d18f2c"},
{file = "macholib-1.16.3.tar.gz", hash = "sha256:07ae9e15e8e4cd9a788013d81f5908b3609aa76f9b1421bae9c4d7606ec86a30"},
]
[[package]]
name = "packaging"
version = "23.1"
requires_python = ">=3.7"
version = "24.2"
requires_python = ">=3.8"
summary = "Core utilities for Python packages"
groups = ["build"]
files = [
{file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"},
{file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"},
]
[[package]]
name = "pathspec"
version = "0.11.2"
requires_python = ">=3.7"
summary = "Utility library for gitignore style pattern matching of file paths."
files = [
{file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"},
{file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"},
{file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"},
{file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"},
]
[[package]]
@ -135,149 +60,173 @@ name = "pefile"
version = "2023.2.7"
requires_python = ">=3.6.0"
summary = "Python PE parsing module"
groups = ["build"]
marker = "sys_platform == \"win32\""
files = [
{file = "pefile-2023.2.7-py3-none-any.whl", hash = "sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6"},
{file = "pefile-2023.2.7.tar.gz", hash = "sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc"},
]
[[package]]
name = "platformdirs"
version = "3.10.0"
requires_python = ">=3.7"
summary = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
files = [
{file = "platformdirs-3.10.0-py3-none-any.whl", hash = "sha256:d7c24979f292f916dc9cbf8648319032f551ea8c49a4c9bf2fb556a02070ec1d"},
{file = "platformdirs-3.10.0.tar.gz", hash = "sha256:b45696dab2d7cc691a3226759c0d3b00c47c8b6e293d96f6436f733303f77f6d"},
]
[[package]]
name = "psgdemos"
version = "1.12.1"
summary = "Installs the full set of PySimpleGUI Demo Programs and the Demo Browser."
dependencies = [
"PySimpleGUI",
]
files = [
{file = "psgdemos-1.12.1-py3-none-any.whl", hash = "sha256:a035540dd0ff92f410aed9b7af8d5a641d9d5a9eac3e0072ef115adf06abb447"},
{file = "psgdemos-1.12.1.tar.gz", hash = "sha256:4108af795477531a9b1c8675b9aa9b6628c109e660f6954baf8ba2dc3b5806e9"},
]
[[package]]
name = "pycodestyle"
version = "2.11.0"
requires_python = ">=3.8"
summary = "Python style guide checker"
files = [
{file = "pycodestyle-2.11.0-py2.py3-none-any.whl", hash = "sha256:5d1013ba8dc7895b548be5afb05740ca82454fd899971563d2ef625d090326f8"},
{file = "pycodestyle-2.11.0.tar.gz", hash = "sha256:259bcc17857d8a8b3b4a2327324b79e5f020a13c16074670f9c8c8f872ea76d0"},
]
[[package]]
name = "pyflakes"
version = "3.1.0"
requires_python = ">=3.8"
summary = "passive checker of Python programs"
files = [
{file = "pyflakes-3.1.0-py2.py3-none-any.whl", hash = "sha256:4132f6d49cb4dae6819e5379898f2b8cce3c5f23994194c24b77d5da2e36f774"},
{file = "pyflakes-3.1.0.tar.gz", hash = "sha256:a0aae034c444db0071aa077972ba4768d40c830d9539fd45bf4cd3f8f6992efc"},
]
[[package]]
name = "pyinstaller"
version = "5.13.0"
requires_python = "<3.13,>=3.7"
version = "6.11.1"
requires_python = "<3.14,>=3.8"
summary = "PyInstaller bundles a Python application and all its dependencies into a single package."
groups = ["build"]
dependencies = [
"altgraph",
"importlib-metadata>=4.6; python_version < \"3.10\"",
"macholib>=1.8; sys_platform == \"darwin\"",
"pefile>=2022.5.30; sys_platform == \"win32\"",
"pyinstaller-hooks-contrib>=2021.4",
"packaging>=22.0",
"pefile!=2024.8.26,>=2022.5.30; sys_platform == \"win32\"",
"pyinstaller-hooks-contrib>=2024.9",
"pywin32-ctypes>=0.2.1; sys_platform == \"win32\"",
"setuptools>=42.0.0",
]
files = [
{file = "pyinstaller-5.13.0-py3-none-macosx_10_13_universal2.whl", hash = "sha256:7fdd319828de679f9c5e381eff998ee9b4164bf4457e7fca56946701cf002c3f"},
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:0df43697c4914285ecd333be968d2cd042ab9b2670124879ee87931d2344eaf5"},
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_i686.whl", hash = "sha256:28d9742c37e9fb518444b12f8c8ab3cb4ba212d752693c34475c08009aa21ccf"},
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:e5fb17de6c325d3b2b4ceaeb55130ad7100a79096490e4c5b890224406fa42f4"},
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:78975043edeb628e23a73fb3ef0a273cda50e765f1716f75212ea3e91b09dede"},
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:cd7d5c06f2847195a23d72ede17c60857d6f495d6f0727dc6c9bc1235f2eb79c"},
{file = "pyinstaller-5.13.0-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:24009eba63cfdbcde6d2634e9c87f545eb67249ddf3b514e0cd3b2cdaa595828"},
{file = "pyinstaller-5.13.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:1fde4381155f21d6354dc450dcaa338cd8a40aaacf6bd22b987b0f3e1f96f3ee"},
{file = "pyinstaller-5.13.0-py3-none-win32.whl", hash = "sha256:2d03419904d1c25c8968b0ad21da0e0f33d8d65716e29481b5bd83f7f342b0c5"},
{file = "pyinstaller-5.13.0-py3-none-win_amd64.whl", hash = "sha256:9fc27c5a853b14a90d39c252707673c7a0efec921cd817169aff3af0fca8c127"},
{file = "pyinstaller-5.13.0-py3-none-win_arm64.whl", hash = "sha256:3a331951f9744bc2379ea5d65d36f3c828eaefe2785f15039592cdc08560b262"},
{file = "pyinstaller-5.13.0.tar.gz", hash = "sha256:5e446df41255e815017d96318e39f65a3eb807e74a796c7e7ff7f13b6366a2e9"},
{file = "pyinstaller-6.11.1-py3-none-macosx_10_13_universal2.whl", hash = "sha256:44e36172de326af6d4e7663b12f71dbd34e2e3e02233e181e457394423daaf03"},
{file = "pyinstaller-6.11.1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:6d12c45a29add78039066a53fb05967afaa09a672426072b13816fe7676abfc4"},
{file = "pyinstaller-6.11.1-py3-none-manylinux2014_i686.whl", hash = "sha256:ddc0fddd75f07f7e423da1f0822e389a42af011f9589e0269b87e0d89aa48c1f"},
{file = "pyinstaller-6.11.1-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:0d6475559c4939f0735122989611d7f739ed3bf02f666ce31022928f7a7e4fda"},
{file = "pyinstaller-6.11.1-py3-none-manylinux2014_s390x.whl", hash = "sha256:e21c7806e34f40181e7606926a14579f848bfb1dc52cbca7eea66eccccbfe977"},
{file = "pyinstaller-6.11.1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:32c742a24fe65d0702958fadf4040f76de85859c26bec0008766e5dbabc5b68f"},
{file = "pyinstaller-6.11.1-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:208c0ef6dab0837a0a273ea32d1a3619a208e3d1fe3fec3785eea71a77fd00ce"},
{file = "pyinstaller-6.11.1-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:ad84abf465bcda363c1d54eafa76745d77b6a8a713778348377dc98d12a452f7"},
{file = "pyinstaller-6.11.1-py3-none-win32.whl", hash = "sha256:2e8365276c5131c9bef98e358fbc305e4022db8bedc9df479629d6414021956a"},
{file = "pyinstaller-6.11.1-py3-none-win_amd64.whl", hash = "sha256:7ac83c0dc0e04357dab98c487e74ad2adb30e7eb186b58157a8faf46f1fa796f"},
{file = "pyinstaller-6.11.1-py3-none-win_arm64.whl", hash = "sha256:35e6b8077d240600bb309ed68bb0b1453fd2b7ab740b66d000db7abae6244423"},
{file = "pyinstaller-6.11.1.tar.gz", hash = "sha256:491dfb4d9d5d1d9650d9507daec1ff6829527a254d8e396badd60a0affcb72ef"},
]
[[package]]
name = "pyinstaller-hooks-contrib"
version = "2023.7"
requires_python = ">=3.7"
version = "2025.0"
requires_python = ">=3.8"
summary = "Community maintained hooks for PyInstaller"
groups = ["build"]
dependencies = [
"importlib-metadata>=4.6; python_version < \"3.10\"",
"packaging>=22.0",
"setuptools>=42.0.0",
]
files = [
{file = "pyinstaller-hooks-contrib-2023.7.tar.gz", hash = "sha256:0c436a4c3506020e34116a8a7ddfd854c1ad6ddca9a8cd84500bd6e69c9e68f9"},
{file = "pyinstaller_hooks_contrib-2023.7-py2.py3-none-any.whl", hash = "sha256:3c10df14c0f71ab388dfbf1625375b087e7330d9444cbfd2b310ba027fa0cff0"},
{file = "pyinstaller_hooks_contrib-2025.0-py3-none-any.whl", hash = "sha256:3c0623799c3f81a37293127f485d65894c20fd718f722cb588785a3e52581ad1"},
{file = "pyinstaller_hooks_contrib-2025.0.tar.gz", hash = "sha256:6dc0b55a1acaab2ffee36ed4a05b073aa0a22e46f25fb5c66a31e217454135ed"},
]
[[package]]
name = "pyparsing"
version = "3.1.1"
requires_python = ">=3.6.8"
version = "3.2.1"
requires_python = ">=3.9"
summary = "pyparsing module - Classes and methods to define and execute parsing grammars"
groups = ["default"]
files = [
{file = "pyparsing-3.1.1-py3-none-any.whl", hash = "sha256:32c7c0b711493c72ff18a981d24f28aaf9c1fb7ed5e9667c9e84e3db623bdbfb"},
{file = "pyparsing-3.1.1.tar.gz", hash = "sha256:ede28a1a32462f5a9705e07aea48001a08f7cf81a021585011deba701581a0db"},
]
[[package]]
name = "pysimplegui"
version = "4.60.5"
summary = "Python GUIs for Humans. Launched in 2018. It's 2022 & PySimpleGUI is an ACTIVE & supported project. Super-simple to create custom GUI's. 325+ Demo programs & Cookbook for rapid start. Extensive documentation. Main docs at www.PySimpleGUI.org. Fun & your success are the focus. Examples using Machine Learning (GUI, OpenCV Integration), Rainmeter Style Desktop Widgets, Matplotlib + Pyplot, PIL support, add GUI to command line scripts, PDF & Image Viewers. Great for beginners & advanced GUI programmers."
files = [
{file = "PySimpleGUI-4.60.5-py3-none-any.whl", hash = "sha256:004f33311ee685a5287fad54f500f7290b40d7c806044e478b1384f85dedce64"},
{file = "PySimpleGUI-4.60.5.tar.gz", hash = "sha256:31014d1cc5eef1373d7e93564ff2604662645cc774a939b1f01aa253e7f9d78b"},
{file = "pyparsing-3.2.1-py3-none-any.whl", hash = "sha256:506ff4f4386c4cec0590ec19e6302d3aedb992fdc02c761e90416f158dacf8e1"},
{file = "pyparsing-3.2.1.tar.gz", hash = "sha256:61980854fd66de3a90028d679a954d5f2623e83144b5afe5ee86f43d762e5f0a"},
]
[[package]]
name = "pywin32-ctypes"
version = "0.2.2"
version = "0.2.3"
requires_python = ">=3.6"
summary = "A (partial) reimplementation of pywin32 using ctypes/cffi"
groups = ["build"]
marker = "sys_platform == \"win32\""
files = [
{file = "pywin32-ctypes-0.2.2.tar.gz", hash = "sha256:3426e063bdd5fd4df74a14fa3cf80a0b42845a87e1d1e81f6549f9daec593a60"},
{file = "pywin32_ctypes-0.2.2-py3-none-any.whl", hash = "sha256:bf490a1a709baf35d688fe0ecf980ed4de11d2b3e37b51e5442587a75d9957e7"},
{file = "pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755"},
{file = "pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8"},
]
[[package]]
name = "ruff"
version = "0.9.2"
requires_python = ">=3.7"
summary = "An extremely fast Python linter and code formatter, written in Rust."
groups = ["format"]
files = [
{file = "ruff-0.9.2-py3-none-linux_armv6l.whl", hash = "sha256:80605a039ba1454d002b32139e4970becf84b5fee3a3c3bf1c2af6f61a784347"},
{file = "ruff-0.9.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b9aab82bb20afd5f596527045c01e6ae25a718ff1784cb92947bff1f83068b00"},
{file = "ruff-0.9.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:fbd337bac1cfa96be615f6efcd4bc4d077edbc127ef30e2b8ba2a27e18c054d4"},
{file = "ruff-0.9.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82b35259b0cbf8daa22a498018e300b9bb0174c2bbb7bcba593935158a78054d"},
{file = "ruff-0.9.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8b6a9701d1e371bf41dca22015c3f89769da7576884d2add7317ec1ec8cb9c3c"},
{file = "ruff-0.9.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9cc53e68b3c5ae41e8faf83a3b89f4a5d7b2cb666dff4b366bb86ed2a85b481f"},
{file = "ruff-0.9.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:8efd9da7a1ee314b910da155ca7e8953094a7c10d0c0a39bfde3fcfd2a015684"},
{file = "ruff-0.9.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3292c5a22ea9a5f9a185e2d131dc7f98f8534a32fb6d2ee7b9944569239c648d"},
{file = "ruff-0.9.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a605fdcf6e8b2d39f9436d343d1f0ff70c365a1e681546de0104bef81ce88df"},
{file = "ruff-0.9.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c547f7f256aa366834829a08375c297fa63386cbe5f1459efaf174086b564247"},
{file = "ruff-0.9.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d18bba3d3353ed916e882521bc3e0af403949dbada344c20c16ea78f47af965e"},
{file = "ruff-0.9.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:b338edc4610142355ccf6b87bd356729b62bf1bc152a2fad5b0c7dc04af77bfe"},
{file = "ruff-0.9.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:492a5e44ad9b22a0ea98cf72e40305cbdaf27fac0d927f8bc9e1df316dcc96eb"},
{file = "ruff-0.9.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:af1e9e9fe7b1f767264d26b1075ac4ad831c7db976911fa362d09b2d0356426a"},
{file = "ruff-0.9.2-py3-none-win32.whl", hash = "sha256:71cbe22e178c5da20e1514e1e01029c73dc09288a8028a5d3446e6bba87a5145"},
{file = "ruff-0.9.2-py3-none-win_amd64.whl", hash = "sha256:c5e1d6abc798419cf46eed03f54f2e0c3adb1ad4b801119dedf23fcaf69b55b5"},
{file = "ruff-0.9.2-py3-none-win_arm64.whl", hash = "sha256:a1b63fa24149918f8b37cef2ee6fff81f24f0d74b6f0bdc37bc3e1f2143e41c6"},
{file = "ruff-0.9.2.tar.gz", hash = "sha256:b5eceb334d55fae5f316f783437392642ae18e16dcf4f1858d55d3c2a0f8f5d0"},
]
[[package]]
name = "setuptools"
version = "68.1.2"
requires_python = ">=3.8"
version = "75.8.0"
requires_python = ">=3.9"
summary = "Easily download, build, install, upgrade, and uninstall Python packages"
groups = ["build"]
files = [
{file = "setuptools-68.1.2-py3-none-any.whl", hash = "sha256:3d8083eed2d13afc9426f227b24fd1659489ec107c0e86cec2ffdde5c92e790b"},
{file = "setuptools-68.1.2.tar.gz", hash = "sha256:3d4dfa6d95f1b101d695a6160a7626e15583af71a5f52176efa5d39a054d475d"},
{file = "setuptools-75.8.0-py3-none-any.whl", hash = "sha256:e3982f444617239225d675215d51f6ba05f845d4eec313da4418fdbb56fb27e3"},
{file = "setuptools-75.8.0.tar.gz", hash = "sha256:c5afc8f407c626b8313a86e10311dd3f661c6cd9c09d4bf8c15c0e11f9f2b0e6"},
]
[[package]]
name = "tomli"
version = "2.0.1"
requires_python = ">=3.7"
version = "2.2.1"
requires_python = ">=3.8"
summary = "A lil' TOML parser"
groups = ["default"]
marker = "python_version < \"3.11\""
files = [
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
{file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"},
{file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"},
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"},
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"},
{file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"},
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"},
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"},
{file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"},
{file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"},
{file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"},
{file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"},
{file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"},
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"},
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"},
{file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"},
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"},
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"},
{file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"},
{file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"},
{file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"},
{file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"},
{file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"},
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"},
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"},
{file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"},
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"},
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"},
{file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"},
{file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"},
{file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"},
{file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"},
{file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"},
]
[[package]]
name = "voicemeeter-api"
version = "2.4.9"
requires_python = ">=3.10,<4.0"
version = "2.6.1"
requires_python = "<4.0,>=3.10"
summary = "A Python wrapper for the Voiceemeter API"
groups = ["default"]
dependencies = [
"tomli<3.0.0,>=2.0.1; python_version < \"3.11\"",
"tomli<3.0,>=2.0.1; python_version < \"3.11\"",
]
files = [
{file = "voicemeeter_api-2.4.9-py3-none-any.whl", hash = "sha256:a09fd07fe3799cd5c880d491048da81d94e49aa97ec753aa1f9289acd27be965"},
{file = "voicemeeter_api-2.4.9.tar.gz", hash = "sha256:47ad614a8b9ccb0b4e47acf65666ce0f0537a0890fffda9949e995bea70e679c"},
{file = "voicemeeter_api-2.6.1-py3-none-any.whl", hash = "sha256:8ae3bce0f9ad6bbad78f2f69f522b6fb2e229d314918a075ad83d4009aff7020"},
{file = "voicemeeter_api-2.6.1.tar.gz", hash = "sha256:34d8672603ec66197f2d61fd8f038f46d8451759c81fbe222b00e7d3ccccd1f5"},
]

View File

@ -1,32 +1,118 @@
[project]
name = "nvda_voicemeeter"
version = "0.3.0"
name = "nvda-voicemeeter"
version = "1.0.0"
description = "A Voicemeeter app compatible with NVDA"
authors = [
{ name = "onyx-and-iris", email = "code@onyxandiris.online" },
{name = "Onyx and Iris", email = "code@onyxandiris.online"},
]
dependencies = [
"pysimplegui>=4.60.5",
"pyparsing>=3.1.1",
"voicemeeter-api>=2.4.9",
]
requires-python = ">=3.10,<3.12"
dependencies = ["pyparsing>=3.2.1", "voicemeeter-api>=2.6.1", "freesimplegui>=5.1.1"]
requires-python = ">=3.10,<3.13"
readme = "README.md"
license = {text = "MIT"}
[project.license]
text = "MIT"
[tool.pdm.dev-dependencies]
[dependency-groups]
format = [
"ruff>=0.9.2",
]
build = [
"pyinstaller>=5.1",
]
lint = [
"black>=23.7.0",
"flake8>=6.1.0",
]
test = [
"psgdemos>=1.12.1",
"pyinstaller>=6.3.0",
]
[tool.pdm.scripts.build]
shell = "build.ps1"
[project.scripts]
gui-basic-nvda = "nvda_voicemeeter.gui.basic:run"
gui-banana-nvda = "nvda_voicemeeter.gui.banana:run"
gui-potato-nvda = "nvda_voicemeeter.gui.potato:run"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pdm]
distribution = true
[tool.pdm.scripts]
build = {shell = "task build"}
compress = {shell = "task compress"}
release = {composite = ["build", "compress"]}
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
line-length = 119
indent-width = 4
# Assume Python 3.10
target-version = "py310"
[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F"]
ignore = []
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
# Unlike Black, use single quotes for strings.
quote-style = "single"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"E402",
"F401",
]

View File

@ -1,4 +1,4 @@
import PySimpleGUI as psg
import FreeSimpleGUI as psg
from . import util
from .compound import LabelSlider
@ -16,7 +16,7 @@ class Builder:
menu = [[self.make_menu()]]
layout0 = []
if self.kind.name == "basic":
if self.kind.name == 'basic':
steps = (
self.make_tab0_row0,
self.make_tab0_row1,
@ -26,7 +26,6 @@ class Builder:
steps = (
self.make_tab0_row0,
self.make_tab0_row1,
self.make_tab0_row2,
self.make_tab0_row3,
self.make_tab0_row4,
self.make_tab0_row5,
@ -63,62 +62,65 @@ class Builder:
def _make_inner_tabgroup(layouts, identifier) -> psg.TabGroup:
inner_layout = []
for i, tabname in enumerate(("buttons", "sliders")):
inner_layout.append([psg.Tab(tabname.capitalize(), layouts[i], key=f"tab||{identifier}||{tabname}")])
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}",
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":
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":
case 'Virtual Strip':
tabgroup = _make_inner_tabgroup((layout2_1, layout2_2), identifier)
case "Buses":
case 'Buses':
tabgroup = _make_inner_tabgroup((layout3_1, layout3_2), identifier)
return psg.Tab(identifier, [[tabgroup]], key=f"tab||{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")
tab_group = psg.TabGroup([tabs], change_submits=True, enable_events=True, key='tabgroup')
return [[menu], [tab_group]]
def make_menu(self) -> psg.Menu:
themes = [f'{theme}::MENU THEME' for theme in util.get_themes_list()]
themes.append('Default::MENU THEME')
menu_def = [
[
"&Voicemeeter",
'&Voicemeeter',
[
"Restart Audio Engine::MENU",
"Save Settings::MENU",
"Load Settings::MENU",
"Load Settings on Startup ::MENU",
'Restart Audio Engine::MENU',
'Save Settings::MENU',
'Load Settings::MENU',
'Load Settings on Startup ::MENU',
],
],
['&Theme', themes],
]
return psg.Menu(menu_def, key="menus")
return psg.Menu(menu_def, key='menus')
def make_tab0_row0(self) -> psg.Frame:
"""tab0 row0 represents hardware ins"""
def add_physical_device_opts(layout):
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}",
f'IN {i + 1}',
size=(6, 3),
menu_def=["", devices],
key=f"HARDWARE IN||{i + 1}",
menu_def=['', devices],
key=f'HARDWARE IN||{i + 1}',
)
for i in range(self.kind.phys_in)
]
@ -126,23 +128,23 @@ class Builder:
hardware_in = []
[step(hardware_in) for step in (add_physical_device_opts,)]
return psg.Frame("Hardware In", hardware_in)
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
else:
num_outs = self.kind.phys_out
layout.append(
[
psg.ButtonMenu(
f"A{i + 1}",
f'A{i + 1}',
size=(6, 3),
menu_def=["", util.get_output_device_list(i, self.vm)],
key=f"HARDWARE OUT||A{i + 1}",
menu_def=['', util.get_output_device_list(i, self.vm)],
key=f'HARDWARE OUT||A{i + 1}',
)
for i in range(num_outs)
]
@ -150,65 +152,28 @@ class Builder:
hardware_out = []
[step(hardware_out) for step in (add_physical_device_opts,)]
return psg.Frame("Hardware Out", hardware_out)
def make_tab0_row2(self) -> psg.Frame:
"""tab0 row2 represents patch asio inputs to strips"""
def add_asio_checkboxes(layout, i):
nums = list(range(99))
layout.append(
[
psg.Spin(
nums,
initial_value=self.window.cache["asio"][f"ASIO CHECKBOX||{util.get_asio_checkbox_index(0, i)}"],
size=2,
enable_events=True,
key=f"ASIO CHECKBOX||IN{i} 0",
)
],
)
layout.append(
[
psg.Spin(
nums,
initial_value=self.window.cache["asio"][f"ASIO CHECKBOX||{util.get_asio_checkbox_index(1, i)}"],
size=2,
enable_events=True,
key=f"ASIO CHECKBOX||IN{i} 1",
)
],
)
inner = []
asio_checkboxlists = ([] for _ in range(self.kind.phys_out))
for i, checkbox_list in enumerate(asio_checkboxlists):
[step(checkbox_list, i + 1) for step in (add_asio_checkboxes,)]
inner.append(psg.Frame(f"In#{i + 1}", checkbox_list))
asio_checkboxes = [inner]
return psg.Frame("PATCH ASIO Inputs to Strips", asio_checkboxes)
return psg.Frame('Hardware Out', hardware_out)
def make_tab0_row3(self) -> psg.Frame:
"""tab0 row3 represents patch composite"""
def add_physical_device_opts(layout):
outputs = util.get_patch_composite_list(self.vm.kind)
outputs = util.get_patch_composite_list(self.kind)
layout.append(
[
psg.ButtonMenu(
f"PC{i + 1}",
size=(6, 2),
menu_def=["", outputs],
key=f"PATCH COMPOSITE||PC{i + 1}",
f'PC{i + 1}',
size=(5, 2),
menu_def=['', outputs],
key=f'PATCH COMPOSITE||PC{i + 1}',
)
for i in range(self.kind.phys_out)
for i in range(self.kind.composite)
]
)
hardware_out = []
[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_row4(self) -> psg.Frame:
"""tab0 row4 represents patch insert"""
@ -220,24 +185,28 @@ class Builder:
[
psg.Checkbox(
text=channel,
default=self.vm.patch.insert[util.get_insert_checkbox_index(self.kind, j, i)].on,
default=self.window.cache['insert'][
f'INSERT CHECKBOX||{util.get_insert_checkbox_index(self.kind, j, i)}'
],
enable_events=True,
key=f"INSERT CHECKBOX||IN{i} {j}",
key=f'INSERT CHECKBOX||IN{i} {j}',
)
],
)
for j, channel in enumerate(("LEFT", "RIGHT"))
for j, channel in enumerate(('LEFT', 'RIGHT'))
]
else:
layout.append(
[
psg.Checkbox(
text=channel,
default=self.vm.patch.insert[util.get_insert_checkbox_index(self.kind, j, i)].on,
default=self.window.cache['insert'][
f'INSERT CHECKBOX||{util.get_insert_checkbox_index(self.kind, j, i)}'
],
enable_events=True,
key=f"INSERT CHECKBOX||IN{i} {j}",
key=f'INSERT CHECKBOX||IN{i} {j}',
)
for j, channel in enumerate(("LEFT", "RIGHT", "C", "LFE", "SL", "SR", "BL", "BR"))
for j, channel in enumerate(('LEFT', 'RIGHT', 'C', 'LFE', 'SL', 'SR', 'BL', 'BR'))
],
)
@ -247,29 +216,29 @@ class Builder:
for i, checkbox_list in enumerate(checkbox_lists):
if i < self.kind.phys_in:
[step(checkbox_list, i + 1) for step in (add_insert_checkboxes,)]
inner.append(psg.Frame(f"In#{i + 1}", checkbox_list))
inner.append(psg.Frame(f'In#{i + 1}', checkbox_list))
else:
[step(checkbox_list, i + 1) for step in (add_insert_checkboxes,)]
asio_checkboxes.append([psg.Frame(f"In#{i + 1}", checkbox_list)])
asio_checkboxes.append([psg.Frame(f'In#{i + 1}', checkbox_list)])
asio_checkboxes.insert(0, inner)
return psg.Frame("PATCH INSERT", asio_checkboxes)
return psg.Frame('PATCH INSERT', asio_checkboxes)
def make_tab0_row5(self) -> psg.Frame:
"""tab0 row5 represents advanced settings"""
return psg.Frame(
"ADVANCED SETTINGS",
'ADVANCED SETTINGS',
[
[
psg.Button(
"ADVANCED SETTINGS",
'ADVANCED SETTINGS',
size=(20, 2),
key="ADVANCED SETTINGS",
key='ADVANCED SETTINGS',
)
],
],
key="ADVANCED SETTINGS FRAME",
key='ADVANCED SETTINGS FRAME',
)
def make_tab1_button_row(self, i) -> psg.Frame:
@ -279,26 +248,26 @@ class Builder:
layout.append(
[
psg.Button(
f"A{j + 1}" if j < self.kind.phys_out else f"B{j - self.kind.phys_out + 1}",
f'A{j + 1}' if j < self.kind.phys_out else f'B{j - self.kind.phys_out + 1}',
size=(4, 2),
key=f"STRIP {i}||A{j + 1}"
key=f'STRIP {i}||A{j + 1}'
if j < self.kind.phys_out
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)
],
)
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"),
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 = []
[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_button_rows(self) -> psg.Frame:
layout = [[self.make_tab1_button_row(i)] for i in range(self.kind.phys_in)]
@ -308,7 +277,7 @@ class Builder:
def add_gain_slider(layout):
layout.append(
[
psg.Text("Gain"),
psg.Text('Gain'),
psg.Slider(
range=(-60, 12),
default_value=self.vm.strip[i].gain,
@ -316,19 +285,20 @@ class Builder:
disable_number_display=True,
expand_x=True,
enable_events=True,
orientation="horizontal",
key=f"STRIP {i}||SLIDER GAIN",
disabled=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)])
layout.append([LabelSlider(self.window, i, param) for param in util.get_slider_params(i, self.kind)])
def add_limit_slider(layout):
layout.append(
[
psg.Text("Limit"),
psg.Text('Limit'),
psg.Slider(
range=(-40, 12),
default_value=self.vm.strip[i].limit,
@ -336,18 +306,18 @@ class Builder:
disable_number_display=True,
expand_x=True,
enable_events=True,
orientation="horizontal",
key=f"STRIP {i}||SLIDER LIMIT",
orientation='horizontal',
key=f'STRIP {i}||SLIDER LIMIT',
),
]
)
layout = []
steps = (add_gain_slider, add_param_sliders)
if self.kind.name in ("banana", "potato"):
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")
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)]
@ -360,11 +330,11 @@ class Builder:
layout.append(
[
psg.Button(
f"A{j + 1}" if j < self.kind.phys_out else f"B{j - self.kind.phys_out + 1}",
f'A{j + 1}' if j < self.kind.phys_out else f'B{j - self.kind.phys_out + 1}',
size=(4, 2),
key=f"STRIP {i}||A{j + 1}"
key=f'STRIP {i}||A{j + 1}'
if j < self.kind.phys_out
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)
]
@ -372,23 +342,27 @@ class Builder:
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"),
psg.Button('K', size=(6, 2), key=f'STRIP {i}||KARAOKE'),
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"),
psg.Button('MC', size=(6, 2), key=f'STRIP {i}||MC'),
psg.Button('Solo', size=(6, 2), key=f'STRIP {i}||SOLO'),
psg.Button('Mute', size=(6, 2), key=f'STRIP {i}||MUTE'),
],
)
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_button_rows(self) -> psg.Frame:
layout = [
@ -400,7 +374,7 @@ class Builder:
def add_gain_slider(layout):
layout.append(
[
psg.Text("Gain"),
psg.Text('Gain'),
psg.Slider(
range=(-60, 12),
default_value=self.vm.strip[i].gain,
@ -408,28 +382,29 @@ class Builder:
disable_number_display=True,
expand_x=True,
enable_events=True,
orientation="horizontal",
key=f"STRIP {i}||SLIDER GAIN",
disabled=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):
if self.kind.name in ('basic', 'banana'):
for param in util.get_slider_params(i, self.kind):
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)
for param in util.get_slider_params(i, self.kind)
]
)
def add_limit_slider(layout):
layout.append(
[
psg.Text("Limit"),
psg.Text('Limit'),
psg.Slider(
range=(-40, 12),
default_value=self.vm.strip[i].limit,
@ -437,18 +412,22 @@ class Builder:
disable_number_display=True,
expand_x=True,
enable_events=True,
orientation="horizontal",
key=f"STRIP {i}||SLIDER LIMIT",
orientation='horizontal',
key=f'STRIP {i}||SLIDER LIMIT',
),
]
)
layout = []
steps = (add_gain_slider, add_param_sliders)
if self.kind.name in ("banana", "potato"):
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")
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 = [
@ -460,24 +439,36 @@ class Builder:
"""tab3 row represents bus composite toggle"""
def add_strip_outputs(layout):
params = ["MONO", "EQ", "MUTE", "MODE"]
if self.vm.kind.name == "basic":
params.remove("EQ")
label = {"MODE": "BUSMODE"}
params = ['MONO', 'EQ', 'MUTE']
if self.kind.name == 'basic':
params.remove('EQ')
busmodes = [util._bus_mode_map[mode] for mode in util.get_bus_modes(self.vm)]
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
*[
psg.Button(
param.capitalize(),
size=(6, 2),
key=f'BUS {i}||{param}',
)
for param in params
],
psg.ButtonMenu(
'BUSMODE',
size=(12, 2),
menu_def=['', busmodes],
key=f'BUS {i}||MODE',
),
]
)
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_button_rows(self) -> psg.Frame:
layout = [[self.make_tab3_button_row(i)] for i in range(self.kind.num_bus)]
@ -487,6 +478,7 @@ class Builder:
def add_gain_slider(layout):
layout.append(
[
psg.Text('Gain'),
psg.Slider(
range=(-60, 12),
default_value=self.vm.bus[i].gain,
@ -494,15 +486,16 @@ class Builder:
disable_number_display=True,
expand_x=True,
enable_events=True,
orientation="horizontal",
key=f"BUS {i}||SLIDER GAIN",
)
disabled=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")
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)]

View File

@ -5,42 +5,42 @@ from pathlib import Path
from .errors import NVDAVMError
bits = 64 if ct.sizeof(ct.c_voidp) == 8 else 32
BITS = 64 if ct.sizeof(ct.c_void_p) == 8 else 32
if platform.system() != "Windows":
raise NVDAVMError("Only Windows OS supported")
if platform.system() != 'Windows':
raise NVDAVMError('Only Windows OS supported')
REG_KEY = "\\".join(
REG_KEY = '\\'.join(
filter(
None,
(
"SOFTWARE",
"WOW6432Node" if bits == 64 else "",
"Microsoft",
"Windows",
"CurrentVersion",
"Uninstall",
"NVDA",
'SOFTWARE',
'WOW6432Node' if BITS == 64 else '',
'Microsoft',
'Windows',
'CurrentVersion',
'Uninstall',
'NVDA',
),
)
)
def get_nvdapath():
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"{}".format(REG_KEY)) as nvda_key:
return winreg.QueryValueEx(nvda_key, r"UninstallDirectory")[0]
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'{}'.format(REG_KEY)) as nvda_key:
return winreg.QueryValueEx(nvda_key, r'UninstallDirectory')[0]
try:
NVDA_PATH = Path(get_nvdapath()) / "nvda.exe"
except FileNotFoundError as e:
NVDA_PATH = ""
NVDA_PATH = Path(get_nvdapath()) / 'nvda.exe'
except FileNotFoundError:
NVDA_PATH = ''
controller_path = Path(__file__).parents[2].resolve() / "controllerClient"
controller_path = Path(__file__).parents[2].resolve() / 'controllerClient'
if not controller_path.exists():
controller_path = Path("controllerClient")
controller_path = Path('_internal') / 'controllerClient'
DLL_PATH = controller_path / f"x{64 if bits == 64 else 86}" / f"nvdaControllerClient{bits}.dll"
DLL_PATH = controller_path / f'x{64 if BITS == 64 else 86}' / 'nvdaControllerClient.dll'
libc = ct.CDLL(str(DLL_PATH))

View File

@ -1,15 +1,22 @@
import PySimpleGUI as psg
from typing import Union
import FreeSimpleGUI as psg
from . import util
class LabelSlider(psg.Frame):
"""Compound Label Slider element"""
"""Compound Label Slider Strip element"""
def __init__(self, parent, i, param, range_=(0, 10), *args, **kwargs):
self.parent = parent
if param in ("AUDIBILITY", "DENOISER"):
if param in ('AUDIBILITY', 'DENOISER'):
size = 7
else:
size = 4
if psg.theme() == 'HighContrast':
size = 5
else:
size = 4
layout = [
[
psg.Text(param.capitalize(), size=size),
@ -21,8 +28,8 @@ class LabelSlider(psg.Frame):
size=(12, 16),
expand_x=True,
enable_events=True,
orientation="horizontal",
key=f"STRIP {i}||SLIDER {param}",
orientation='horizontal',
key=f'STRIP {i}||SLIDER {param}',
),
]
]
@ -30,6 +37,172 @@ class LabelSlider(psg.Frame):
def default_value(self, i, param):
target = getattr(self.parent.vm.strip[i], param.lower())
if param in ("COMP", "GATE", "DENOISER"):
if param in ('COMP', 'GATE', 'DENOISER'):
return target.knob
return target
class CompSlider(psg.Slider):
"""Compressor Slider element"""
def __init__(self, vm, index, param):
self.vm = vm
self.index = index
super().__init__(
disable_number_display=True,
expand_x=True,
enable_events=True,
orientation='horizontal',
key=f'COMPRESSOR||SLIDER {param}',
**self.default_params(param),
)
def default_params(self, param):
match param:
case 'INPUT GAIN':
return {
'range': (-24, 24),
'default_value': self.vm.strip[self.index].comp.gainin,
'resolution': 0.1,
'disabled': True,
}
case 'RATIO':
return {
'range': (1, 8),
'default_value': self.vm.strip[self.index].comp.ratio,
'resolution': 0.1,
}
case 'THRESHOLD':
return {
'range': (-40, -3),
'default_value': self.vm.strip[self.index].comp.threshold,
'resolution': 0.1,
}
case 'ATTACK':
return {
'range': (0, 200),
'default_value': self.vm.strip[self.index].comp.attack,
'resolution': 0.1,
}
case 'RELEASE':
return {
'range': (0, 5000),
'default_value': self.vm.strip[self.index].comp.release,
'resolution': 0.1,
}
case 'KNEE':
return {
'range': (0, 1),
'default_value': self.vm.strip[self.index].comp.knee,
'resolution': 0.01,
}
case 'OUTPUT GAIN':
return {
'range': (-24, 24),
'default_value': self.vm.strip[self.index].comp.gainout,
'resolution': 0.1,
'disabled': True,
}
@staticmethod
def check_bounds(param, val):
match param:
case 'RATIO':
val = util.check_bounds(val, (1, 8))
case 'THRESHOLD':
val = util.check_bounds(val, (-40, -3))
case 'ATTACK':
val = util.check_bounds(val, (0, 200))
case 'RELEASE':
val = util.check_bounds(val, (0, 5000))
case 'KNEE':
val = util.check_bounds(val, (0, 1))
return val
class GateSlider(psg.Slider):
def __init__(self, vm, index, param):
self.vm = vm
self.index = index
super().__init__(
disable_number_display=True,
expand_x=True,
enable_events=True,
orientation='horizontal',
key=f'GATE||SLIDER {param}',
**self.default_params(param),
)
def default_params(self, param):
match param:
case 'THRESHOLD':
return {
'range': (-60, -10),
'default_value': self.vm.strip[self.index].gate.threshold,
'resolution': 0.1,
}
case 'DAMPING':
return {
'range': (-60, -10),
'default_value': self.vm.strip[self.index].gate.damping,
'resolution': 0.1,
}
case 'BPSIDECHAIN':
return {
'range': (100, 4000),
'default_value': self.vm.strip[self.index].gate.bpsidechain,
'resolution': 1,
}
case 'ATTACK':
return {
'range': (0, 1000),
'default_value': self.vm.strip[self.index].gate.attack,
'resolution': 0.1,
}
case 'HOLD':
return {
'range': (0, 5000),
'default_value': self.vm.strip[self.index].gate.hold,
'resolution': 0.1,
}
case 'RELEASE':
return {
'range': (0, 5000),
'default_value': self.vm.strip[self.index].gate.release,
'resolution': 0.1,
}
@staticmethod
def check_bounds(param, val):
match param:
case 'THRESHOLD':
val = util.check_bounds(val, (-60, -10))
case 'DAMPING MAX':
val = util.check_bounds(val, (-60, -10))
case 'BPSIDECHAIN':
val = util.check_bounds(val, (100, 4000))
case 'ATTACK':
val = util.check_bounds(val, (0, 1000))
case 'HOLD':
val = util.check_bounds(val, (0, 5000))
case 'RELEASE':
val = util.check_bounds(val, (0, 5000))
return val
class LabelSliderAdvanced(psg.Frame):
"""Compound Label Slider element for Advanced Comp|Gate"""
def __init__(self, parent, index, param, slider_cls: Union[CompSlider, GateSlider], *args, **kwargs):
label_map = {
'DAMPING': 'Damping Max',
'BPSIDECHAIN': 'BP Sidechain',
}
layout = [
[
psg.Text(label_map.get(param, param.title()), size=10),
slider_cls(parent.vm, index, param),
]
]
super().__init__(None, layout=layout, border_width=0, pad=0, *args, **kwargs)

View File

@ -0,0 +1,34 @@
import json
from pathlib import Path
SETTINGS = Path.cwd() / 'settings.json'
def config_from_json():
data = {}
if not SETTINGS.exists():
return data
with open(SETTINGS, 'r') as f:
data = json.load(f)
return data
config = config_from_json()
def get(key, default=None):
if key in config:
return config[key]
return default
def set(key, value):
config[key] = value
with open(SETTINGS, 'w') as f:
json.dump(config, f)
def delete(key):
del config[key]
with open(SETTINGS, 'w') as f:
json.dump(config, f)

View File

@ -8,4 +8,4 @@ class NVDAVMCAPIError(NVDAVMError):
def __init__(self, fn_name, code):
self.fn_name = fn_name
self.code = code
super().__init__(f"{self.fn_name} returned {self.code}")
super().__init__(f'{self.fn_name} returned {self.code}')

View File

@ -0,0 +1 @@
from .main import run

View File

@ -0,0 +1,11 @@
import voicemeeterlib
import nvda_voicemeeter
def run():
KIND_ID = 'banana'
with voicemeeterlib.api(KIND_ID) as vm:
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
window.run()

View File

@ -0,0 +1 @@
from .main import run

View File

@ -0,0 +1,11 @@
import voicemeeterlib
import nvda_voicemeeter
def run():
KIND_ID = 'basic'
with voicemeeterlib.api(KIND_ID) as vm:
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
window.run()

View File

@ -0,0 +1 @@
from .main import run

View File

@ -0,0 +1,11 @@
import voicemeeterlib
import nvda_voicemeeter
def run():
KIND_ID = 'potato'
with voicemeeterlib.api(KIND_ID) as vm:
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
window.run()

View File

@ -1,53 +1,58 @@
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)}}
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:
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}
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 |= {'HARDWARE OUT||A2': vm.bus[1].device.name}
return hw_outs
def _make_param_cache(vm, channel_type) -> dict:
params = {}
if channel_type == "strip":
if channel_type == 'strip':
match vm.kind.name:
case "basic":
case 'basic':
params |= {
**{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}||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)},
}
case "banana":
case 'banana':
params |= {
**{f"STRIP {i}||A1": vm.strip[i].A1 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}||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}||B2": vm.strip[i].B2 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}||A2': vm.strip[i].A2 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}||B2': vm.strip[i].B2 for i in range(vm.kind.num_strip)},
}
case "potato":
case 'potato':
params |= {
**{f"STRIP {i}||A1": vm.strip[i].A1 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}||A3": vm.strip[i].A3 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}||A5": vm.strip[i].A5 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)},
**{f'STRIP {i}||A1': vm.strip[i].A1 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}||A3': vm.strip[i].A3 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}||A5': vm.strip[i].A5 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)},
}
params |= {
**{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)},
**{f'STRIP {i}||MONO': vm.strip[i].mono for i in range(vm.kind.phys_in)},
**{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)},
}
for i in range(vm.kind.phys_in, vm.kind.phys_in + vm.kind.virt_in):
if i == vm.kind.phys_in + 1:
params[f'STRIP {i}||KARAOKE'] = vm.strip[i].k
else:
params[f'STRIP {i}||MC'] = vm.strip[i].mc
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)},
**{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
@ -55,29 +60,36 @@ def _make_param_cache(vm, channel_type) -> dict:
def _make_label_cache(vm) -> dict:
return {
**{
f"STRIP {i}||LABEL": vm.strip[i].label if vm.strip[i].label else f"Hardware Input {i + 1}"
f'STRIP {i}||LABEL': vm.strip[i].label if vm.strip[i].label else f'Hardware Input {i + 1}'
for i in range(vm.kind.phys_in)
},
**{
f"STRIP {i}||LABEL": vm.strip[i].label if vm.strip[i].label else f"Virtual Input {i - vm.kind.phys_in + 1}"
f'STRIP {i}||LABEL': vm.strip[i].label if vm.strip[i].label else f'Virtual Input {i - vm.kind.phys_in + 1}'
for i in range(vm.kind.phys_in, vm.kind.phys_in + vm.kind.virt_in)
},
**{
f"BUS {i}||LABEL": vm.bus[i].label if vm.bus[i].label else f"Physical Bus {i + 1}"
f'BUS {i}||LABEL': vm.bus[i].label if vm.bus[i].label else f'Physical Bus {i + 1}'
for i in range(vm.kind.phys_out)
},
**{
f"BUS {i}||LABEL": vm.bus[i].label if vm.bus[i].label else f"Virtual Bus {i - vm.kind.phys_out + 1}"
f'BUS {i}||LABEL': vm.bus[i].label if vm.bus[i].label else f'Virtual Bus {i - vm.kind.phys_out + 1}'
for i in range(vm.kind.phys_out, vm.kind.phys_out + vm.kind.virt_out)
},
}
def _make_patch_asio_cache(vm) -> dict:
if vm.kind.name != "basic":
return {**{f"ASIO CHECKBOX||{i}": vm.patch.asio[i].get() for i in range(vm.kind.phys_out * 2)}}
params = {}
if vm.kind.name != 'basic':
params |= {**{f'ASIO INPUT SPINBOX||{i}': vm.patch.asio[i].get() for i in range(vm.kind.phys_out * 2)}}
for i in range(vm.kind.phys_out - 1):
target = getattr(vm.patch, f'A{i + 2}')
params |= {**{f'ASIO OUTPUT A{i + 2} SPINBOX||{j}': target[j].get() for j in range(vm.kind.num_bus)}}
return params
def _make_patch_insert_cache(vm) -> dict:
if vm.kind.name != "basic":
return {**{f"INSERT CHECKBOX||{i}": vm.patch.insert[i].on for i in range(vm.kind.num_strip_levels)}}
params = {}
if vm.kind.name != 'basic':
params |= {**{f'INSERT CHECKBOX||{i}': vm.patch.insert[i].on for i in range(vm.kind.num_strip_levels)}}
return params

View File

@ -4,10 +4,10 @@ from pyparsing import Group, OneOrMore, Optional, Suppress, Word, alphanums, res
class Parser:
def __init__(self):
self.widget = Group(OneOrMore(Word(alphanums)))
self.widget_token = Suppress("||")
self.widget_token = Suppress('||')
self.identifier = Group(OneOrMore(Word(alphanums)))
self.event = Group(OneOrMore(Word(alphanums)))
self.menu_token = Suppress("::")
self.menu_token = Suppress('::')
self.match = (
self.widget + self.widget_token + self.identifier + Optional(self.widget_token) + Optional(self.event)
| self.identifier + self.menu_token + self.event

View File

@ -1,9 +1,10 @@
import logging
from pathlib import Path
import PySimpleGUI as psg
import FreeSimpleGUI as psg
from . import util
from .compound import CompSlider, GateSlider, LabelSliderAdvanced
logger = logging.getLogger(__name__)
@ -11,154 +12,811 @@ logger = logging.getLogger(__name__)
class Popup:
def __init__(self, window):
self.window = window
self.kind = self.window.kind
self.logger = logger.getChild(type(self).__name__)
def save_as(self, message, title=None, initial_folder=None):
layout = [
[psg.Text(message)],
[
psg.FileSaveAs("Browse", initial_folder=str(initial_folder), file_types=(("XML", ".xml"),)),
psg.Button("Cancel"),
psg.FileSaveAs('Browse', initial_folder=str(initial_folder), file_types=(('XML', '.xml'),)),
psg.Button('Cancel'),
],
]
popup = psg.Window(title, layout, finalize=True)
popup["Browse"].bind("<FocusIn>", "||FOCUS IN")
popup["Browse"].bind("<Return>", "||KEY ENTER")
popup["Cancel"].bind("<FocusIn>", "||FOCUS IN")
popup["Cancel"].bind("<Return>", "||KEY ENTER")
popup['Browse'].bind('<FocusIn>', '||FOCUS IN')
popup['Browse'].bind('<Return>', '||KEY ENTER')
popup['Cancel'].bind('<FocusIn>', '||FOCUS IN')
popup['Cancel'].bind('<Return>', '||KEY ENTER')
filepath = None
while True:
event, values = popup.read()
self.logger.debug(f"event::{event}")
self.logger.debug(f"values::{values}")
if event in (psg.WIN_CLOSED, "Cancel"):
self.logger.debug(f'event::{event}')
self.logger.debug(f'values::{values}')
if event in (psg.WIN_CLOSED, 'Cancel'):
break
match parsed_cmd := self.window.parser.match.parseString(event):
case [[button], ["FOCUS", "IN"]]:
if values["Browse"]:
filepath = values["Browse"]
case [[button], ['FOCUS', 'IN']]:
if values['Browse']:
filepath = values['Browse']
break
self.window.nvda.speak(button)
case [[button], ["KEY", "ENTER"]]:
case [_, ['KEY', 'ENTER']]:
popup.find_element_with_focus().click()
self.logger.debug(f"parsed::{parsed_cmd}")
self.logger.debug(f'parsed::{parsed_cmd}')
popup.close()
if filepath:
return Path(filepath)
def rename(self, message, title=None, tab=None):
if tab == "Physical Strip":
upper = self.window.kind.phys_in + 1
elif tab == "Virtual Strip":
upper = self.window.kind.virt_in + 1
elif tab == "Buses":
upper = self.window.kind.num_bus + 1
def on_pdirty(self):
if self.popup.Title == 'Advanced Settings':
if self.kind.name != 'basic':
for key, value in self.window.cache['asio'].items():
if 'INPUT' in key:
identifier, i = key.split('||')
partial = util.get_channel_identifier_list(self.window.vm)[int(i)]
self.popup[f'{identifier}||{partial}'].update(value=value)
elif 'OUTPUT' in key:
self.popup[key].update(value=value)
if self.popup.Title == 'Advanced Compressor':
for param in ('RATIO', 'THRESHOLD', 'ATTACK', 'RELEASE', 'KNEE'):
self.popup[f'COMPRESSOR||SLIDER {param}'].update(
value=getattr(self.window.vm.strip[self.index].comp, param.lower())
)
self.popup['COMPRESSOR||SLIDER INPUT GAIN'].update(value=self.window.vm.strip[self.index].comp.gainin)
self.popup['COMPRESSOR||SLIDER OUTPUT GAIN'].update(value=self.window.vm.strip[self.index].comp.gainout)
elif self.popup.Title == 'Advanced Gate':
for param in ('THRESHOLD', 'DAMPING', 'BPSIDECHAIN', 'ATTACK', 'HOLD', 'RELEASE'):
self.popup[f'GATE||SLIDER {param}'].update(
value=getattr(self.window.vm.strip[self.index].gate, param.lower())
)
def rename(self, message, index, title=None, tab=None):
if 'Strip' in tab:
if index < self.kind.phys_in:
title += f' Physical Strip {index + 1}'
else:
title += f' Virtual Strip {index - self.kind.phys_in + 1}'
else:
if index < self.kind.phys_out:
title += f' Physical Bus {index + 1}'
else:
title += f' Virtual Bus {index - self.kind.phys_out + 1}'
layout = [
[psg.Text(message)],
[
[
psg.Spin(
list(range(1, upper)), initial_value=1, size=2, enable_events=True, key=f"Index", readonly=True
),
psg.Input(key="Edit"),
psg.Input(key='Edit'),
],
[psg.Button("Ok"), psg.Button("Cancel")],
[psg.Button('Ok'), psg.Button('Cancel')],
],
]
popup = psg.Window(title, layout, finalize=True)
popup["Index"].bind("<FocusIn>", "||FOCUS IN")
popup["Edit"].bind("<FocusIn>", "||FOCUS IN")
popup["Ok"].bind("<FocusIn>", "||FOCUS IN")
popup["Ok"].bind("<Return>", "||KEY ENTER")
popup["Cancel"].bind("<FocusIn>", "||FOCUS IN")
popup["Cancel"].bind("<Return>", "||KEY ENTER")
popup['Edit'].bind('<FocusIn>', '||FOCUS IN')
popup['Ok'].bind('<FocusIn>', '||FOCUS IN')
popup['Ok'].bind('<Return>', '||KEY ENTER')
popup['Cancel'].bind('<FocusIn>', '||FOCUS IN')
popup['Cancel'].bind('<Return>', '||KEY ENTER')
data = {}
while True:
event, values = popup.read()
self.logger.debug(f"event::{event}")
self.logger.debug(f"values::{values}")
if event in (psg.WIN_CLOSED, "Cancel"):
self.logger.debug(f'event::{event}')
self.logger.debug(f'values::{values}')
if event in (psg.WIN_CLOSED, 'Cancel'):
break
match parsed_cmd := self.window.parser.match.parseString(event):
case ["Index"]:
val = values["Index"]
self.window.nvda.speak(f"Index {val}")
case [[button], ["FOCUS", "IN"]]:
if button == "Index":
val = values["Index"]
self.window.nvda.speak(f"Index {val}")
else:
self.window.nvda.speak(button)
case [[button], ["KEY", "ENTER"]]:
case [[button], ['FOCUS', 'IN']]:
self.window.nvda.speak(button)
case [_, ['KEY', 'ENTER']]:
popup.find_element_with_focus().click()
case ["Ok"]:
case ['Ok']:
data = values
break
self.logger.debug(f"parsed::{parsed_cmd}")
self.logger.debug(f'parsed::{parsed_cmd}')
popup.close()
return data
def advanced_settings(self, title):
def add_patch_asio_input_to_strips(layout, i):
nums = list(range(99))
layout.append(
[
psg.Spin(
nums,
initial_value=self.window.cache['asio'][
f'ASIO INPUT SPINBOX||{util.get_asio_input_spinbox_index(0, i)}'
],
size=2,
enable_events=True,
key=f'ASIO INPUT SPINBOX||IN{i} 0',
)
],
)
layout.append(
[
psg.Spin(
nums,
initial_value=self.window.cache['asio'][
f'ASIO INPUT SPINBOX||{util.get_asio_input_spinbox_index(1, i)}'
],
size=2,
enable_events=True,
key=f'ASIO INPUT SPINBOX||IN{i} 1',
)
],
)
def add_patch_bus_to_asio_outputs(layout, i):
nums = list(range(99))
layout.append(
[
psg.Spin(
nums,
initial_value=self.window.cache['asio'][f'ASIO OUTPUT A{i} SPINBOX||{j}'],
size=2,
enable_events=True,
key=f'ASIO OUTPUT A{i} SPINBOX||{j}',
)
for j in range(self.kind.num_bus)
],
)
def _make_buffering_frame() -> psg.Frame:
buffer = [
[
psg.ButtonMenu(
driver,
size=(14, 2),
menu_def=["", util.get_asio_samples_list(driver)],
key=f"BUFFER {driver}",
menu_def=['', util.get_asio_samples_list(driver)],
key=f'BUFFER {driver}',
)
for driver in ("MME", "WDM", "KS", "ASIO")
for driver in ('MME', 'WDM', 'KS', 'ASIO')
],
]
return psg.Frame("BUFFERING", buffer)
return psg.Frame('BUFFERING', buffer)
layout = []
if self.kind.name != 'basic':
inner = []
patch_input_to_strips = ([] for _ in range(self.kind.phys_in))
for i, checkbox_list in enumerate(patch_input_to_strips):
[step(checkbox_list, i + 1) for step in (add_patch_asio_input_to_strips,)]
inner.append(psg.Frame(f'In#{i + 1}', checkbox_list))
layout.append([psg.Frame('PATCH ASIO Inputs to Strips', [inner])])
inner_2 = []
patch_output_to_bus = ([] for _ in range(self.kind.phys_out - 1))
for i, checkbox_list in enumerate(patch_output_to_bus):
[step(checkbox_list, i + 2) for step in (add_patch_bus_to_asio_outputs,)]
inner_2.append([psg.Frame(f'OutA{i + 2}', checkbox_list)])
layout.append([psg.Frame('PATCH BUS to A1 ASIO Outputs', [*inner_2])])
steps = (_make_buffering_frame,)
for step in steps:
layout.append([step()])
layout.append([psg.Button("Exit", size=(8, 2))])
layout.append([psg.Button('Exit', size=(8, 2))])
popup = psg.Window(title, layout, finalize=True)
buttonmenu_opts = {"takefocus": 1, "highlightthickness": 1}
for driver in ("MME", "WDM", "KS", "ASIO"):
popup[f"BUFFER {driver}"].Widget.config(**buttonmenu_opts)
popup[f"BUFFER {driver}"].bind("<FocusIn>", "||FOCUS IN")
popup[f"BUFFER {driver}"].bind("<space>", "||KEY SPACE", propagate=False)
popup[f"BUFFER {driver}"].bind("<Return>", "||KEY ENTER", propagate=False)
popup["Exit"].bind("<FocusIn>", "||FOCUS IN")
popup["Exit"].bind("<Return>", "||KEY ENTER")
self.popup = psg.Window(title, layout, finalize=True)
if self.kind.name != 'basic':
for i in range(self.kind.phys_out):
self.popup[f'ASIO INPUT SPINBOX||IN{i + 1} 0'].Widget.config(state='readonly')
self.popup[f'ASIO INPUT SPINBOX||IN{i + 1} 1'].Widget.config(state='readonly')
for i in range(self.kind.phys_out - 1):
for j in range(self.kind.num_bus):
self.popup[f'ASIO OUTPUT A{i + 2} SPINBOX||{j}'].Widget.config(state='readonly')
if self.kind.name != 'basic':
for i in range(self.kind.phys_out):
self.popup[f'ASIO INPUT SPINBOX||IN{i + 1} 0'].bind('<FocusIn>', '||FOCUS IN')
self.popup[f'ASIO INPUT SPINBOX||IN{i + 1} 1'].bind('<FocusIn>', '||FOCUS IN')
for i in range(self.kind.phys_out - 1):
for j in range(self.kind.num_bus):
self.popup[f'ASIO OUTPUT A{i + 2} SPINBOX||{j}'].bind('<FocusIn>', '||FOCUS IN')
buttonmenu_opts = {'takefocus': 1, 'highlightthickness': 1}
for driver in ('MME', 'WDM', 'KS', 'ASIO'):
self.popup[f'BUFFER {driver}'].Widget.config(**buttonmenu_opts)
self.popup[f'BUFFER {driver}'].bind('<FocusIn>', '||FOCUS IN')
self.popup[f'BUFFER {driver}'].bind('<space>', '||KEY SPACE', propagate=False)
self.popup[f'BUFFER {driver}'].bind('<Return>', '||KEY ENTER', propagate=False)
self.popup['Exit'].bind('<FocusIn>', '||FOCUS IN')
self.popup['Exit'].bind('<Return>', '||KEY ENTER')
self.window.vm.observer.add(self.on_pdirty)
while True:
event, values = popup.read()
self.logger.debug(f"event::{event}")
self.logger.debug(f"values::{values}")
if event in (psg.WIN_CLOSED, "Exit"):
event, values = self.popup.read()
self.logger.debug(f'event::{event}')
self.logger.debug(f'values::{values}')
if event in (psg.WIN_CLOSED, 'Exit'):
break
match parsed_cmd := self.window.parser.match.parseString(event):
case ["BUFFER MME" | "BUFFER WDM" | "BUFFER KS" | "BUFFER ASIO"]:
if values[event] == "Default":
if "MME" in event:
case [['ASIO', 'INPUT', 'SPINBOX'], [in_num, channel]]:
index = util.get_asio_input_spinbox_index(int(channel), int(in_num[-1]))
val = values[f'ASIO INPUT SPINBOX||{in_num} {channel}']
self.window.vm.patch.asio[index].set(val)
channel = ('left', 'right')[int(channel)]
self.window.nvda.speak(str(val))
case [['ASIO', 'INPUT', 'SPINBOX'], [in_num, channel], ['FOCUS', 'IN']]:
if self.popup.find_element_with_focus() is not None:
val = values[f'ASIO INPUT SPINBOX||{in_num} {channel}']
channel = ('left', 'right')[int(channel)]
num = int(in_num[-1])
self.window.nvda.speak(f'Patch ASIO inputs to strips IN#{num} {channel} {val}')
case [['ASIO', 'OUTPUT', param, 'SPINBOX'], [index]]:
target = getattr(self.window.vm.patch, param)[int(index)]
target.set(values[event])
self.window.nvda.speak(str(values[event]))
case [['ASIO', 'OUTPUT', param, 'SPINBOX'], [index], ['FOCUS', 'IN']]:
if self.popup.find_element_with_focus() is not None:
val = values[f'ASIO OUTPUT {param} SPINBOX||{index}']
self.window.nvda.speak(
f'Patch BUS to A1 ASIO Outputs OUT {param} channel {int(index) + 1} {val}'
)
case ['BUFFER MME' | 'BUFFER WDM' | 'BUFFER KS' | 'BUFFER ASIO']:
if values[event] == 'Default':
if 'MME' in event:
val = 1024
elif "WDM" in event or "KS" in event:
elif 'WDM' in event or 'KS' in event:
val = 512
else:
val = 0
else:
val = int(values[event])
driver = event.split()[1]
self.window.vm.set(f"option.buffer.{driver.lower()}", val)
self.window.vm.set(f'option.buffer.{driver.lower()}', val)
self.window.TKroot.after(
200, self.window.nvda.speak, f"{driver} BUFFER {val if val else 'default'}"
200, self.window.nvda.speak, f'{driver} BUFFER {val if val else "default"}'
)
case [["BUFFER", driver], ["FOCUS", "IN"]]:
val = int(self.window.vm.get(f"option.buffer.{driver.lower()}"))
self.window.nvda.speak(f"{driver} BUFFER {val if val else 'default'}")
case [["BUFFER", driver], ["KEY", "SPACE" | "ENTER"]]:
util.open_context_menu_for_buttonmenu(popup, f"BUFFER {driver}")
case [[button], ["FOCUS", "IN"]]:
case [['BUFFER', driver], ['FOCUS', 'IN']]:
val = int(self.window.vm.get(f'option.buffer.{driver.lower()}'))
self.window.nvda.speak(f'{driver} BUFFER {val if val else "default"}')
case [['BUFFER', driver], ['KEY', 'SPACE' | 'ENTER']]:
util.open_context_menu_for_buttonmenu(self.popup, f'BUFFER {driver}')
case [[button], ['FOCUS', 'IN']]:
self.window.nvda.speak(button)
case [[button], ["KEY", "ENTER"]]:
popup.find_element_with_focus().click()
self.logger.debug(f"parsed::{parsed_cmd}")
popup.close()
case [_, ['KEY', 'ENTER']]:
self.popup.find_element_with_focus().click()
self.logger.debug(f'parsed::{parsed_cmd}')
self.window.vm.observer.remove(self.on_pdirty)
self.popup.close()
def compressor(self, index, title=None):
self.index = index
def _make_comp_frame() -> psg.Frame:
comp_layout = [
[LabelSliderAdvanced(self.window, index, param, CompSlider)]
for param in ('INPUT GAIN', 'RATIO', 'THRESHOLD', 'ATTACK', 'RELEASE', 'KNEE', 'OUTPUT GAIN')
]
return psg.Frame('ADVANCED COMPRESSOR', comp_layout)
layout = []
steps = (_make_comp_frame,)
for step in steps:
layout.append([step()])
layout.append([psg.Button('MAKEUP', size=(12, 1)), psg.Button('Exit', size=(8, 1))])
self.popup = psg.Window(title, layout, return_keyboard_events=False, finalize=True)
buttonmenu_opts = {'takefocus': 1, 'highlightthickness': 1}
for param in ('INPUT GAIN', 'RATIO', 'THRESHOLD', 'ATTACK', 'RELEASE', 'KNEE', 'OUTPUT GAIN'):
self.popup[f'COMPRESSOR||SLIDER {param}'].Widget.config(**buttonmenu_opts)
self.popup[f'COMPRESSOR||SLIDER {param}'].bind('<FocusIn>', '||FOCUS IN')
self.popup[f'COMPRESSOR||SLIDER {param}'].bind('<FocusOut>', '||FOCUS OUT')
for event in ('KeyPress', 'KeyRelease'):
event_id = event.removeprefix('Key').upper()
for direction in ('Left', 'Right', 'Up', 'Down'):
self.popup[f'COMPRESSOR||SLIDER {param}'].bind(
f'<{event}-{direction}>', f'||KEY {direction.upper()} {event_id}'
)
self.popup[f'COMPRESSOR||SLIDER {param}'].bind(
f'<Shift-{event}-{direction}>', f'||KEY SHIFT {direction.upper()} {event_id}'
)
self.popup[f'COMPRESSOR||SLIDER {param}'].bind(
f'<Control-{event}-{direction}>', f'||KEY CTRL {direction.upper()} {event_id}'
)
if param == 'RELEASE':
self.popup[f'COMPRESSOR||SLIDER {param}'].bind(
f'<Alt-{event}-{direction}>', f'||KEY ALT {direction.upper()} {event_id}'
)
self.popup[f'COMPRESSOR||SLIDER {param}'].bind(
f'<Control-Alt-{event}-{direction}>', f'||KEY CTRL ALT {direction.upper()} {event_id}'
)
self.popup[f'COMPRESSOR||SLIDER {param}'].bind('<Control-Shift-KeyPress-R>', '||KEY CTRL SHIFT R')
self.popup['MAKEUP'].bind('<FocusIn>', '||FOCUS IN')
self.popup['MAKEUP'].bind('<Return>', '||KEY ENTER')
self.popup['Exit'].bind('<FocusIn>', '||FOCUS IN')
self.popup['Exit'].bind('<Return>', '||KEY ENTER')
self.window.vm.observer.add(self.on_pdirty)
while True:
event, values = self.popup.read()
self.logger.debug(f'event::{event}')
self.logger.debug(f'values::{values}')
if event in (psg.WIN_CLOSED, 'Exit'):
break
match parsed_cmd := self.window.parser.match.parseString(event):
case [['COMPRESSOR'], ['SLIDER', param]]:
setattr(self.window.vm.strip[index].comp, param.lower(), values[event])
case [['COMPRESSOR'], ['SLIDER', param], ['FOCUS', 'IN']]:
self.window.nvda.speak(f'{param} {values[f"COMPRESSOR||SLIDER {param}"]}')
case [
['COMPRESSOR'],
['SLIDER', param],
['KEY', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = getattr(self.window.vm.strip[index].comp, param.lower())
match input_direction:
case 'RIGHT' | 'UP':
if param == 'KNEE':
val += 0.1
else:
val += 1
case 'LEFT' | 'DOWN':
if param == 'KNEE':
val -= 0.1
else:
val -= 1
val = CompSlider.check_bounds(param, val)
setattr(self.window.vm.strip[index].comp, param.lower(), val)
self.popup[f'COMPRESSOR||SLIDER {param}'].update(value=val)
if param == 'KNEE':
self.window.nvda.speak(str(round(val, 2)))
else:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['COMPRESSOR'],
['SLIDER', param],
['KEY', 'CTRL', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = getattr(self.window.vm.strip[index].comp, param.lower())
match input_direction:
case 'RIGHT' | 'UP':
if param == 'KNEE':
val += 0.3
elif param == 'RELEASE':
val += 5
else:
val += 3
case 'LEFT' | 'DOWN':
if param == 'KNEE':
val -= 0.3
elif param == 'RELEASE':
val -= 5
else:
val -= 3
val = CompSlider.check_bounds(param, val)
setattr(self.window.vm.strip[index].comp, param.lower(), val)
self.popup[f'COMPRESSOR||SLIDER {param}'].update(value=val)
if param == 'KNEE':
self.window.nvda.speak(str(round(val, 2)))
else:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['COMPRESSOR'],
['SLIDER', param],
['KEY', 'SHIFT', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = getattr(self.window.vm.strip[index].comp, param.lower())
match input_direction:
case 'RIGHT' | 'UP':
if param == 'KNEE':
val += 0.01
else:
val += 0.1
case 'LEFT' | 'DOWN':
if param == 'KNEE':
val -= 0.01
else:
val -= 0.1
val = CompSlider.check_bounds(param, val)
setattr(self.window.vm.strip[index].comp, param.lower(), val)
self.popup[f'COMPRESSOR||SLIDER {param}'].update(value=val)
if param == 'KNEE':
self.window.nvda.speak(str(round(val, 2)))
else:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['COMPRESSOR'],
['SLIDER', 'RELEASE'],
['KEY', 'ALT', 'LEFT' | 'RIGHT' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = self.window.vm.strip[index].comp.release
match input_direction:
case 'RIGHT' | 'UP':
val += 10
case 'LEFT' | 'DOWN':
val -= 10
val = util.check_bounds(val, (0, 5000))
self.window.vm.strip[index].comp.release = val
self.popup[f'COMPRESSOR||SLIDER {param}'].update(value=val)
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['COMPRESSOR'],
['SLIDER', 'RELEASE'],
['KEY', 'CTRL', 'ALT', 'LEFT' | 'RIGHT' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = self.window.vm.strip[index].comp.release
match input_direction:
case 'RIGHT' | 'UP':
val += 50
case 'LEFT' | 'DOWN':
val -= 50
val = util.check_bounds(val, (0, 5000))
self.window.vm.strip[index].comp.release = val
self.popup[f'COMPRESSOR||SLIDER {param}'].update(value=val)
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [['COMPRESSOR'], ['SLIDER', 'INPUT' | 'OUTPUT' as direction, 'GAIN']]:
if direction == 'INPUT':
self.window.vm.strip[index].comp.gainin = values[event]
else:
self.window.vm.strip[index].comp.gainout = values[event]
case [['COMPRESSOR'], ['SLIDER', 'INPUT' | 'OUTPUT' as direction, 'GAIN'], ['FOCUS', 'IN']]:
label = f'{direction} GAIN'
self.window.nvda.speak(f'{label} {values[f"COMPRESSOR||SLIDER {label}"]}')
case [
['COMPRESSOR'],
['SLIDER', 'INPUT' | 'OUTPUT' as direction, 'GAIN'],
['KEY', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
if direction == 'INPUT':
val = self.window.vm.strip[index].comp.gainin
else:
val = self.window.vm.strip[index].comp.gainout
match input_direction:
case 'RIGHT' | 'UP':
val += 1
case 'LEFT' | 'DOWN':
val -= 1
val = util.check_bounds(val, (-24, 24))
if direction == 'INPUT':
self.window.vm.strip[index].comp.gainin = val
else:
self.window.vm.strip[index].comp.gainout = val
self.popup[f'COMPRESSOR||SLIDER {direction} GAIN'].update(value=val)
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['COMPRESSOR'],
['SLIDER', 'INPUT' | 'OUTPUT' as direction, 'GAIN'],
['KEY', 'CTRL', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
if direction == 'INPUT':
val = self.window.vm.strip[index].comp.gainin
else:
val = self.window.vm.strip[index].comp.gainout
match input_direction:
case 'RIGHT' | 'UP':
val += 3
case 'LEFT' | 'DOWN':
val -= 3
val = util.check_bounds(val, (-24, 24))
if direction == 'INPUT':
self.window.vm.strip[index].comp.gainin = val
else:
self.window.vm.strip[index].comp.gainout = val
self.popup[f'COMPRESSOR||SLIDER {direction} GAIN'].update(value=val)
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['COMPRESSOR'],
['SLIDER', 'INPUT' | 'OUTPUT' as direction, 'GAIN'],
['KEY', 'SHIFT', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
if direction == 'INPUT':
val = self.window.vm.strip[index].comp.gainin
else:
val = self.window.vm.strip[index].comp.gainout
match input_direction:
case 'RIGHT' | 'UP':
val += 0.1
case 'LEFT' | 'DOWN':
val -= 0.1
val = util.check_bounds(val, (-24, 24))
if direction == 'INPUT':
self.window.vm.strip[index].comp.gainin = val
else:
self.window.vm.strip[index].comp.gainout = val
self.popup[f'COMPRESSOR||SLIDER {direction} GAIN'].update(value=val)
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['COMPRESSOR'],
['SLIDER', 'INPUT' | 'OUTPUT' as direction, 'GAIN'],
['KEY', 'CTRL', 'SHIFT', 'R'],
]:
if direction == 'INPUT':
self.window.vm.strip[index].comp.gainin = 0
else:
self.window.vm.strip[index].comp.gainout = 0
self.popup[f'COMPRESSOR||SLIDER {direction} GAIN'].update(value=0)
self.window.nvda.speak(str(0))
case [['COMPRESSOR'], ['SLIDER', param], ['KEY', 'CTRL', 'SHIFT', 'R']]:
match param:
case 'RATIO':
val = 1
case 'THRESHOLD':
val = -20
case 'ATTACK':
val = 10
case 'RELEASE':
val = 50
case 'KNEE':
val = 0.5
setattr(self.window.vm.strip[index].comp, param.lower(), val)
self.popup[f'COMPRESSOR||SLIDER {param}'].update(value=val)
self.window.nvda.speak(str(round(val, 1)))
case ['MAKEUP']:
val = not self.window.vm.strip[index].comp.makeup
self.window.vm.strip[index].comp.makeup = val
self.window.nvda.speak('on' if val else 'off')
case [[button], ['FOCUS', 'IN']]:
if button == 'MAKEUP':
self.window.nvda.speak(
f'{button} {"on" if self.window.vm.strip[index].comp.makeup else "off"}'
)
else:
self.window.nvda.speak(button)
case [_, ['KEY', 'ENTER']]:
self.popup.find_element_with_focus().click()
self.logger.debug(f'parsed::{parsed_cmd}')
self.window.vm.observer.remove(self.on_pdirty)
self.popup.close()
def gate(self, index, title=None):
self.index = index
def _make_gate_frame() -> psg.Frame:
gate_layout = [
[LabelSliderAdvanced(self.window, index, param, GateSlider)]
for param in ('THRESHOLD', 'DAMPING', 'BPSIDECHAIN', 'ATTACK', 'HOLD', 'RELEASE')
]
return psg.Frame('ADVANCED GATE', gate_layout)
layout = []
steps = (_make_gate_frame,)
for step in steps:
layout.append([step()])
layout.append([psg.Button('Exit', size=(8, 1))])
self.popup = psg.Window(title, layout, return_keyboard_events=False, finalize=True)
buttonmenu_opts = {'takefocus': 1, 'highlightthickness': 1}
for param in ('THRESHOLD', 'DAMPING', 'BPSIDECHAIN', 'ATTACK', 'HOLD', 'RELEASE'):
self.popup[f'GATE||SLIDER {param}'].Widget.config(**buttonmenu_opts)
self.popup[f'GATE||SLIDER {param}'].bind('<FocusIn>', '||FOCUS IN')
self.popup[f'GATE||SLIDER {param}'].bind('<FocusOut>', '||FOCUS OUT')
for event in ('KeyPress', 'KeyRelease'):
event_id = event.removeprefix('Key').upper()
for direction in ('Left', 'Right', 'Up', 'Down'):
self.popup[f'GATE||SLIDER {param}'].bind(
f'<{event}-{direction}>', f'||KEY {direction.upper()} {event_id}'
)
self.popup[f'GATE||SLIDER {param}'].bind(
f'<Shift-{event}-{direction}>', f'||KEY SHIFT {direction.upper()} {event_id}'
)
self.popup[f'GATE||SLIDER {param}'].bind(
f'<Control-{event}-{direction}>', f'||KEY CTRL {direction.upper()} {event_id}'
)
if param in ('BPSIDECHAIN', 'ATTACK', 'HOLD', 'RELEASE'):
self.popup[f'GATE||SLIDER {param}'].bind(
f'<Alt-{event}-{direction}>', f'||KEY ALT {direction.upper()} {event_id}'
)
self.popup[f'GATE||SLIDER {param}'].bind(
f'<Control-Alt-{event}-{direction}>', f'||KEY CTRL ALT {direction.upper()} {event_id}'
)
self.popup[f'GATE||SLIDER {param}'].bind('<Control-Shift-KeyPress-R>', '||KEY CTRL SHIFT R')
self.popup['Exit'].bind('<FocusIn>', '||FOCUS IN')
self.popup['Exit'].bind('<Return>', '||KEY ENTER')
self.window.vm.observer.add(self.on_pdirty)
while True:
event, values = self.popup.read()
self.logger.debug(f'event::{event}')
self.logger.debug(f'values::{values}')
if event in (psg.WIN_CLOSED, 'Exit'):
break
match parsed_cmd := self.window.parser.match.parseString(event):
case [['GATE'], ['SLIDER', param]]:
setattr(self.window.vm.strip[index].gate, param.lower(), values[event])
case [['GATE'], ['SLIDER', param], ['FOCUS', 'IN']]:
label_map = {
'DAMPING': 'Damping Max',
'BPSIDECHAIN': 'BP Sidechain',
}
self.window.nvda.speak(f'{label_map.get(param, param)} {values[f"GATE||SLIDER {param}"]}')
case [
['GATE'],
['SLIDER', param],
['KEY', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = getattr(self.window.vm.strip[index].gate, param.lower())
match input_direction:
case 'RIGHT' | 'UP':
val += 1
case 'LEFT' | 'DOWN':
val -= 1
val = GateSlider.check_bounds(param, val)
setattr(self.window.vm.strip[index].gate, param.lower(), val)
self.popup[f'GATE||SLIDER {param}'].update(value=val)
if param == 'BPSIDECHAIN':
self.window.nvda.speak(str(int(val)))
else:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['GATE'],
['SLIDER', param],
['KEY', 'CTRL', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = getattr(self.window.vm.strip[index].gate, param.lower())
match input_direction:
case 'RIGHT' | 'UP':
val += 3
case 'LEFT' | 'DOWN':
val -= 3
val = GateSlider.check_bounds(param, val)
setattr(self.window.vm.strip[index].gate, param.lower(), val)
self.popup[f'GATE||SLIDER {param}'].update(value=val)
if param == 'BPSIDECHAIN':
self.window.nvda.speak(str(int(val)))
else:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['GATE'],
['SLIDER', param],
['KEY', 'SHIFT', 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = getattr(self.window.vm.strip[index].gate, param.lower())
match input_direction:
case 'RIGHT' | 'UP':
val += 0.1
case 'LEFT' | 'DOWN':
val -= 0.1
val = GateSlider.check_bounds(param, val)
setattr(self.window.vm.strip[index].gate, param.lower(), val)
self.popup[f'GATE||SLIDER {param}'].update(value=val)
if param == 'BPSIDECHAIN':
self.window.nvda.speak(str(int(val)))
else:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['GATE'],
['SLIDER', 'BPSIDECHAIN' | 'ATTACK' | 'HOLD' | 'RELEASE' as param],
['KEY', 'ALT', 'LEFT' | 'RIGHT' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = getattr(self.window.vm.strip[index].gate, param.lower())
match input_direction:
case 'RIGHT' | 'UP':
val += 10
case 'LEFT' | 'DOWN':
val -= 10
val = GateSlider.check_bounds(param, val)
setattr(self.window.vm.strip[index].gate, param.lower(), val)
self.popup[f'GATE||SLIDER {param}'].update(value=val)
if param == 'BPSIDECHAIN':
self.window.nvda.speak(str(int(val)))
else:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [
['GATE'],
['SLIDER', 'BPSIDECHAIN' | 'ATTACK' | 'HOLD' | 'RELEASE' as param],
['KEY', 'CTRL', 'ALT', 'LEFT' | 'RIGHT' as input_direction, 'PRESS' | 'RELEASE' as e],
]:
if e == 'PRESS':
self.window.vm.event.pdirty = False
val = getattr(self.window.vm.strip[index].gate, param.lower())
match input_direction:
case 'RIGHT' | 'UP':
val += 50
case 'LEFT' | 'DOWN':
val -= 50
val = GateSlider.check_bounds(param, val)
setattr(self.window.vm.strip[index].gate, param.lower(), val)
self.popup[f'GATE||SLIDER {param}'].update(value=val)
if param == 'BPSIDECHAIN':
self.window.nvda.speak(str(int(val)))
else:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [['GATE'], ['SLIDER', param], ['KEY', 'CTRL', 'SHIFT', 'R']]:
match param:
case 'THRESHOLD':
val = -60
case 'DAMPING':
val = -60
case 'BPSIDECHAIN':
val = 100
case 'ATTACK':
val = 0
case 'HOLD':
val = 500
case 'RELEASE':
val = 1000
setattr(self.window.vm.strip[index].gate, param.lower(), val)
self.popup[f'GATE||SLIDER {param}'].update(value=val)
self.window.nvda.speak(str(round(val, 1)))
case [[button], ['FOCUS', 'IN']]:
self.window.nvda.speak(button)
case [_, ['KEY', 'ENTER']]:
self.popup.find_element_with_focus().click()
self.logger.debug(f'parsed::{parsed_cmd}')
self.window.vm.observer.remove(self.on_pdirty)
self.popup.close()

View File

@ -1,7 +1,9 @@
from typing import Iterable
import FreeSimpleGUI as psg
def get_asio_checkbox_index(channel, num) -> int:
def get_asio_input_spinbox_index(channel, num) -> int:
if channel == 0:
return 2 * num - 2
return 2 * num - 1
@ -16,9 +18,9 @@ def get_insert_checkbox_index(kind, channel, num) -> int:
_rejected_ids = (
"VBAudio100VMVAIO3",
"{F5735BD4-6EAF-4758-9710-9886E5AD0FF3}",
"{0239BE07-CEEF-4236-A900-AA778D432FD4}",
'VBAudio100VMVAIO3',
'{F5735BD4-6EAF-4758-9710-9886E5AD0FF3}',
'{0239BE07-CEEF-4236-A900-AA778D432FD4}',
)
@ -26,8 +28,8 @@ def get_input_device_list(vm) -> list:
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))
if device['id'] not in _rejected_ids:
devices.append('{type}: {name}'.format(**device))
return devices
@ -35,34 +37,37 @@ 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 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")]
devices.append('- remove device selection -')
return [device for device in devices if not device.startswith('asio')]
def get_patch_composite_list(kind) -> list:
temp = []
for i in range(kind.phys_out):
[temp.append(f"IN#{i + 1} {channel}") for channel in ("Left", "Right")]
[temp.append(f'IN#{i + 1} {channel}') for channel in ('Left', 'Right')]
for i in range(kind.phys_out, kind.phys_out + kind.virt_out):
[temp.append(f"IN#{i + 1} {channel}") for channel in ("Left", "Right", "Center", "LFE", "SL", "SR", "BL", "BR")]
temp.append(f"BUS Channel")
[
temp.append(f'IN#{i + 1} {channel}')
for channel in ('Left', 'Right', 'Center', 'LFE', 'SL', 'SR', 'BL', 'BR')
]
temp.append('BUS Channel')
return temp
def get_patch_insert_channels() -> list:
return [
"left",
"right",
"center",
"low frequency effect",
"surround left",
"surround right",
"back left",
"back right",
'left',
'right',
'center',
'low frequency effect',
'surround left',
'surround right',
'back left',
'back right',
]
@ -70,8 +75,8 @@ _patch_insert_channels = get_patch_insert_channels()
def get_asio_samples_list(driver) -> list:
if driver == "MME":
samples = ["2048", "1536", "1024", "896", "768", "704", "640", "576", "512", "480", "441"]
if driver == 'MME':
samples = ['2048', '1536', '1024', '896', '768', '704', '640', '576', '512', '480', '441']
else:
# fmt: off
samples = [
@ -79,14 +84,14 @@ def get_asio_samples_list(driver) -> list:
"352", "320", "288", "256", "224", "192", "160", "128"
]
# fmt: on
if driver == "ASIO":
samples = [x for x in samples if x not in ("2048", "1536")]
samples.append("Default")
if driver == 'ASIO':
samples = [x for x in samples if x not in ('2048', '1536')]
samples.append('Default')
return samples
def get_tabs_labels() -> list:
return ["Settings", "Physical Strip", "Virtual Strip", "Buses"]
return ['Settings', 'Physical Strip', 'Virtual Strip', 'Buses']
def open_context_menu_for_buttonmenu(window, identifier) -> None:
@ -101,34 +106,52 @@ def get_channel_identifier_list(vm) -> list:
identifiers = []
for i in range(vm.kind.phys_in):
for j in range(2):
identifiers.append(f"IN{i + 1} {j}")
identifiers.append(f'IN{i + 1} {j}')
for i in range(vm.kind.phys_in, vm.kind.phys_in + vm.kind.virt_in):
for j in range(8):
identifiers.append(f"IN{i + 1} {j}")
identifiers.append(f'IN{i + 1} {j}')
return identifiers
_bus_mode_map = {
'normal': 'Normal',
'amix': 'Mix Down A',
'bmix': 'Mix Down B',
'repeat': 'Stereo Repeat',
'composite': 'Composite',
'tvmix': 'Up Mix TV',
'upmix21': 'Up Mix 2.1',
'upmix41': 'Up Mix 4.1',
'upmix61': 'Up Mix 6.1',
'centeronly': 'Center Only',
'lfeonly': 'Low Frequency Effect Only',
'rearonly': 'Rear Only',
}
_bus_mode_map_reversed = dict((reversed(item) for item in _bus_mode_map.items()))
def get_bus_modes(vm) -> list:
if vm.kind.name == "basic":
if vm.kind.name == 'basic':
return [
"normal",
"amix",
"repeat",
"composite",
'normal',
'amix',
'repeat',
'composite',
]
return [
"normal",
"amix",
"bmix",
"repeat",
"composite",
"tvmix",
"upmix21",
"upmix41",
"upmix61",
"centeronly",
"lfeonly",
"rearonly",
'normal',
'amix',
'bmix',
'repeat',
'composite',
'tvmix',
'upmix21',
'upmix41',
'upmix61',
'centeronly',
'lfeonly',
'rearonly',
]
@ -141,12 +164,79 @@ def check_bounds(val, bounds: tuple) -> int | float:
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")
def get_slider_params(i, kind) -> Iterable:
if i < kind.phys_in:
if kind.name == 'basic':
return ('AUDIBILITY',)
if kind.name == 'banana':
return ('COMP', 'GATE')
if kind.name == 'potato':
return ('COMP', 'GATE', 'DENOISER')
return ('BASS', 'MID', 'TREBLE')
def get_full_slider_params(i, kind) -> Iterable:
params = list(get_slider_params(i, kind) + ('GAIN', 'LIMIT'))
if kind.name == 'basic':
params.remove('LIMIT')
return params
def get_slider_modes() -> Iterable:
return (
'GAIN MODE',
'BASS MODE',
'MID MODE',
'TREBLE MODE',
'AUDIBILITY MODE',
'COMP MODE',
'GATE MODE',
'DENOISER MODE',
'LIMIT MODE',
)
def _get_bus_assignments(kind) -> list:
return [f'A{i}' for i in range(1, kind.phys_out + 1)] + [f'B{i}' for i in range(1, kind.virt_out + 1)]
psg.theme_add_new(
'HighContrast',
{
'BACKGROUND': '#FFFFFF',
'TEXT': '#000000',
'INPUT': '#FAF9F6',
'TEXT_INPUT': '#000000',
'SCROLL': '#FAF9F6',
'BUTTON': ('#000000', '#FFFFFF'),
'PROGRESS': ('#000000', '#FFFFFF'),
'BORDER': 2,
'SLIDER_DEPTH': 3,
'PROGRESS_DEPTH': 0,
},
)
def get_themes_list() -> list:
return [
'Bright Colors',
'Dark Blue 14',
'Dark Brown 2',
'Dark Brown 3',
'Dark Green 2',
'Dark Grey 2',
'Dark Teal1',
'Dark Teal6',
'Kayak',
'Light Blue 2',
'Light Brown 2',
'Light Brown 5',
'Light Green',
'Light Green 3',
'Light Grey 2',
'Light Purple',
'Neutral Blue',
'Reds',
'Sandy Beach',
'High Contrast',
]

File diff suppressed because it is too large Load Diff