mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2026-04-07 18:03:35 +00:00
Compare commits
141 Commits
ml-1
...
add-braill
| Author | SHA1 | Date | |
|---|---|---|---|
| 10425f50d5 | |||
| 7f327b4cce | |||
| 2e3ba66b5a | |||
| 5fca7da033 | |||
| 92f357f003 | |||
| d54995dbf1 | |||
| bc0b25032a | |||
| 2a86c05bea | |||
| aae62fa136 | |||
| 5b4a76c484 | |||
| dfb96777bb | |||
| 5aa2af2acf | |||
| cc6e187998 | |||
| 1ea1c59f06 | |||
| 054ad040bb | |||
| 94f0b847a7 | |||
| 8d251d1dea | |||
| 5f7d66ceae | |||
| 4ed17a5476 | |||
| b88955a45a | |||
| c3247fa5bf | |||
| 39c14279b2 | |||
| d850581179 | |||
| 47d38e4468 | |||
| 415f2e2ba3 | |||
| 57b28b3507 | |||
| cc0a1de07b | |||
| 9ee0dac610 | |||
| c7b8622aac | |||
| 2706338fcb | |||
| ff98aa5f89 | |||
| 03252fe30f | |||
| 055e92ab24 | |||
| 32b3ec8a2e | |||
| fbd4962fb2 | |||
| b5ea41c604 | |||
| f48983d08a | |||
| 1c5c8893ad | |||
| e645437d1d | |||
| 9969506698 | |||
| 3a1143199a | |||
| 79f739f250 | |||
| b45b2da4aa | |||
| 0adfec2e63 | |||
| dacc972b17 | |||
| 2ed1cad666 | |||
| 64361b2011 | |||
| 36003fe73f | |||
| cb82033e1c | |||
| bde9020471 | |||
| 364b0deeb4 | |||
| a80e4e2d83 | |||
| 6e146bac50 | |||
| c385476cc4 | |||
| 1c09556c61 | |||
| 421688eff8 | |||
| bdd570738a | |||
| 71b137a9c2 | |||
| 912eb8c14d | |||
| 9cd65737e5 | |||
| 4a6ca2a353 | |||
| cc99b14e89 | |||
| 23458debaa | |||
| 496cc35321 | |||
| d758db9dee | |||
| 876de55ad2 | |||
| eab4b1c6a9 | |||
| 0aeb33608f | |||
| 5befe72ca1 | |||
| abab560281 | |||
| 6882adb47b | |||
| af602e087d | |||
| 01e80dc4f6 | |||
| 7262af4bcf | |||
| ef10b224d7 | |||
| 89d0253591 | |||
| 85527e0749 | |||
| 9d8ea5f747 | |||
| 0dd6c89f96 | |||
| 893f9f59ff | |||
| 3ca9e14e96 | |||
| 4ca64f94bc | |||
| 22bf109499 | |||
| a19aab3936 | |||
| 7134b6d209 | |||
| 1525710d31 | |||
| 2745e2c41a | |||
| 8716149eda | |||
| dde940938f | |||
| 09f052b4a3 | |||
| 577f1fbdbb | |||
| f9614f44ac | |||
| 9b757b743b | |||
| 7f8f6f2b6c | |||
| 0c806b8e4c | |||
| 645361c731 | |||
| 6baa0000c8 | |||
| d722154325 | |||
| c94d763569 | |||
| ac14b7ad0d | |||
| 78b7e01fa6 | |||
| 42fad86905 | |||
| 6c54d28210 | |||
| d958167ded | |||
| 0570138963 | |||
| 1fdb39a041 | |||
| 3d7b33c8be | |||
| cf5c8f81aa | |||
| c248808c7b | |||
| d93f078365 | |||
| e0f36b2411 | |||
| 719328c6de | |||
| 65a148aa7b | |||
| ba1fb28187 | |||
| e35bad9e1e | |||
| 804af85e65 | |||
| 96de917b64 | |||
| bc14116cd7 | |||
| 086fbc1b8c | |||
| 047577265c | |||
| 7ab7c30e80 | |||
| bfdc0306e3 | |||
| 245476adfd | |||
| 2562c02b7e | |||
| aaa2c72668 | |||
| 7648b68b85 | |||
| 14c6b937d1 | |||
| 5069db97da | |||
| 681bf8e85c | |||
| 8424558f3d | |||
| 39bd5f21ea | |||
| 77dfd00541 | |||
| 790ac10d4a | |||
| ed5f9ae45b | |||
| 962b61f60a | |||
| b2e03aace1 | |||
| 3a52655811 | |||
| 178d6e451b | |||
| fc8ae11555 | |||
| e4afe35fb2 | |||
| e2edd29b87 |
237
.github/workflows/release.yml
vendored
Normal file
237
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,237 @@
|
|||||||
|
name: Build and Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
|
||||||
|
- name: Install PDM
|
||||||
|
uses: pdm-project/setup-pdm@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.12'
|
||||||
|
|
||||||
|
- name: Install Task
|
||||||
|
uses: go-task/setup-task@v1
|
||||||
|
with:
|
||||||
|
version: 3.x
|
||||||
|
|
||||||
|
- name: Download NVDA Controller Client
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Write-Host "Downloading NVDA Controller Client..."
|
||||||
|
$url = "https://download.nvaccess.org/releases/stable/nvda_2025.3.3_controllerClient.zip"
|
||||||
|
$zipPath = "nvda_controllerClient.zip"
|
||||||
|
|
||||||
|
# Download the zip file
|
||||||
|
Invoke-WebRequest -Uri $url -OutFile $zipPath
|
||||||
|
Write-Host "Downloaded $zipPath"
|
||||||
|
|
||||||
|
# Extract to temp directory
|
||||||
|
$tempDir = "temp_controller"
|
||||||
|
Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force
|
||||||
|
|
||||||
|
# Find and copy DLL files to correct locations
|
||||||
|
Write-Host "Extracting DLL files..."
|
||||||
|
|
||||||
|
# Create directories if they don't exist
|
||||||
|
New-Item -ItemType Directory -Path "controllerClient/x64" -Force | Out-Null
|
||||||
|
New-Item -ItemType Directory -Path "controllerClient/x86" -Force | Out-Null
|
||||||
|
|
||||||
|
# Find and copy the DLL files
|
||||||
|
$dllFiles = Get-ChildItem -Path $tempDir -Recurse -Name "*.dll" | Where-Object { $_ -like "*controllerClient*" }
|
||||||
|
|
||||||
|
foreach ($dll in $dllFiles) {
|
||||||
|
$fullPath = Join-Path $tempDir $dll
|
||||||
|
$dirName = (Get-Item $fullPath).Directory.Name
|
||||||
|
|
||||||
|
if ($dll -match "x64" -or $dirName -match "x64") {
|
||||||
|
Copy-Item $fullPath "controllerClient/x64/nvdaControllerClient.dll"
|
||||||
|
Write-Host "Copied x64 DLL: $dll"
|
||||||
|
} elseif ($dll -match "x86" -or $dirName -match "x86") {
|
||||||
|
Copy-Item $fullPath "controllerClient/x86/nvdaControllerClient.dll"
|
||||||
|
Write-Host "Copied x86 DLL: $dll"
|
||||||
|
} elseif ($dll -match "arm64" -or $dirName -match "arm64") {
|
||||||
|
Write-Host "Skipping ARM64 DLL: $dll (not needed)"
|
||||||
|
} else {
|
||||||
|
Write-Host "Skipping unknown architecture DLL: $dll"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
Remove-Item $zipPath -Force
|
||||||
|
Remove-Item $tempDir -Recurse -Force
|
||||||
|
|
||||||
|
# Verify files were copied
|
||||||
|
Write-Host "Verifying controller client files..."
|
||||||
|
if (Test-Path "controllerClient/x64/nvdaControllerClient.dll") {
|
||||||
|
Write-Host "[OK] x64 controller client found"
|
||||||
|
} else {
|
||||||
|
Write-Host "[ERROR] x64 controller client missing"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Test-Path "controllerClient/x86/nvdaControllerClient.dll") {
|
||||||
|
Write-Host "[OK] x86 controller client found"
|
||||||
|
} else {
|
||||||
|
Write-Host "[ERROR] x86 controller client missing"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Fix dependencies for CI
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
echo "Fixing local dependencies for CI build..."
|
||||||
|
|
||||||
|
# Remove local path dependency for voicemeeter-api
|
||||||
|
pdm remove -dG dev voicemeeter-api || true
|
||||||
|
|
||||||
|
echo "Updated dependencies for CI build"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
# Install project dependencies
|
||||||
|
pdm install
|
||||||
|
|
||||||
|
# Verify PyInstaller is available
|
||||||
|
Write-Host "Verifying PyInstaller installation..."
|
||||||
|
pdm list | Select-String pyinstaller
|
||||||
|
|
||||||
|
- name: Get PDM executable path
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$pdmPath = Get-Command pdm | Select-Object -ExpandProperty Source
|
||||||
|
Write-Host "PDM path: $pdmPath"
|
||||||
|
echo "PDM_BIN=$pdmPath" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build artifacts with dynamic taskfile
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
PDM_BIN: ${{ env.PDM_BIN }}
|
||||||
|
run: |
|
||||||
|
Write-Host "Building all executables using dynamic builder..."
|
||||||
|
task --taskfile Taskfile.dynamic.yml build-all
|
||||||
|
|
||||||
|
- name: Compress build artifacts
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
PDM_BIN: ${{ env.PDM_BIN }}
|
||||||
|
run: |
|
||||||
|
Write-Host "Compressing build artifacts..."
|
||||||
|
task --taskfile Taskfile.dynamic.yml compress-all
|
||||||
|
|
||||||
|
- name: Verify build outputs
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Write-Host "Verifying build outputs..."
|
||||||
|
|
||||||
|
$expectedFiles = @(
|
||||||
|
"dist/basic.zip",
|
||||||
|
"dist/banana.zip",
|
||||||
|
"dist/potato.zip"
|
||||||
|
)
|
||||||
|
|
||||||
|
$missingFiles = @()
|
||||||
|
$foundFiles = @()
|
||||||
|
|
||||||
|
foreach ($file in $expectedFiles) {
|
||||||
|
if (Test-Path $file) {
|
||||||
|
$size = [math]::Round((Get-Item $file).Length / 1MB, 2)
|
||||||
|
$foundFiles += "$file ($size MB)"
|
||||||
|
} else {
|
||||||
|
$missingFiles += $file
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Found files:"
|
||||||
|
$foundFiles | ForEach-Object { Write-Host " $_" }
|
||||||
|
|
||||||
|
if ($missingFiles.Count -gt 0) {
|
||||||
|
Write-Host -ForegroundColor Red "Missing files:"
|
||||||
|
$missingFiles | ForEach-Object { Write-Host " $_" }
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host -ForegroundColor Green "All expected files found!"
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nvda-voicemeeter-builds
|
||||||
|
path: |
|
||||||
|
dist/basic.zip
|
||||||
|
dist/banana.zip
|
||||||
|
dist/potato.zip
|
||||||
|
|
||||||
|
- name: Build Summary
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Write-Host -ForegroundColor Green "Build completed successfully!"
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "Built artifacts:"
|
||||||
|
Write-Host " - nvda-voicemeeter-basic.zip"
|
||||||
|
Write-Host " - nvda-voicemeeter-banana.zip"
|
||||||
|
Write-Host " - nvda-voicemeeter-potato.zip"
|
||||||
|
|
||||||
|
release:
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download all artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
run: |
|
||||||
|
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||||
|
gh release create $TAG_NAME \
|
||||||
|
--title "NVDA-Voicemeeter $TAG_NAME" \
|
||||||
|
--notes "## NVDA-Voicemeeter Release $TAG_NAME
|
||||||
|
|
||||||
|
### Downloads
|
||||||
|
- **nvda-voicemeeter-basic.zip** - Basic version with dependencies
|
||||||
|
- **nvda-voicemeeter-banana.zip** - Banana version with dependencies
|
||||||
|
- **nvda-voicemeeter-potato.zip** - Potato version with dependencies
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
- Windows 10/11
|
||||||
|
- Voicemeeter (Basic/Banana/Potato) installed
|
||||||
|
- NVDA screen reader
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
1. Download the appropriate zip for your Voicemeeter version
|
||||||
|
2. Extract and run the executable - no installation required
|
||||||
|
3. The application will integrate with NVDA automatically
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
- Built with dynamic build system using PyInstaller
|
||||||
|
- Includes NVDA Controller Client for screen reader integration"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Upload release assets
|
||||||
|
run: |
|
||||||
|
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||||
|
find . -name "*.zip" -exec gh release upload $TAG_NAME {} \;
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
19
.github/workflows/ruff.yml
vendored
Normal file
19
.github/workflows/ruff.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Ruff
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ruff:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/ruff-action@v3
|
||||||
|
with:
|
||||||
|
args: 'format --check --diff'
|
||||||
78
.gitignore
vendored
78
.gitignore
vendored
@@ -1,6 +1,9 @@
|
|||||||
|
# Generated by ignr: github.com/onyx-and-iris/ignr
|
||||||
|
|
||||||
|
## Python ##
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[codz]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
|
||||||
# C extensions
|
# C extensions
|
||||||
@@ -46,7 +49,7 @@ htmlcov/
|
|||||||
nosetests.xml
|
nosetests.xml
|
||||||
coverage.xml
|
coverage.xml
|
||||||
*.cover
|
*.cover
|
||||||
*.py,cover
|
*.py.cover
|
||||||
.hypothesis/
|
.hypothesis/
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
cover/
|
cover/
|
||||||
@@ -94,23 +97,36 @@ ipython_config.py
|
|||||||
# install all needed dependencies.
|
# install all needed dependencies.
|
||||||
#Pipfile.lock
|
#Pipfile.lock
|
||||||
|
|
||||||
|
# UV
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
||||||
|
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||||
|
# commonly ignored for libraries.
|
||||||
|
#uv.lock
|
||||||
|
|
||||||
# poetry
|
# poetry
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||||
# commonly ignored for libraries.
|
# commonly ignored for libraries.
|
||||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||||
#poetry.lock
|
#poetry.lock
|
||||||
|
#poetry.toml
|
||||||
|
|
||||||
# pdm
|
# pdm
|
||||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||||
|
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
||||||
|
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
||||||
#pdm.lock
|
#pdm.lock
|
||||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
#pdm.toml
|
||||||
# in version control.
|
|
||||||
# https://pdm.fming.dev/#use-with-ide
|
|
||||||
.pdm.toml
|
|
||||||
.pdm-python
|
.pdm-python
|
||||||
.pdm-build/
|
.pdm-build/
|
||||||
|
|
||||||
|
# pixi
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
||||||
|
#pixi.lock
|
||||||
|
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
||||||
|
# in the .venv directory. It is recommended not to include this directory in version control.
|
||||||
|
.pixi
|
||||||
|
|
||||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||||
__pypackages__/
|
__pypackages__/
|
||||||
|
|
||||||
@@ -123,6 +139,7 @@ celerybeat.pid
|
|||||||
|
|
||||||
# Environments
|
# Environments
|
||||||
.env
|
.env
|
||||||
|
.envrc
|
||||||
.venv
|
.venv
|
||||||
env/
|
env/
|
||||||
venv/
|
venv/
|
||||||
@@ -161,17 +178,44 @@ cython_debug/
|
|||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
# nvda files
|
# Abstra
|
||||||
controllerClient/*
|
# Abstra is an AI-powered process automation framework.
|
||||||
!.gitkeep
|
# Ignore directories containing user credentials, local state, and settings.
|
||||||
|
# Learn more at https://abstra.io/docs
|
||||||
|
.abstra/
|
||||||
|
|
||||||
# build files
|
# Visual Studio Code
|
||||||
basic.py
|
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
||||||
banana.py
|
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
||||||
potato.py
|
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
||||||
|
# you could uncomment the following to ignore the entire vscode folder
|
||||||
|
# .vscode/
|
||||||
|
|
||||||
# persistent storage
|
# Ruff stuff:
|
||||||
settings.json
|
.ruff_cache/
|
||||||
|
|
||||||
# quick test
|
# PyPI configuration file
|
||||||
quick.py
|
.pypirc
|
||||||
|
|
||||||
|
# Cursor
|
||||||
|
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
||||||
|
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
||||||
|
# refer to https://docs.cursor.com/context/ignore-files
|
||||||
|
.cursorignore
|
||||||
|
.cursorindexingignore
|
||||||
|
|
||||||
|
# Marimo
|
||||||
|
marimo/_static/
|
||||||
|
marimo/_lsp/
|
||||||
|
__marimo__/
|
||||||
|
|
||||||
|
# End of ignr
|
||||||
|
|
||||||
|
# Controller Client
|
||||||
|
controllerClient/**/*
|
||||||
|
!controllerClient/*/
|
||||||
|
!controllerClient/**/.gitkeep
|
||||||
|
|
||||||
|
# Spec files
|
||||||
|
spec/*
|
||||||
|
!spec/.gitkeep
|
||||||
|
|||||||
12
.pre-commit-config.yaml
Normal file
12
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v2.3.0
|
||||||
|
hooks:
|
||||||
|
- id: check-yaml
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
|
|
||||||
|
- repo: https://github.com/pdm-project/pdm
|
||||||
|
rev: 2.26.6
|
||||||
|
hooks:
|
||||||
|
- id: pdm-lock-check
|
||||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.10.11
|
||||||
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"black-formatter.args": [
|
|
||||||
"--line-length=120"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
194
README.md
194
README.md
@@ -1 +1,193 @@
|
|||||||
# example-package
|
[](https://pdm-project.org)
|
||||||
|
[](https://github.com/astral-sh/ruff)
|
||||||
|
|
||||||
|
# NVDA Voicemeeter
|
||||||
|
|
||||||
|
A remote control app for [Voicemeeter][voicemeeter], designed to be used with the [NVDA screen reader][nvda].
|
||||||
|
|
||||||
|
For an outline of this projects goals see the [SPECIFICATION][spec].
|
||||||
|
|
||||||
|
<img src="./img/nvda-voicemeeter.png" width=960 alt="Image of Voicemeeter NVDA app settings tab">
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- [NVDA screen reader][nvda]
|
||||||
|
- [NVDA's Controller Client files][controller_client]
|
||||||
|
- Python 3.10 or greater
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
#### `From Source`
|
||||||
|
|
||||||
|
First clone the source files from this repository and install the dependencies.
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/onyx-and-iris/nvda-voicemeeter.git
|
||||||
|
cd nvda-voicemeeter
|
||||||
|
pip install .
|
||||||
|
```
|
||||||
|
|
||||||
|
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/`
|
||||||
|
|
||||||
|
├── nvdaControllerClient.dll
|
||||||
|
|
||||||
|
├── `x86/`
|
||||||
|
|
||||||
|
├── nvdaControllerClient.dll
|
||||||
|
|
||||||
|
#### `From Releases`
|
||||||
|
|
||||||
|
If you want to get started quickly and easily I have uploaded some compiled versions of the app in the [Releases][releases] section.
|
||||||
|
|
||||||
|
### Run
|
||||||
|
|
||||||
|
Once the repository is downloaded and the controller client files in place you can launch the GUI with the following `__main__.py`:
|
||||||
|
|
||||||
|
```python
|
||||||
|
import voicemeeterlib
|
||||||
|
|
||||||
|
import nvda_voicemeeter
|
||||||
|
|
||||||
|
KIND_ID = 'potato'
|
||||||
|
|
||||||
|
with voicemeeterlib.api(KIND_ID) as vm:
|
||||||
|
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
|
||||||
|
window.run()
|
||||||
|
```
|
||||||
|
|
||||||
|
### KIND_ID
|
||||||
|
|
||||||
|
May be one of the following:
|
||||||
|
|
||||||
|
- `basic`
|
||||||
|
- `banana`
|
||||||
|
- `potato`
|
||||||
|
|
||||||
|
### Use
|
||||||
|
|
||||||
|
#### `Tabs`
|
||||||
|
|
||||||
|
The app presents four tabs `Settings`, `Physical Strip`, `Virtual Strip` and `Buses`. Navigate between the tabs with `Control + TAB` and `Control + SHIFT + TAB` or once focused on any tab, `Left` and `Right` arrow keys.
|
||||||
|
|
||||||
|
All controls within the tabs may be navigated between using `TAB`.
|
||||||
|
|
||||||
|
#### `Settings`
|
||||||
|
|
||||||
|
The following controls offer context menus accessed by pressing `SPACE` or `ENTER`:
|
||||||
|
|
||||||
|
- Hardware In
|
||||||
|
- Hardware Out
|
||||||
|
- Patch Composite
|
||||||
|
|
||||||
|
Press `ESCAPE` to exit any context menu.
|
||||||
|
|
||||||
|
All other buttons can be triggered by pressing `SPACE` or `ENTER`.
|
||||||
|
|
||||||
|
To adjust Patch Asio Inputs to Strips and Patch Insert values use `UP` and `DOWN` arrows when in focus.
|
||||||
|
|
||||||
|
To access Advanced Settings you may press the Advanced Settings button or use `Control + A` when in the `Settings` tab.
|
||||||
|
|
||||||
|
#### `Physical Strip|Virtual Strip|Buses`
|
||||||
|
|
||||||
|
You will find in each of these tabs two nested tabs,`Buttons` and `Sliders`. For each nested tab you will find the controls appropriate for the Voicemeeter kind and channel type.
|
||||||
|
|
||||||
|
All buttons may be triggered by pressing `SPACE` or `ENTER`.
|
||||||
|
|
||||||
|
All sliders may be controlled in three different ways:
|
||||||
|
|
||||||
|
- `Left|Right arrow` to move a slider by 1 step.
|
||||||
|
- `Shift + Left|Right arrow` to move a slider by 0.1 steps.
|
||||||
|
- `Control + Left|Right arrow` to move a slider by 3 steps.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
#### `Advanced Compressor|Gate`
|
||||||
|
|
||||||
|
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)
|
||||||
|
- Set a config to load automatically on app startup.
|
||||||
|
|
||||||
|
The `Save Settings` option opens a popup window with two buttons, `Browse` and `Cancel`. Browse opens a Save As dialog, Cancel returns to the main app window.
|
||||||
|
|
||||||
|
`Load Settings` and `Load on Startup` both open an Open dialog box immediately.
|
||||||
|
|
||||||
|
#### `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.
|
||||||
|
|
||||||
|
When focused on any one of "Physical Strip", "Virtual Strip" or "Buses" you may use `Control + Number` to skip to the corresponding channel.
|
||||||
|
|
||||||
|
When focused on any single channel (Strip or Bus), the following binds exist:
|
||||||
|
|
||||||
|
- `Alt + Number` will trigger the Bus output button corresponding to the number. For example `Alt + 3` will trigger the `A3` button
|
||||||
|
- `Control + O` will trigger the Mono button
|
||||||
|
- `Control + S` will trigger the Solo button
|
||||||
|
- `Control + M` will trigger the Mute button
|
||||||
|
|
||||||
|
You may also enter slider modes which allow for control of the channels sliders until the slider mode is exited. You may access the slider modes with the following binds:
|
||||||
|
|
||||||
|
- `Control + U` will enter Audibility mode
|
||||||
|
- `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`.
|
||||||
|
|
||||||
|
Once you are in a slider mode you may now control the slider that matches the slider mode. Slider mode binds are the same as the normal slider binds with the addition of the Alt keypress. For example, where you would normally use `Right Arrow` to shift a slider rightwards by 1 step, in slider mode you would now use `Alt + Right Arrow`.
|
||||||
|
|
||||||
|
### Issues
|
||||||
|
|
||||||
|
If you have any questions/suggestions feel free to raise an issue or open a new discussion.
|
||||||
|
|
||||||
|
### Special Thanks
|
||||||
|
|
||||||
|
[Mario Loreti](https://www.marioloreti.net/en/) for his help in testing and offering feedback during development.
|
||||||
|
|
||||||
|
[NVAccess](https://www.nvaccess.org/) for creating the open source NVDA screen reader and its controller client.
|
||||||
|
|
||||||
|
[Vincent Burel](https://github.com/vburel2018) for creating Voicemeeter and its SDK.
|
||||||
|
|
||||||
|
[FreeSimpleGUI](https://github.com/spyoungtech/FreeSimpleGUI) a fork of the now closed source PySimpleGUI project.
|
||||||
|
|
||||||
|
[spec]: ./SPECIFICATION.md
|
||||||
|
[voicemeeter]: https://voicemeeter.com/
|
||||||
|
[nvda]: https://www.nvaccess.org/
|
||||||
|
[controller_client]: https://github.com/nvaccess/nvda/tree/master/extras/controllerClient
|
||||||
|
[releases]: https://github.com/onyx-and-iris/nvda-voicemeeter/releases
|
||||||
|
|||||||
30
SPECIFICATION.md
Normal file
30
SPECIFICATION.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Software Specification
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
A remote control utility for Voicemeeter designed to be used with the NVDA screen reader.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
#### Functional Goals
|
||||||
|
|
||||||
|
- Parameter updates caused by user input should be read back to the user via the screen reader.
|
||||||
|
- When focusing a control the current value for that control should be read back to the user.
|
||||||
|
- The application should scale correctly according to each kind of Voicemeeter (basic, banana, potato). This means the following:
|
||||||
|
- Correct number of strips/buses.
|
||||||
|
- Correct number of bus assignments for each strip.
|
||||||
|
- Where certain controls are valid for one kind they may not be for another.
|
||||||
|
- Where possible set limits on data entry and keep controls appropriate for the type of parameter.
|
||||||
|
|
||||||
|
#### Accessibility Goals
|
||||||
|
|
||||||
|
- Every control must be usable with a keyboard.
|
||||||
|
- Navigation around the application must be doable with a keyboard.
|
||||||
|
- Should use standard Windows controls only.
|
||||||
|
|
||||||
|
## Limitations
|
||||||
|
|
||||||
|
- May not cover 100% of the Voicemeeter GUI, for example the many EQ parameters.
|
||||||
|
- Only designed to work with the NVDA screen reader. Other screen readers not supported.
|
||||||
|
- Only the main Voicemeeter GUI supported by this application. No support for Matrix or other Voicemeeter products.
|
||||||
|
- Runs on Python version 3.10 or greater.
|
||||||
76
Taskfile.dynamic.yml
Normal file
76
Taskfile.dynamic.yml
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
# Dynamic build system - no spec files needed!
|
||||||
|
# Examples:
|
||||||
|
# - task -t Taskfile.dynamic.yml build KINDS="basic banana"
|
||||||
|
# - task -t Taskfile.dynamic.yml build-all
|
||||||
|
# KINDS can be a space-separated list of kinds to build, or "all" to build everything.
|
||||||
|
#
|
||||||
|
# Compression tasks are also dynamic, allowing you to specify which kind to compress or compress all kinds at once.
|
||||||
|
# Examples:
|
||||||
|
# - task -t Taskfile.dynamic.yml compress KIND=basic
|
||||||
|
# - task -t Taskfile.dynamic.yml compress-all
|
||||||
|
|
||||||
|
vars:
|
||||||
|
KINDS: '{{.KINDS | default "all"}}'
|
||||||
|
SHELL: pwsh
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
build:
|
||||||
|
desc: Build specified kinds dynamically (no spec files needed)
|
||||||
|
preconditions:
|
||||||
|
- sh: |
|
||||||
|
if [ ! -f controllerClient/x64/nvdaControllerClient.dll ] || [ ! -f controllerClient/x86/nvdaControllerClient.dll ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
msg: 'nvdaControllerClient.dll is missing. See https://github.com/nvaccess/nvda/blob/master/extras/controllerClient/readme.md for instructions on how to obtain it.'
|
||||||
|
cmds:
|
||||||
|
- ${PDM_BIN:-pdm} run python tools/dynamic_builder.py {{.KINDS}}
|
||||||
|
|
||||||
|
build-all:
|
||||||
|
desc: Build all kinds
|
||||||
|
preconditions:
|
||||||
|
- sh: |
|
||||||
|
if [ ! -f controllerClient/x64/nvdaControllerClient.dll ] || [ ! -f controllerClient/x86/nvdaControllerClient.dll ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
msg: 'nvdaControllerClient.dll is missing. See https://github.com/nvaccess/nvda/blob/master/extras/controllerClient/readme.md for instructions on how to obtain it.'
|
||||||
|
cmds:
|
||||||
|
- ${PDM_BIN:-pdm} run python tools/dynamic_builder.py all
|
||||||
|
|
||||||
|
compress:
|
||||||
|
desc: Compress artifacts for specified kind
|
||||||
|
cmds:
|
||||||
|
- task: compress-{{.KIND}}
|
||||||
|
|
||||||
|
compress-all:
|
||||||
|
desc: Compress artifacts for all kinds
|
||||||
|
cmds:
|
||||||
|
- for:
|
||||||
|
matrix:
|
||||||
|
KIND: [basic, banana, potato]
|
||||||
|
task: compress-{{.ITEM.KIND}}
|
||||||
|
|
||||||
|
compress-basic:
|
||||||
|
desc: Compress basic build artifacts
|
||||||
|
cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/basic -DestinationPath dist/basic.zip -Force"'
|
||||||
|
generates:
|
||||||
|
- dist/basic.zip
|
||||||
|
|
||||||
|
compress-banana:
|
||||||
|
desc: Compress banana build artifacts
|
||||||
|
cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/banana -DestinationPath dist/banana.zip -Force"'
|
||||||
|
generates:
|
||||||
|
- dist/banana.zip
|
||||||
|
|
||||||
|
compress-potato:
|
||||||
|
desc: Compress potato build artifacts
|
||||||
|
cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/potato -DestinationPath dist/potato.zip -Force"'
|
||||||
|
generates:
|
||||||
|
- dist/potato.zip
|
||||||
|
|
||||||
|
clean:
|
||||||
|
desc: Clean all build artifacts
|
||||||
|
cmds:
|
||||||
|
- |
|
||||||
|
{{.SHELL}} -Command "Remove-Item -Path build/*,dist/* -Recurse -Force -ErrorAction SilentlyContinue"
|
||||||
49
Taskfile.yml
Normal file
49
Taskfile.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
generate-specs:
|
||||||
|
desc: Generate all spec files from templates
|
||||||
|
cmd: pdm run python tools/spec_generator.py
|
||||||
|
|
||||||
|
build:
|
||||||
|
desc: Build the project
|
||||||
|
deps: [generate-specs]
|
||||||
|
preconditions:
|
||||||
|
- sh: |
|
||||||
|
if [ ! -f controllerClient/x64/nvdaControllerClient.dll ] || [ ! -f controllerClient/x86/nvdaControllerClient.dll ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
msg: 'nvdaControllerClient.dll is missing. See https://github.com/nvaccess/nvda/blob/master/extras/controllerClient/readme.md for instructions on how to obtain it.'
|
||||||
|
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 -Path build/*,dist/* -Recurse -Force -ErrorAction SilentlyContinue"
|
||||||
@@ -2,8 +2,8 @@ import voicemeeterlib
|
|||||||
|
|
||||||
import nvda_voicemeeter
|
import nvda_voicemeeter
|
||||||
|
|
||||||
KIND_ID = "potato"
|
KIND_ID = 'potato'
|
||||||
|
|
||||||
with voicemeeterlib.api(KIND_ID, sync=True) as vm:
|
with voicemeeterlib.api(KIND_ID) as vm:
|
||||||
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
|
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
|
||||||
window.run()
|
window.run()
|
||||||
|
|||||||
20
build.ps1
20
build.ps1
@@ -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 }
|
|
||||||
0
controllerClient/x86/.gitkeep
Normal file
0
controllerClient/x86/.gitkeep
Normal file
BIN
img/buses.png
Normal file
BIN
img/buses.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
img/busmode_buttonmenu.png
Normal file
BIN
img/busmode_buttonmenu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
BIN
img/nvda-voicemeeter.png
Normal file
BIN
img/nvda-voicemeeter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 234 KiB |
BIN
img/physical_strip.png
Normal file
BIN
img/physical_strip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
img/settings.png
Normal file
BIN
img/settings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
img/virtual_strip.png
Normal file
BIN
img/virtual_strip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
333
pdm.lock
generated
333
pdm.lock
generated
@@ -2,282 +2,217 @@
|
|||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
groups = ["default", "build", "lint", "test"]
|
groups = ["default", "build", "dev", "format"]
|
||||||
cross_platform = true
|
strategy = ["inherit_metadata"]
|
||||||
static_urls = false
|
lock_version = "4.5.0"
|
||||||
lock_version = "4.3"
|
content_hash = "sha256:7f8d5a672b82b4ff9d793a255dcdf55415b79773d7cf7e2742f4531366daac58"
|
||||||
content_hash = "sha256:2aaf88f0abb701968bc22eb31fd189810850a505bb93553f67216e4d1d259750"
|
|
||||||
|
[[metadata.targets]]
|
||||||
|
requires_python = ">=3.10,<3.13"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "altgraph"
|
name = "altgraph"
|
||||||
version = "0.17.3"
|
version = "0.17.5"
|
||||||
summary = "Python graph (network) package"
|
summary = "Python graph (network) package"
|
||||||
|
groups = ["build"]
|
||||||
files = [
|
files = [
|
||||||
{file = "altgraph-0.17.3-py2.py3-none-any.whl", hash = "sha256:c8ac1ca6772207179ed8003ce7687757c04b0b71536f81e2ac5755c6226458fe"},
|
{file = "altgraph-0.17.5-py2.py3-none-any.whl", hash = "sha256:f3a22400bce1b0c701683820ac4f3b159cd301acab067c51c653e06961600597"},
|
||||||
{file = "altgraph-0.17.3.tar.gz", hash = "sha256:ad33358114df7c9416cdb8fa1eaa5852166c505118717021c6a8c7c7abbd03dd"},
|
{file = "altgraph-0.17.5.tar.gz", hash = "sha256:c87b395dd12fabde9c99573a9749d67da8d29ef9de0125c7f536699b4a9bc9e7"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "black"
|
name = "freesimplegui"
|
||||||
version = "23.7.0"
|
version = "5.2.0.post1"
|
||||||
requires_python = ">=3.8"
|
summary = "The free-forever Python GUI framework."
|
||||||
summary = "The uncompromising code formatter."
|
groups = ["default"]
|
||||||
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\"",
|
|
||||||
]
|
|
||||||
files = [
|
files = [
|
||||||
{file = "black-23.7.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:5c4bc552ab52f6c1c506ccae05681fab58c3f72d59ae6e6639e8885e94fe2587"},
|
{file = "freesimplegui-5.2.0.post1-py3-none-any.whl", hash = "sha256:3d61eb519324503232f86b2f1bd7f5c6813ce225f6e189d0fd737ddb036af4d5"},
|
||||||
{file = "black-23.7.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:552513d5cd5694590d7ef6f46e1767a4df9af168d449ff767b13b084c020e63f"},
|
{file = "freesimplegui-5.2.0.post1.tar.gz", hash = "sha256:e58a0e6758e9a9e87152256911f94fcc3998356d1309973a9f4d9df2dc55f98a"},
|
||||||
{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"},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "macholib"
|
name = "macholib"
|
||||||
version = "1.16.2"
|
version = "1.16.4"
|
||||||
summary = "Mach-O header analysis and editing"
|
summary = "Mach-O header analysis and editing"
|
||||||
|
groups = ["build"]
|
||||||
|
marker = "sys_platform == \"darwin\""
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"altgraph>=0.17",
|
"altgraph>=0.17",
|
||||||
]
|
]
|
||||||
files = [
|
files = [
|
||||||
{file = "macholib-1.16.2-py2.py3-none-any.whl", hash = "sha256:44c40f2cd7d6726af8fa6fe22549178d3a4dfecc35a9cd15ea916d9c83a688e0"},
|
{file = "macholib-1.16.4-py2.py3-none-any.whl", hash = "sha256:da1a3fa8266e30f0ce7e97c6a54eefaae8edd1e5f86f3eb8b95457cae90265ea"},
|
||||||
{file = "macholib-1.16.2.tar.gz", hash = "sha256:557bbfa1bb255c20e9abafe7ed6cd8046b48d9525db2f9b77d3122a63a2a8bf8"},
|
{file = "macholib-1.16.4.tar.gz", hash = "sha256:f408c93ab2e995cd2c46e34fe328b130404be143469e41bc366c807448979362"},
|
||||||
]
|
|
||||||
|
|
||||||
[[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"},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "packaging"
|
name = "packaging"
|
||||||
version = "23.1"
|
version = "26.0"
|
||||||
requires_python = ">=3.7"
|
requires_python = ">=3.8"
|
||||||
summary = "Core utilities for Python packages"
|
summary = "Core utilities for Python packages"
|
||||||
|
groups = ["build"]
|
||||||
files = [
|
files = [
|
||||||
{file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"},
|
{file = "packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529"},
|
||||||
{file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"},
|
{file = "packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4"},
|
||||||
]
|
|
||||||
|
|
||||||
[[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"},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pefile"
|
name = "pefile"
|
||||||
version = "2023.2.7"
|
version = "2024.8.26"
|
||||||
requires_python = ">=3.6.0"
|
requires_python = ">=3.6.0"
|
||||||
summary = "Python PE parsing module"
|
summary = "Python PE parsing module"
|
||||||
|
groups = ["build"]
|
||||||
|
marker = "sys_platform == \"win32\""
|
||||||
files = [
|
files = [
|
||||||
{file = "pefile-2023.2.7-py3-none-any.whl", hash = "sha256:da185cd2af68c08a6cd4481f7325ed600a88f6a813bad9dea07ab3ef73d8d8d6"},
|
{file = "pefile-2024.8.26-py3-none-any.whl", hash = "sha256:76f8b485dcd3b1bb8166f1128d395fa3d87af26360c2358fb75b80019b957c6f"},
|
||||||
{file = "pefile-2023.2.7.tar.gz", hash = "sha256:82e6114004b3d6911c77c3953e3838654b04511b8b66e8583db70c65998017dc"},
|
{file = "pefile-2024.8.26.tar.gz", hash = "sha256:3ff6c5d8b43e8c37bb6e6dd5085658d658a7a0bdcd20b6a07b1fcfc1c4e9d632"},
|
||||||
]
|
|
||||||
|
|
||||||
[[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]]
|
[[package]]
|
||||||
name = "pyinstaller"
|
name = "pyinstaller"
|
||||||
version = "5.13.0"
|
version = "6.19.0"
|
||||||
requires_python = "<3.13,>=3.7"
|
requires_python = "<3.15,>=3.8"
|
||||||
summary = "PyInstaller bundles a Python application and all its dependencies into a single package."
|
summary = "PyInstaller bundles a Python application and all its dependencies into a single package."
|
||||||
|
groups = ["build"]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"altgraph",
|
"altgraph",
|
||||||
|
"importlib-metadata>=4.6; python_version < \"3.10\"",
|
||||||
"macholib>=1.8; sys_platform == \"darwin\"",
|
"macholib>=1.8; sys_platform == \"darwin\"",
|
||||||
|
"packaging>=22.0",
|
||||||
"pefile>=2022.5.30; sys_platform == \"win32\"",
|
"pefile>=2022.5.30; sys_platform == \"win32\"",
|
||||||
"pyinstaller-hooks-contrib>=2021.4",
|
"pyinstaller-hooks-contrib>=2026.0",
|
||||||
"pywin32-ctypes>=0.2.1; sys_platform == \"win32\"",
|
"pywin32-ctypes>=0.2.1; sys_platform == \"win32\"",
|
||||||
"setuptools>=42.0.0",
|
"setuptools>=42.0.0",
|
||||||
]
|
]
|
||||||
files = [
|
files = [
|
||||||
{file = "pyinstaller-5.13.0-py3-none-macosx_10_13_universal2.whl", hash = "sha256:7fdd319828de679f9c5e381eff998ee9b4164bf4457e7fca56946701cf002c3f"},
|
{file = "pyinstaller-6.19.0-py3-none-macosx_10_13_universal2.whl", hash = "sha256:4190e76b74f0c4b5c5f11ac360928cd2e36ec8e3194d437bf6b8648c7bc0c134"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:0df43697c4914285ecd333be968d2cd042ab9b2670124879ee87931d2344eaf5"},
|
{file = "pyinstaller-6.19.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:8bd68abd812d8a6ba33b9f1810e91fee0f325969733721b78151f0065319ca11"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_i686.whl", hash = "sha256:28d9742c37e9fb518444b12f8c8ab3cb4ba212d752693c34475c08009aa21ccf"},
|
{file = "pyinstaller-6.19.0-py3-none-manylinux2014_i686.whl", hash = "sha256:1ec54ef967996ca61dacba676227e2b23219878ccce5ee9d6f3aada7b8ed8abf"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:e5fb17de6c325d3b2b4ceaeb55130ad7100a79096490e4c5b890224406fa42f4"},
|
{file = "pyinstaller-6.19.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:4ab2bb52e58448e14ddf9450601bdedd66800465043501c1d8f1cab87b60b122"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:78975043edeb628e23a73fb3ef0a273cda50e765f1716f75212ea3e91b09dede"},
|
{file = "pyinstaller-6.19.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:da6d5c6391ccefe73554b9fa29b86001c8e378e0f20c2a4004f836ba537eff63"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:cd7d5c06f2847195a23d72ede17c60857d6f495d6f0727dc6c9bc1235f2eb79c"},
|
{file = "pyinstaller-6.19.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:a0fc5f6b3c55aa54353f0c74ffa59b1115433c1850c6f655d62b461a2ed6cbbe"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:24009eba63cfdbcde6d2634e9c87f545eb67249ddf3b514e0cd3b2cdaa595828"},
|
{file = "pyinstaller-6.19.0-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:e649ba6bd1b0b89b210ad92adb5fbdc8a42dd2c5ca4f72ef3a0bfec83a424b83"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:1fde4381155f21d6354dc450dcaa338cd8a40aaacf6bd22b987b0f3e1f96f3ee"},
|
{file = "pyinstaller-6.19.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:481a909c8e60c8692fc60fcb1344d984b44b943f8bc9682f2fcdae305ad297e6"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-win32.whl", hash = "sha256:2d03419904d1c25c8968b0ad21da0e0f33d8d65716e29481b5bd83f7f342b0c5"},
|
{file = "pyinstaller-6.19.0-py3-none-win32.whl", hash = "sha256:3c5c251054fe4cfaa04c34a363dcfbf811545438cb7198304cd444756bc2edd2"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-win_amd64.whl", hash = "sha256:9fc27c5a853b14a90d39c252707673c7a0efec921cd817169aff3af0fca8c127"},
|
{file = "pyinstaller-6.19.0-py3-none-win_amd64.whl", hash = "sha256:b5bb6536c6560330d364d91522250f254b107cf69129d9cbcd0e6727c570be33"},
|
||||||
{file = "pyinstaller-5.13.0-py3-none-win_arm64.whl", hash = "sha256:3a331951f9744bc2379ea5d65d36f3c828eaefe2785f15039592cdc08560b262"},
|
{file = "pyinstaller-6.19.0-py3-none-win_arm64.whl", hash = "sha256:c2d5a539b0bfe6159d5522c8c70e1c0e487f22c2badae0f97d45246223b798ea"},
|
||||||
{file = "pyinstaller-5.13.0.tar.gz", hash = "sha256:5e446df41255e815017d96318e39f65a3eb807e74a796c7e7ff7f13b6366a2e9"},
|
{file = "pyinstaller-6.19.0.tar.gz", hash = "sha256:ec73aeb8bd9b7f2f1240d328a4542e90b3c6e6fbc106014778431c616592a865"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyinstaller-hooks-contrib"
|
name = "pyinstaller-hooks-contrib"
|
||||||
version = "2023.7"
|
version = "2026.3"
|
||||||
requires_python = ">=3.7"
|
requires_python = ">=3.8"
|
||||||
summary = "Community maintained hooks for PyInstaller"
|
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 = [
|
files = [
|
||||||
{file = "pyinstaller-hooks-contrib-2023.7.tar.gz", hash = "sha256:0c436a4c3506020e34116a8a7ddfd854c1ad6ddca9a8cd84500bd6e69c9e68f9"},
|
{file = "pyinstaller_hooks_contrib-2026.3-py3-none-any.whl", hash = "sha256:5ecd1068ad262afecadf07556279d2be52ca93a88b049fae17f1a2eb2969254a"},
|
||||||
{file = "pyinstaller_hooks_contrib-2023.7-py2.py3-none-any.whl", hash = "sha256:3c10df14c0f71ab388dfbf1625375b087e7330d9444cbfd2b310ba027fa0cff0"},
|
{file = "pyinstaller_hooks_contrib-2026.3.tar.gz", hash = "sha256:800d3a198a49a6cd0de2d7fb795005fdca7a0222ed9cb47c0691abd1c27b9310"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyparsing"
|
name = "pyparsing"
|
||||||
version = "3.1.1"
|
version = "3.3.2"
|
||||||
requires_python = ">=3.6.8"
|
requires_python = ">=3.9"
|
||||||
summary = "pyparsing module - Classes and methods to define and execute parsing grammars"
|
summary = "pyparsing - Classes and methods to define and execute parsing grammars"
|
||||||
|
groups = ["default"]
|
||||||
files = [
|
files = [
|
||||||
{file = "pyparsing-3.1.1-py3-none-any.whl", hash = "sha256:32c7c0b711493c72ff18a981d24f28aaf9c1fb7ed5e9667c9e84e3db623bdbfb"},
|
{file = "pyparsing-3.3.2-py3-none-any.whl", hash = "sha256:850ba148bd908d7e2411587e247a1e4f0327839c40e2e5e6d05a007ecc69911d"},
|
||||||
{file = "pyparsing-3.1.1.tar.gz", hash = "sha256:ede28a1a32462f5a9705e07aea48001a08f7cf81a021585011deba701581a0db"},
|
{file = "pyparsing-3.3.2.tar.gz", hash = "sha256:c777f4d763f140633dcb6d8a3eda953bf7a214dc4eff598413c070bcdc117cbc"},
|
||||||
]
|
|
||||||
|
|
||||||
[[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"},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pywin32-ctypes"
|
name = "pywin32-ctypes"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
requires_python = ">=3.6"
|
requires_python = ">=3.6"
|
||||||
summary = "A (partial) reimplementation of pywin32 using ctypes/cffi"
|
summary = "A (partial) reimplementation of pywin32 using ctypes/cffi"
|
||||||
|
groups = ["build"]
|
||||||
|
marker = "sys_platform == \"win32\""
|
||||||
files = [
|
files = [
|
||||||
{file = "pywin32-ctypes-0.2.2.tar.gz", hash = "sha256:3426e063bdd5fd4df74a14fa3cf80a0b42845a87e1d1e81f6549f9daec593a60"},
|
{file = "pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755"},
|
||||||
{file = "pywin32_ctypes-0.2.2-py3-none-any.whl", hash = "sha256:bf490a1a709baf35d688fe0ecf980ed4de11d2b3e37b51e5442587a75d9957e7"},
|
{file = "pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8"},
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ruff"
|
||||||
|
version = "0.15.5"
|
||||||
|
requires_python = ">=3.7"
|
||||||
|
summary = "An extremely fast Python linter and code formatter, written in Rust."
|
||||||
|
groups = ["format"]
|
||||||
|
files = [
|
||||||
|
{file = "ruff-0.15.5-py3-none-linux_armv6l.whl", hash = "sha256:4ae44c42281f42e3b06b988e442d344a5b9b72450ff3c892e30d11b29a96a57c"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6edd3792d408ebcf61adabc01822da687579a1a023f297618ac27a5b51ef0080"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:89f463f7c8205a9f8dea9d658d59eff49db05f88f89cc3047fb1a02d9f344010"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba786a8295c6574c1116704cf0b9e6563de3432ac888d8f83685654fe528fd65"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fd4b801e57955fe9f02b31d20375ab3a5c4415f2e5105b79fb94cf2642c91440"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:391f7c73388f3d8c11b794dbbc2959a5b5afe66642c142a6effa90b45f6f5204"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8dc18f30302e379fe1e998548b0f5e9f4dff907f52f73ad6da419ea9c19d66c8"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1cc6e7f90087e2d27f98dc34ed1b3ab7c8f0d273cc5431415454e22c0bd2a681"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1cb7169f53c1ddb06e71a9aebd7e98fc0fea936b39afb36d8e86d36ecc2636a"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:9b037924500a31ee17389b5c8c4d88874cc6ea8e42f12e9c61a3d754ff72f1ca"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:65bb414e5b4eadd95a8c1e4804f6772bbe8995889f203a01f77ddf2d790929dd"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d20aa469ae3b57033519c559e9bc9cd9e782842e39be05b50e852c7c981fa01d"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:15388dd28c9161cdb8eda68993533acc870aa4e646a0a277aa166de9ad5a8752"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b30da330cbd03bed0c21420b6b953158f60c74c54c5f4c1dabbdf3a57bf355d2"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-win32.whl", hash = "sha256:732e5ee1f98ba5b3679029989a06ca39a950cced52143a0ea82a2102cb592b74"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-win_amd64.whl", hash = "sha256:821d41c5fa9e19117616c35eaa3f4b75046ec76c65e7ae20a333e9a8696bc7fe"},
|
||||||
|
{file = "ruff-0.15.5-py3-none-win_arm64.whl", hash = "sha256:b498d1c60d2fe5c10c45ec3f698901065772730b411f164ae270bb6bfcc4740b"},
|
||||||
|
{file = "ruff-0.15.5.tar.gz", hash = "sha256:7c3601d3b6d76dce18c5c824fc8d06f4eef33d6df0c21ec7799510cde0f159a2"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "setuptools"
|
name = "setuptools"
|
||||||
version = "68.1.2"
|
version = "82.0.1"
|
||||||
requires_python = ">=3.8"
|
requires_python = ">=3.9"
|
||||||
summary = "Easily download, build, install, upgrade, and uninstall Python packages"
|
summary = "Most extensible Python build backend with support for C/C++ extension modules"
|
||||||
|
groups = ["build"]
|
||||||
files = [
|
files = [
|
||||||
{file = "setuptools-68.1.2-py3-none-any.whl", hash = "sha256:3d8083eed2d13afc9426f227b24fd1659489ec107c0e86cec2ffdde5c92e790b"},
|
{file = "setuptools-82.0.1-py3-none-any.whl", hash = "sha256:a59e362652f08dcd477c78bb6e7bd9d80a7995bc73ce773050228a348ce2e5bb"},
|
||||||
{file = "setuptools-68.1.2.tar.gz", hash = "sha256:3d4dfa6d95f1b101d695a6160a7626e15583af71a5f52176efa5d39a054d475d"},
|
{file = "setuptools-82.0.1.tar.gz", hash = "sha256:7d872682c5d01cfde07da7bccc7b65469d3dca203318515ada1de5eda35efbf9"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tomli"
|
name = "tomli"
|
||||||
version = "2.0.1"
|
version = "2.4.0"
|
||||||
requires_python = ">=3.7"
|
requires_python = ">=3.8"
|
||||||
summary = "A lil' TOML parser"
|
summary = "A lil' TOML parser"
|
||||||
|
groups = ["default", "dev"]
|
||||||
|
marker = "python_version < \"3.11\""
|
||||||
files = [
|
files = [
|
||||||
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
|
{file = "tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867"},
|
||||||
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
|
{file = "tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9"},
|
||||||
|
{file = "tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95"},
|
||||||
|
{file = "tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76"},
|
||||||
|
{file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d"},
|
||||||
|
{file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576"},
|
||||||
|
{file = "tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a"},
|
||||||
|
{file = "tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa"},
|
||||||
|
{file = "tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da"},
|
||||||
|
{file = "tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3"},
|
||||||
|
{file = "tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a"},
|
||||||
|
{file = "tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "voicemeeter-api"
|
name = "voicemeeter-api"
|
||||||
version = "2.4.8"
|
version = "2.7.2"
|
||||||
requires_python = ">=3.10,<4.0"
|
requires_python = ">=3.10"
|
||||||
|
editable = true
|
||||||
|
path = "../voicemeeter-api-python"
|
||||||
summary = "A Python wrapper for the Voiceemeter API"
|
summary = "A Python wrapper for the Voiceemeter API"
|
||||||
|
groups = ["default", "dev"]
|
||||||
dependencies = [
|
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.8-py3-none-any.whl", hash = "sha256:a3ff9e6f7516d2adedde93f6976526b385d8ae6d86598bfe541a44f498f42ea6"},
|
|
||||||
{file = "voicemeeter_api-2.4.8.tar.gz", hash = "sha256:0d37a9f2af0f68087aa9c76a8cfb2ba44c6b75bb344e8dfa9fd18ad2c862730c"},
|
|
||||||
]
|
]
|
||||||
|
|||||||
123
pyproject.toml
123
pyproject.toml
@@ -1,30 +1,113 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "nvda_voicemeeter"
|
name = "nvda-voicemeeter"
|
||||||
version = "0.1.0"
|
version = "1.1.2"
|
||||||
description = "A Voicemeeter app compatible with NVDA"
|
description = "A Voicemeeter app compatible with NVDA"
|
||||||
authors = [
|
authors = [{ name = "Onyx and Iris", email = "code@onyxandiris.online" }]
|
||||||
{name = "onyx-and-iris", email = "code@onyxandiris.online"},
|
|
||||||
]
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pysimplegui>=4.60.5",
|
"pyparsing>=3.2.1",
|
||||||
"pyparsing>=3.1.1",
|
"voicemeeter-api>=2.7.2",
|
||||||
"voicemeeter-api>=2.4.8",
|
"freesimplegui>=5.1.1",
|
||||||
]
|
]
|
||||||
requires-python = ">=3.10,<3.11"
|
requires-python = ">=3.10,<3.13"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { text = "MIT" }
|
license = { text = "MIT" }
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
format = ["ruff>=0.9.2"]
|
||||||
|
build = ["pyinstaller>=6.3.0"]
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
nvda-voicemeeter-basic = "nvda_voicemeeter.gui.basic:run"
|
||||||
|
nvda-voicemeeter-banana = "nvda_voicemeeter.gui.banana:run"
|
||||||
|
nvda-voicemeeter-potato = "nvda_voicemeeter.gui.potato:run"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["pdm-backend"]
|
||||||
|
build-backend = "pdm.backend"
|
||||||
|
|
||||||
|
[tool.pdm]
|
||||||
|
distribution = true
|
||||||
|
|
||||||
[tool.pdm.dev-dependencies]
|
[tool.pdm.dev-dependencies]
|
||||||
build = [
|
dev = [
|
||||||
"pyinstaller>=5.1",
|
"-e file:///${PROJECT_ROOT}/../voicemeeter-api-python#egg=voicemeeter-api",
|
||||||
]
|
|
||||||
lint = [
|
|
||||||
"black>=23.7.0",
|
|
||||||
"flake8>=6.1.0",
|
|
||||||
]
|
|
||||||
test = [
|
|
||||||
"psgdemos>=1.12.1",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.pdm.scripts]
|
[tool.ruff]
|
||||||
build = {shell = "build.ps1"}
|
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"]
|
||||||
|
|||||||
0
spec/.gitkeep
Normal file
0
spec/.gitkeep
Normal file
@@ -1,13 +1,7 @@
|
|||||||
import PySimpleGUI as psg
|
import FreeSimpleGUI as psg
|
||||||
|
|
||||||
from .util import (
|
from . import util
|
||||||
get_asio_checkbox_index,
|
from .compound import LabelSlider
|
||||||
get_asio_samples_list,
|
|
||||||
get_input_device_list,
|
|
||||||
get_insert_checkbox_index,
|
|
||||||
get_patch_composite_list,
|
|
||||||
get_tabs_labels,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class Builder:
|
class Builder:
|
||||||
@@ -22,141 +16,167 @@ class Builder:
|
|||||||
menu = [[self.make_menu()]]
|
menu = [[self.make_menu()]]
|
||||||
|
|
||||||
layout0 = []
|
layout0 = []
|
||||||
if self.kind.name == "basic":
|
if self.kind.name == 'basic':
|
||||||
steps = (self.make_tab0_row0,)
|
steps = (
|
||||||
|
self.make_tab0_row0,
|
||||||
|
self.make_tab0_row1,
|
||||||
|
self.make_tab0_row5,
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
steps = (
|
steps = (
|
||||||
self.make_tab0_row0,
|
self.make_tab0_row0,
|
||||||
self.make_tab0_row1,
|
self.make_tab0_row1,
|
||||||
self.make_tab0_row2,
|
|
||||||
self.make_tab0_row3,
|
self.make_tab0_row3,
|
||||||
self.make_tab0_row4,
|
self.make_tab0_row4,
|
||||||
|
self.make_tab0_row5,
|
||||||
)
|
)
|
||||||
for step in steps:
|
for step in steps:
|
||||||
layout0.append([step()])
|
layout0.append([step()])
|
||||||
|
|
||||||
layout1 = []
|
layout1_1 = []
|
||||||
steps = (self.make_tab1_rows,)
|
steps = (self.make_tab1_button_rows,)
|
||||||
for step in steps:
|
for step in steps:
|
||||||
layout1.append([step()])
|
layout1_1.append([step()])
|
||||||
|
layout1_2 = []
|
||||||
layout2 = []
|
steps = (self.make_tab1_slider_rows,)
|
||||||
steps = (self.make_tab2_rows,)
|
|
||||||
for step in steps:
|
for step in steps:
|
||||||
layout2.append([step()])
|
layout1_2.append([step()])
|
||||||
|
|
||||||
layout3 = []
|
layout2_1 = []
|
||||||
steps = (self.make_tab3_rows,)
|
steps = (self.make_tab2_button_rows,)
|
||||||
for step in steps:
|
for step in steps:
|
||||||
layout3.append([step()])
|
layout2_1.append([step()])
|
||||||
|
layout2_2 = []
|
||||||
|
steps = (self.make_tab2_slider_rows,)
|
||||||
|
for step in steps:
|
||||||
|
layout2_2.append([step()])
|
||||||
|
|
||||||
layouts = [layout0, layout1, layout2, layout3]
|
layout3_1 = []
|
||||||
|
steps = (self.make_tab3_button_rows,)
|
||||||
|
for step in steps:
|
||||||
|
layout3_1.append([step()])
|
||||||
|
layout3_2 = []
|
||||||
|
steps = (self.make_tab3_slider_rows,)
|
||||||
|
for step in steps:
|
||||||
|
layout3_2.append([step()])
|
||||||
|
|
||||||
tabs = [psg.Tab(identifier, layouts[i], key=identifier) for i, identifier in enumerate(get_tabs_labels())]
|
def _make_inner_tabgroup(layouts, identifier) -> psg.TabGroup:
|
||||||
tab_group = psg.TabGroup([tabs], change_submits=True, key="tabs")
|
inner_layout = []
|
||||||
|
for i, tabname in enumerate(('buttons', 'sliders')):
|
||||||
|
inner_layout.append([psg.Tab(tabname.capitalize(), layouts[i], key=f'tab||{identifier}||{tabname}')])
|
||||||
|
return psg.TabGroup(
|
||||||
|
inner_layout,
|
||||||
|
change_submits=True,
|
||||||
|
enable_events=True,
|
||||||
|
key=f'tabgroup||{identifier}',
|
||||||
|
)
|
||||||
|
|
||||||
|
def _make_tabs(identifier) -> psg.Tab:
|
||||||
|
match identifier:
|
||||||
|
case 'Settings':
|
||||||
|
return psg.Tab('Settings', layout0, key='tab||Settings')
|
||||||
|
case 'Physical Strip':
|
||||||
|
tabgroup = _make_inner_tabgroup((layout1_1, layout1_2), identifier)
|
||||||
|
case 'Virtual Strip':
|
||||||
|
tabgroup = _make_inner_tabgroup((layout2_1, layout2_2), identifier)
|
||||||
|
case 'Buses':
|
||||||
|
tabgroup = _make_inner_tabgroup((layout3_1, layout3_2), identifier)
|
||||||
|
return psg.Tab(identifier, [[tabgroup]], key=f'tab||{identifier}')
|
||||||
|
|
||||||
|
tabs = []
|
||||||
|
for tab in util.get_tabs_labels():
|
||||||
|
tabs.append(_make_tabs(tab))
|
||||||
|
|
||||||
|
tab_group = psg.TabGroup([tabs], change_submits=True, enable_events=True, key='tabgroup')
|
||||||
|
|
||||||
return [[menu], [tab_group]]
|
return [[menu], [tab_group]]
|
||||||
|
|
||||||
def make_menu(self) -> psg.Menu:
|
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 = [
|
menu_def = [
|
||||||
[
|
[
|
||||||
"&Voicemeeter",
|
'&Voicemeeter',
|
||||||
[
|
[
|
||||||
"Restart Audio Engine::MENU",
|
'Restart Audio Engine::MENU',
|
||||||
"Save Settings::MENU",
|
'Save Settings::MENU',
|
||||||
"Load Settings::MENU",
|
'Load Settings::MENU',
|
||||||
"Load Settings on Startup ::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:
|
def make_tab0_row0(self) -> psg.Frame:
|
||||||
"""tab0 row0 represents hardware outs"""
|
"""tab0 row0 represents hardware ins"""
|
||||||
|
|
||||||
def add_physical_device_opts(layout):
|
def add_physical_device_opts(layout):
|
||||||
devices = get_input_device_list(self.vm)
|
devices = util.get_input_device_list(self.vm)
|
||||||
devices.append("- remove device selection -")
|
devices.append('- remove device selection -')
|
||||||
if self.kind.name == "basic":
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.ButtonMenu(
|
||||||
|
f'IN {i + 1}',
|
||||||
|
size=(6, 3),
|
||||||
|
menu_def=['', devices],
|
||||||
|
key=f'HARDWARE IN||{i + 1}',
|
||||||
|
)
|
||||||
|
for i in range(self.kind.phys_in)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
hardware_in = []
|
||||||
|
[step(hardware_in) for step in (add_physical_device_opts,)]
|
||||||
|
return psg.Frame('Hardware In', hardware_in)
|
||||||
|
|
||||||
|
def make_tab0_row1(self) -> psg.Frame:
|
||||||
|
"""tab0 row1 represents hardware outs"""
|
||||||
|
|
||||||
|
def add_physical_device_opts(layout):
|
||||||
|
if self.kind.name == 'basic':
|
||||||
num_outs = self.kind.phys_out + self.kind.virt_out
|
num_outs = self.kind.phys_out + self.kind.virt_out
|
||||||
else:
|
else:
|
||||||
num_outs = self.kind.phys_out
|
num_outs = self.kind.phys_out
|
||||||
layout.append(
|
layout.append(
|
||||||
[
|
[
|
||||||
psg.ButtonMenu(
|
psg.ButtonMenu(
|
||||||
f"A{i + 1}",
|
f'A{i + 1}',
|
||||||
size=(6, 3),
|
size=(6, 3),
|
||||||
menu_def=["", devices],
|
menu_def=['', util.get_output_device_list(i, self.vm)],
|
||||||
key=f"HARDWARE OUT||A{i + 1}",
|
key=f'HARDWARE OUT||A{i + 1}',
|
||||||
)
|
)
|
||||||
for i in range(num_outs)
|
for i in range(num_outs)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
hardware_out = list()
|
hardware_out = []
|
||||||
[step(hardware_out) for step in (add_physical_device_opts,)]
|
[step(hardware_out) for step in (add_physical_device_opts,)]
|
||||||
return psg.Frame("Hardware Out", hardware_out)
|
return psg.Frame('Hardware Out', hardware_out)
|
||||||
|
|
||||||
def make_tab0_row1(self) -> psg.Frame:
|
def make_tab0_row3(self) -> psg.Frame:
|
||||||
"""tab0 row1 represents patch asio inputs to strips"""
|
"""tab0 row3 represents patch composite"""
|
||||||
|
|
||||||
def add_asio_checkboxes(layout, i):
|
|
||||||
nums = list(range(99))
|
|
||||||
layout.append(
|
|
||||||
[
|
|
||||||
psg.Spin(
|
|
||||||
nums,
|
|
||||||
initial_value=self.window.cache["asio"][f"ASIO CHECKBOX||{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||{get_asio_checkbox_index(1, i)}"],
|
|
||||||
size=2,
|
|
||||||
enable_events=True,
|
|
||||||
key=f"ASIO CHECKBOX||IN{i} 1",
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
inner = list()
|
|
||||||
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)
|
|
||||||
|
|
||||||
def make_tab0_row2(self) -> psg.Frame:
|
|
||||||
"""tab0 row2 represents patch composite"""
|
|
||||||
|
|
||||||
def add_physical_device_opts(layout):
|
def add_physical_device_opts(layout):
|
||||||
outputs = get_patch_composite_list(self.vm.kind)
|
outputs = util.get_patch_composite_list(self.kind)
|
||||||
layout.append(
|
layout.append(
|
||||||
[
|
[
|
||||||
psg.ButtonMenu(
|
psg.ButtonMenu(
|
||||||
f"PC{i + 1}",
|
f'PC{i + 1}',
|
||||||
size=(6, 2),
|
size=(5, 2),
|
||||||
menu_def=["", outputs],
|
menu_def=['', outputs],
|
||||||
key=f"PATCH COMPOSITE||PC{i + 1}",
|
key=f'PATCH COMPOSITE||PC{i + 1}',
|
||||||
)
|
)
|
||||||
for i in range(self.kind.phys_out)
|
for i in range(self.kind.composite)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
hardware_out = list()
|
hardware_out = []
|
||||||
[step(hardware_out) for step in (add_physical_device_opts,)]
|
[step(hardware_out) for step in (add_physical_device_opts,)]
|
||||||
return psg.Frame("PATCH COMPOSITE", hardware_out)
|
return psg.Frame('PATCH COMPOSITE', hardware_out)
|
||||||
|
|
||||||
def make_tab0_row3(self) -> psg.Frame:
|
def make_tab0_row4(self) -> psg.Frame:
|
||||||
"""tab0 row3 represents patch insert"""
|
"""tab0 row4 represents patch insert"""
|
||||||
|
|
||||||
def add_insert_checkboxes(layout, i):
|
def add_insert_checkboxes(layout, i):
|
||||||
if i <= self.kind.phys_in:
|
if i <= self.kind.phys_in:
|
||||||
@@ -165,121 +185,325 @@ class Builder:
|
|||||||
[
|
[
|
||||||
psg.Checkbox(
|
psg.Checkbox(
|
||||||
text=channel,
|
text=channel,
|
||||||
default=self.vm.patch.insert[get_insert_checkbox_index(self.kind, j, i)].on,
|
default=self.window.cache['insert'][
|
||||||
|
f'INSERT CHECKBOX||{util.get_insert_checkbox_index(self.kind, j, i)}'
|
||||||
|
],
|
||||||
enable_events=True,
|
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:
|
else:
|
||||||
layout.append(
|
layout.append(
|
||||||
[
|
[
|
||||||
psg.Checkbox(
|
psg.Checkbox(
|
||||||
text=channel,
|
text=channel,
|
||||||
default=self.vm.patch.insert[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,
|
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'))
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
asio_checkboxes = list()
|
asio_checkboxes = []
|
||||||
inner = list()
|
inner = []
|
||||||
checkbox_lists = ([] for _ in range(self.kind.num_strip))
|
checkbox_lists = ([] for _ in range(self.kind.num_strip))
|
||||||
for i, checkbox_list in enumerate(checkbox_lists):
|
for i, checkbox_list in enumerate(checkbox_lists):
|
||||||
if i < self.kind.phys_in:
|
if i < self.kind.phys_in:
|
||||||
[step(checkbox_list, i + 1) for step in (add_insert_checkboxes,)]
|
[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:
|
else:
|
||||||
[step(checkbox_list, i + 1) for step in (add_insert_checkboxes,)]
|
[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)
|
asio_checkboxes.insert(0, inner)
|
||||||
|
|
||||||
return psg.Frame("PATCH INSERT", asio_checkboxes)
|
return psg.Frame('PATCH INSERT', asio_checkboxes)
|
||||||
|
|
||||||
def make_tab0_row4(self) -> psg.Frame:
|
def make_tab0_row5(self) -> psg.Frame:
|
||||||
"""tab0 row4 represents asio buffer"""
|
"""tab0 row5 represents advanced settings"""
|
||||||
|
|
||||||
samples = get_asio_samples_list()
|
|
||||||
samples.append("Default")
|
|
||||||
|
|
||||||
return psg.Frame(
|
return psg.Frame(
|
||||||
"ASIO BUFFER",
|
'ADVANCED SETTINGS',
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
psg.ButtonMenu(
|
psg.Button(
|
||||||
"ASIO BUFFER",
|
'ADVANCED SETTINGS',
|
||||||
size=(14, 2),
|
size=(20, 2),
|
||||||
menu_def=["", samples],
|
key='ADVANCED SETTINGS',
|
||||||
key="ASIO BUFFER",
|
|
||||||
)
|
)
|
||||||
]
|
|
||||||
],
|
],
|
||||||
|
],
|
||||||
|
key='ADVANCED SETTINGS FRAME',
|
||||||
)
|
)
|
||||||
|
|
||||||
def make_tab1_row(self, i) -> psg.Frame:
|
def make_tab1_button_row(self, i) -> psg.Frame:
|
||||||
"""tab1 row represents a strip's outputs (A1-A5, B1-B3)"""
|
"""tab1 row represents a strip's outputs (A1-A5, B1-B3)"""
|
||||||
|
|
||||||
def add_strip_outputs(layout):
|
def add_strip_outputs(layout):
|
||||||
layout.append(
|
layout.append(
|
||||||
[
|
[
|
||||||
psg.Button(
|
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),
|
size=(4, 2),
|
||||||
key=f"STRIP {i}||A{j + 1}"
|
key=f'STRIP {i}||A{j + 1}'
|
||||||
if j < self.kind.phys_out
|
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)
|
for j in range(self.kind.phys_out + self.kind.virt_out)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Button('Mono', size=(6, 2), key=f'STRIP {i}||MONO'),
|
||||||
|
psg.Button('Solo', size=(6, 2), key=f'STRIP {i}||SOLO'),
|
||||||
|
psg.Button('Mute', size=(6, 2), key=f'STRIP {i}||MUTE'),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
outputs = []
|
||||||
|
[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')
|
||||||
|
|
||||||
|
def make_tab1_button_rows(self) -> psg.Frame:
|
||||||
|
layout = [[self.make_tab1_button_row(i)] for i in range(self.kind.phys_in)]
|
||||||
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
|
def make_tab1_slider_row(self, i) -> psg.Frame:
|
||||||
|
def add_gain_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text('Gain'),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-60, 12),
|
||||||
|
default_value=self.vm.strip[i].gain,
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
disabled=True,
|
||||||
|
orientation='horizontal',
|
||||||
|
key=f'STRIP {i}||SLIDER GAIN',
|
||||||
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
outputs = list()
|
def add_param_sliders(layout):
|
||||||
[step(outputs) for step in (add_strip_outputs,)]
|
layout.append([LabelSlider(self.window, i, param) for param in util.get_slider_params(i, self.kind)])
|
||||||
return psg.Frame(self.window.cache["labels"][f"STRIP {i}||LABEL"], outputs, key=f"STRIP {i}||LABEL")
|
|
||||||
|
|
||||||
def make_tab1_rows(self) -> psg.Frame:
|
def add_limit_slider(layout):
|
||||||
layout = [[self.make_tab1_row(i)] for i in range(self.kind.phys_in)]
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text('Limit'),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-40, 12),
|
||||||
|
default_value=self.vm.strip[i].limit,
|
||||||
|
resolution=1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation='horizontal',
|
||||||
|
key=f'STRIP {i}||SLIDER LIMIT',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
layout = []
|
||||||
|
steps = (add_gain_slider, add_param_sliders)
|
||||||
|
if self.kind.name in ('banana', 'potato'):
|
||||||
|
steps += (add_limit_slider,)
|
||||||
|
[step(layout) for step in steps]
|
||||||
|
return psg.Frame(self.window.cache['labels'][f'STRIP {i}||LABEL'], layout, key=f'STRIP {i}||LABEL||SLIDER')
|
||||||
|
|
||||||
|
def make_tab1_slider_rows(self) -> psg.Frame:
|
||||||
|
layout = [[self.make_tab1_slider_row(i)] for i in range(self.kind.phys_in)]
|
||||||
return psg.Frame(None, layout, border_width=0)
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
def make_tab2_row(self, i) -> psg.Frame:
|
def make_tab2_button_row(self, i) -> psg.Frame:
|
||||||
"""tab2 row represents a strip's outputs (A1-A5, B1-B3)"""
|
"""tab2 row represents a strip's outputs (A1-A5, B1-B3)"""
|
||||||
|
|
||||||
def add_strip_outputs(layout):
|
def add_strip_outputs(layout):
|
||||||
layout.append(
|
layout.append(
|
||||||
[
|
[
|
||||||
psg.Button(
|
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),
|
size=(4, 2),
|
||||||
key=f"STRIP {i}||A{j + 1}"
|
key=f'STRIP {i}||A{j + 1}'
|
||||||
if j < self.kind.phys_out
|
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)
|
for j in range(self.kind.phys_out + self.kind.virt_out)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
if i == self.kind.phys_in + 1:
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Button('K', size=(6, 2), key=f'STRIP {i}||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}||MC'),
|
||||||
|
psg.Button('Solo', size=(6, 2), key=f'STRIP {i}||SOLO'),
|
||||||
|
psg.Button('Mute', size=(6, 2), key=f'STRIP {i}||MUTE'),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
outputs = list()
|
outputs = []
|
||||||
[step(outputs) for step in (add_strip_outputs,)]
|
[step(outputs) for step in (add_strip_outputs,)]
|
||||||
return psg.Frame(self.window.cache["labels"][f"STRIP {i}||LABEL"], outputs, key=f"STRIP {i}||LABEL")
|
return psg.Frame(
|
||||||
|
self.window.cache['labels'][f'STRIP {i}||LABEL'],
|
||||||
|
outputs,
|
||||||
|
key=f'STRIP {i}||LABEL',
|
||||||
|
)
|
||||||
|
|
||||||
def make_tab2_rows(self) -> psg.Frame:
|
def make_tab2_button_rows(self) -> psg.Frame:
|
||||||
layout = [[self.make_tab2_row(i)] for i in range(self.kind.phys_in, self.kind.phys_in + self.kind.virt_in)]
|
layout = [
|
||||||
|
[self.make_tab2_button_row(i)] for i in range(self.kind.phys_in, self.kind.phys_in + self.kind.virt_in)
|
||||||
|
]
|
||||||
return psg.Frame(None, layout, border_width=0)
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
def make_tab3_row(self, i) -> psg.Frame:
|
def make_tab2_slider_row(self, i) -> psg.Frame:
|
||||||
|
def add_gain_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text('Gain'),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-60, 12),
|
||||||
|
default_value=self.vm.strip[i].gain,
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
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.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.kind)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
def add_limit_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text('Limit'),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-40, 12),
|
||||||
|
default_value=self.vm.strip[i].limit,
|
||||||
|
resolution=1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation='horizontal',
|
||||||
|
key=f'STRIP {i}||SLIDER LIMIT',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
layout = []
|
||||||
|
steps = (add_gain_slider, add_param_sliders)
|
||||||
|
if self.kind.name in ('banana', 'potato'):
|
||||||
|
steps += (add_limit_slider,)
|
||||||
|
[step(layout) for step in steps]
|
||||||
|
return psg.Frame(
|
||||||
|
self.window.cache['labels'][f'STRIP {i}||LABEL'],
|
||||||
|
layout,
|
||||||
|
key=f'STRIP {i}||LABEL||SLIDER',
|
||||||
|
)
|
||||||
|
|
||||||
|
def make_tab2_slider_rows(self) -> psg.Frame:
|
||||||
|
layout = [
|
||||||
|
[self.make_tab2_slider_row(i)] for i in range(self.kind.phys_in, self.kind.phys_in + self.kind.virt_in)
|
||||||
|
]
|
||||||
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
|
def make_tab3_button_row(self, i) -> psg.Frame:
|
||||||
"""tab3 row represents bus composite toggle"""
|
"""tab3 row represents bus composite toggle"""
|
||||||
|
|
||||||
def add_strip_outputs(layout):
|
def add_bus_buttons(layout):
|
||||||
layout.append([psg.Button(f"BUSMODE", size=(12, 2), key=f"BUS {i}||MODE")])
|
busmono = util.get_bus_mono()
|
||||||
|
params = ['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.ButtonMenu(
|
||||||
|
'Mono',
|
||||||
|
size=(6, 2),
|
||||||
|
menu_def=['', busmono],
|
||||||
|
key=f'BUS {i}||MONO',
|
||||||
|
),
|
||||||
|
*[
|
||||||
|
psg.Button(
|
||||||
|
param.capitalize(),
|
||||||
|
size=(6, 2),
|
||||||
|
key=f'BUS {i}||{param}',
|
||||||
|
)
|
||||||
|
for param in params
|
||||||
|
],
|
||||||
|
psg.ButtonMenu(
|
||||||
|
'Bus Mode',
|
||||||
|
size=(12, 2),
|
||||||
|
menu_def=['', busmodes],
|
||||||
|
key=f'BUS {i}||MODE',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
outputs = list()
|
outputs = []
|
||||||
[step(outputs) for step in (add_strip_outputs,)]
|
[step(outputs) for step in (add_bus_buttons,)]
|
||||||
return psg.Frame(self.window.cache["labels"][f"BUS {i}||LABEL"], outputs, key=f"BUS {i}||LABEL")
|
return psg.Frame(
|
||||||
|
self.window.cache['labels'][f'BUS {i}||LABEL'],
|
||||||
|
outputs,
|
||||||
|
key=f'BUS {i}||LABEL',
|
||||||
|
)
|
||||||
|
|
||||||
def make_tab3_rows(self) -> psg.Frame:
|
def make_tab3_button_rows(self) -> psg.Frame:
|
||||||
layout = [[self.make_tab3_row(i)] for i in range(self.kind.num_bus)]
|
layout = [[self.make_tab3_button_row(i)] for i in range(self.kind.num_bus)]
|
||||||
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|
||||||
|
def make_tab3_slider_row(self, i) -> psg.Frame:
|
||||||
|
def add_gain_slider(layout):
|
||||||
|
layout.append(
|
||||||
|
[
|
||||||
|
psg.Text('Gain'),
|
||||||
|
psg.Slider(
|
||||||
|
range=(-60, 12),
|
||||||
|
default_value=self.vm.bus[i].gain,
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
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')
|
||||||
|
|
||||||
|
def make_tab3_slider_rows(self) -> psg.Frame:
|
||||||
|
layout = [[self.make_tab3_slider_row(i)] for i in range(self.kind.num_bus)]
|
||||||
return psg.Frame(None, layout, border_width=0)
|
return psg.Frame(None, layout, border_width=0)
|
||||||
|
|||||||
@@ -1,46 +1,52 @@
|
|||||||
import ctypes as ct
|
import ctypes as ct
|
||||||
import platform
|
import platform
|
||||||
import winreg
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from .errors import NVDAVMError
|
from .errors import NVDAVMError
|
||||||
|
|
||||||
bits = 64 if ct.sizeof(ct.c_voidp) == 8 else 32
|
try:
|
||||||
|
import winreg
|
||||||
|
except ImportError as e:
|
||||||
|
ERR_MSG = 'winreg module not found, only Windows OS supported'
|
||||||
|
raise NVDAVMError(ERR_MSG) from e
|
||||||
|
|
||||||
if platform.system() != "Windows":
|
# Defense against edge cases where winreg imports but we're not on Windows
|
||||||
raise NVDAVMError("Only Windows OS supported")
|
if platform.system() != 'Windows':
|
||||||
|
raise NVDAVMError('Only Windows OS supported')
|
||||||
|
|
||||||
REG_KEY = "\\".join(
|
BITS = 64 if ct.sizeof(ct.c_void_p) == 8 else 32
|
||||||
|
|
||||||
|
REG_KEY = '\\'.join(
|
||||||
filter(
|
filter(
|
||||||
None,
|
None,
|
||||||
(
|
(
|
||||||
"SOFTWARE",
|
'SOFTWARE',
|
||||||
"WOW6432Node" if bits == 64 else "",
|
'WOW6432Node' if BITS == 64 else '',
|
||||||
"Microsoft",
|
'Microsoft',
|
||||||
"Windows",
|
'Windows',
|
||||||
"CurrentVersion",
|
'CurrentVersion',
|
||||||
"Uninstall",
|
'Uninstall',
|
||||||
"NVDA",
|
'NVDA',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_nvdapath():
|
def get_nvdapath():
|
||||||
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"{}".format(REG_KEY)) as nvda_key:
|
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'{}'.format(REG_KEY)) as nvda_key:
|
||||||
return winreg.QueryValueEx(nvda_key, r"UninstallDirectory")[0]
|
return winreg.QueryValueEx(nvda_key, r'UninstallDirectory')[0]
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
NVDA_PATH = Path(get_nvdapath()) / "nvda.exe"
|
NVDA_PATH = Path(get_nvdapath()) / 'nvda.exe'
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError:
|
||||||
NVDA_PATH = ""
|
NVDA_PATH = ''
|
||||||
|
|
||||||
|
|
||||||
controller_path = Path(__file__).parents[2].resolve() / "controllerClient"
|
controller_path = Path(__file__).parents[2].resolve() / 'controllerClient'
|
||||||
if not controller_path.exists():
|
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))
|
libc = ct.WinDLL(str(DLL_PATH))
|
||||||
|
|||||||
208
src/nvda_voicemeeter/compound.py
Normal file
208
src/nvda_voicemeeter/compound.py
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
from typing import Union
|
||||||
|
|
||||||
|
import FreeSimpleGUI as psg
|
||||||
|
|
||||||
|
from . import util
|
||||||
|
|
||||||
|
|
||||||
|
class LabelSlider(psg.Frame):
|
||||||
|
"""Compound Label Slider Strip element"""
|
||||||
|
|
||||||
|
def __init__(self, parent, i, param, range_=(0, 10), *args, **kwargs):
|
||||||
|
self.parent = parent
|
||||||
|
if param in ('AUDIBILITY', 'DENOISER'):
|
||||||
|
size = 7
|
||||||
|
else:
|
||||||
|
if psg.theme() == 'HighContrast':
|
||||||
|
size = 5
|
||||||
|
else:
|
||||||
|
size = 4
|
||||||
|
layout = [
|
||||||
|
[
|
||||||
|
psg.Text(param.capitalize(), size=size),
|
||||||
|
psg.Slider(
|
||||||
|
range=range_,
|
||||||
|
default_value=self.default_value(i, param),
|
||||||
|
resolution=0.1,
|
||||||
|
disable_number_display=True,
|
||||||
|
size=(12, 16),
|
||||||
|
expand_x=True,
|
||||||
|
enable_events=True,
|
||||||
|
orientation='horizontal',
|
||||||
|
key=f'STRIP {i}||SLIDER {param}',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
]
|
||||||
|
super().__init__(None, layout=layout, border_width=0, pad=0, *args, **kwargs)
|
||||||
|
|
||||||
|
def default_value(self, i, param):
|
||||||
|
target = getattr(self.parent.vm.strip[i], param.lower())
|
||||||
|
if param in ('COMP', 'GATE', 'DENOISER'):
|
||||||
|
return target.knob
|
||||||
|
return target
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
||||||
34
src/nvda_voicemeeter/configuration.py
Normal file
34
src/nvda_voicemeeter/configuration.py
Normal 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)
|
||||||
@@ -8,4 +8,4 @@ class NVDAVMCAPIError(NVDAVMError):
|
|||||||
def __init__(self, fn_name, code):
|
def __init__(self, fn_name, code):
|
||||||
self.fn_name = fn_name
|
self.fn_name = fn_name
|
||||||
self.code = code
|
self.code = code
|
||||||
super().__init__(f"{self.fn_name} returned {self.code}")
|
super().__init__(f'{self.fn_name} returned {self.code}')
|
||||||
|
|||||||
1
src/nvda_voicemeeter/gui/banana/__init__.py
Normal file
1
src/nvda_voicemeeter/gui/banana/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from .main import run
|
||||||
11
src/nvda_voicemeeter/gui/banana/main.py
Normal file
11
src/nvda_voicemeeter/gui/banana/main.py
Normal 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()
|
||||||
1
src/nvda_voicemeeter/gui/basic/__init__.py
Normal file
1
src/nvda_voicemeeter/gui/basic/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from .main import run
|
||||||
11
src/nvda_voicemeeter/gui/basic/main.py
Normal file
11
src/nvda_voicemeeter/gui/basic/main.py
Normal 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()
|
||||||
1
src/nvda_voicemeeter/gui/potato/__init__.py
Normal file
1
src/nvda_voicemeeter/gui/potato/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from .main import run
|
||||||
11
src/nvda_voicemeeter/gui/potato/main.py
Normal file
11
src/nvda_voicemeeter/gui/potato/main.py
Normal 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()
|
||||||
@@ -1,63 +1,95 @@
|
|||||||
|
def _make_hardware_ins_cache(vm) -> dict:
|
||||||
|
return {**{f'HARDWARE IN||{i + 1}': vm.strip[i].device.name for i in range(vm.kind.phys_in)}}
|
||||||
|
|
||||||
|
|
||||||
def _make_hardware_outs_cache(vm) -> dict:
|
def _make_hardware_outs_cache(vm) -> dict:
|
||||||
return {**{f"HARDWARE OUT||A{i + 1}": vm.bus[i].device.name for i in range(vm.kind.phys_out)}}
|
hw_outs = {**{f'HARDWARE OUT||A{i + 1}': vm.bus[i].device.name for i in range(vm.kind.phys_out)}}
|
||||||
|
if vm.kind.name == 'basic':
|
||||||
|
hw_outs |= {'HARDWARE OUT||A2': vm.bus[1].device.name}
|
||||||
|
return hw_outs
|
||||||
|
|
||||||
|
|
||||||
def _make_output_cache(vm) -> dict:
|
def _make_param_cache(vm, channel_type) -> dict:
|
||||||
|
params = {}
|
||||||
|
if channel_type == 'strip':
|
||||||
match vm.kind.name:
|
match vm.kind.name:
|
||||||
case "basic":
|
case 'basic':
|
||||||
return {
|
params |= {
|
||||||
**{f"STRIP {i}||A1": vm.strip[i].A1 for i in range(vm.kind.num_strip)},
|
**{f'STRIP {i}||A1': vm.strip[i].A1 for i in range(vm.kind.num_strip)},
|
||||||
**{f"STRIP {i}||B1": vm.strip[i].B1 for i in range(vm.kind.num_strip)},
|
**{f'STRIP {i}||B1': vm.strip[i].B1 for i in range(vm.kind.num_strip)},
|
||||||
}
|
}
|
||||||
case "banana":
|
case 'banana':
|
||||||
return {
|
params |= {
|
||||||
**{f"STRIP {i}||A1": vm.strip[i].A1 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}||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}||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}||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}||B2': vm.strip[i].B2 for i in range(vm.kind.num_strip)},
|
||||||
}
|
}
|
||||||
case "potato":
|
case 'potato':
|
||||||
return {
|
params |= {
|
||||||
**{f"STRIP {i}||A1": vm.strip[i].A1 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}||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}||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}||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}||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}||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}||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}||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.phys_in)},
|
||||||
def _make_bus_mode_cache(vm) -> dict:
|
**{f'STRIP {i}||SOLO': vm.strip[i].solo for i in range(vm.kind.num_strip)},
|
||||||
return {**{f"BUS {i}||MODE": vm.bus[i].mode.get() for i in range(vm.kind.num_bus)}}
|
**{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)},
|
||||||
|
}
|
||||||
|
return params
|
||||||
|
|
||||||
|
|
||||||
def _make_label_cache(vm) -> dict:
|
def _make_label_cache(vm) -> dict:
|
||||||
return {
|
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)
|
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)
|
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)
|
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)
|
for i in range(vm.kind.phys_out, vm.kind.phys_out + vm.kind.virt_out)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _make_patch_asio_cache(vm) -> dict:
|
def _make_patch_asio_cache(vm) -> dict:
|
||||||
return {**{f"ASIO CHECKBOX||{i}": vm.patch.asio[i].get() for i in range(vm.kind.phys_out * 2)}}
|
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:
|
def _make_patch_insert_cache(vm) -> dict:
|
||||||
return {**{f"INSERT CHECKBOX||{i}": vm.patch.insert[i].on for i in range(vm.kind.num_strip_levels)}}
|
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
|
||||||
|
|||||||
@@ -1,30 +1,56 @@
|
|||||||
|
from enum import IntEnum
|
||||||
|
|
||||||
from .cdll import libc
|
from .cdll import libc
|
||||||
from .errors import NVDAVMCAPIError
|
from .errors import NVDAVMCAPIError
|
||||||
|
|
||||||
|
|
||||||
|
class ServerState(IntEnum):
|
||||||
|
RUNNING = 0
|
||||||
|
UNAVAILABLE = 1722
|
||||||
|
|
||||||
|
|
||||||
class CBindings:
|
class CBindings:
|
||||||
bind_test_if_running = libc.nvdaController_testIfRunning
|
bind_test_if_running = libc.nvdaController_testIfRunning
|
||||||
bind_speak_text = libc.nvdaController_speakText
|
bind_speak_text = libc.nvdaController_speakText
|
||||||
bind_cancel_speech = libc.nvdaController_cancelSpeech
|
bind_cancel_speech = libc.nvdaController_cancelSpeech
|
||||||
bind_braille_message = libc.nvdaController_brailleMessage
|
bind_braille_message = libc.nvdaController_brailleMessage
|
||||||
|
|
||||||
def call(self, fn, *args, ok=(0,)):
|
def _call(self, fn, *args, ok=(0,)) -> int:
|
||||||
retval = fn(*args)
|
retval = fn(*args)
|
||||||
if retval not in ok:
|
if retval not in ok:
|
||||||
raise NVDAVMCAPIError(fn.__name__, retval)
|
raise NVDAVMCAPIError(fn.__name__, retval)
|
||||||
return retval
|
return retval
|
||||||
|
|
||||||
|
def test_if_running(self) -> int:
|
||||||
|
return self._call(self.bind_test_if_running, ok=(ServerState.RUNNING, ServerState.UNAVAILABLE))
|
||||||
|
|
||||||
|
def speak_text(self, text: str) -> None:
|
||||||
|
self._call(self.bind_speak_text, text)
|
||||||
|
|
||||||
|
def cancel_speech(self) -> None:
|
||||||
|
self._call(self.bind_cancel_speech)
|
||||||
|
|
||||||
|
def braille_message(self, text: str) -> None:
|
||||||
|
self._call(self.bind_braille_message, text)
|
||||||
|
|
||||||
|
|
||||||
|
class Nvda:
|
||||||
|
def __init__(self):
|
||||||
|
self._bindings = CBindings()
|
||||||
|
|
||||||
class Nvda(CBindings):
|
|
||||||
@property
|
@property
|
||||||
def is_running(self):
|
def is_running(self) -> bool:
|
||||||
return self.call(self.bind_test_if_running) == 0
|
return self._bindings.test_if_running() == ServerState.RUNNING
|
||||||
|
|
||||||
def speak(self, text):
|
def speak(self, text: str) -> None:
|
||||||
self.call(self.bind_speak_text, text)
|
self._bindings.speak_text(text)
|
||||||
|
|
||||||
def cancel_speech(self):
|
def cancel_speech(self) -> None:
|
||||||
self.call(self.bind_cancel_speech)
|
self._bindings.cancel_speech()
|
||||||
|
|
||||||
def braille_message(self, text):
|
def braille_message(self, text: str) -> None:
|
||||||
self.call(self.bind_braille_message, text)
|
self._bindings.braille_message(text)
|
||||||
|
|
||||||
|
def speak_and_braille(self, text: str) -> None:
|
||||||
|
self.speak(text)
|
||||||
|
self.braille_message(text)
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ from pyparsing import Group, OneOrMore, Optional, Suppress, Word, alphanums, res
|
|||||||
class Parser:
|
class Parser:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.widget = Group(OneOrMore(Word(alphanums)))
|
self.widget = Group(OneOrMore(Word(alphanums)))
|
||||||
self.widget_token = Suppress("||")
|
self.widget_token = Suppress('||')
|
||||||
self.identifier = Group(OneOrMore(Word(alphanums)))
|
self.identifier = Group(OneOrMore(Word(alphanums)))
|
||||||
self.event = Group(OneOrMore(Word(alphanums)))
|
self.event = Group(OneOrMore(Word(alphanums)))
|
||||||
self.menu_token = Suppress("::")
|
self.menu_token = Suppress('::')
|
||||||
self.match = (
|
self.match = (
|
||||||
self.widget + self.widget_token + self.identifier + Optional(self.widget_token) + Optional(self.event)
|
self.widget + self.widget_token + self.identifier + Optional(self.widget_token) + Optional(self.event)
|
||||||
| self.identifier + self.menu_token + self.event
|
| self.identifier + self.menu_token + self.event
|
||||||
|
|||||||
828
src/nvda_voicemeeter/popup.py
Normal file
828
src/nvda_voicemeeter/popup.py
Normal file
@@ -0,0 +1,828 @@
|
|||||||
|
import logging
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import FreeSimpleGUI as psg
|
||||||
|
|
||||||
|
from . import util
|
||||||
|
from .compound import CompSlider, GateSlider, LabelSliderAdvanced
|
||||||
|
|
||||||
|
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'),
|
||||||
|
],
|
||||||
|
]
|
||||||
|
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')
|
||||||
|
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'):
|
||||||
|
break
|
||||||
|
match parsed_cmd := self.window.parser.match.parse_string(event):
|
||||||
|
case [[button], ['FOCUS', 'IN']]:
|
||||||
|
if values['Browse']:
|
||||||
|
filepath = values['Browse']
|
||||||
|
break
|
||||||
|
self.window.nvda.speak_and_braille(button)
|
||||||
|
case [_, ['KEY', 'ENTER']]:
|
||||||
|
popup.find_element_with_focus().click()
|
||||||
|
self.logger.debug(f'parsed::{parsed_cmd}')
|
||||||
|
popup.close()
|
||||||
|
if filepath:
|
||||||
|
return Path(filepath)
|
||||||
|
|
||||||
|
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.Input(key='Edit'),
|
||||||
|
],
|
||||||
|
[psg.Button('Ok'), psg.Button('Cancel')],
|
||||||
|
],
|
||||||
|
]
|
||||||
|
popup = psg.Window(title, layout, finalize=True)
|
||||||
|
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'):
|
||||||
|
break
|
||||||
|
match parsed_cmd := self.window.parser.match.parse_string(event):
|
||||||
|
case [[button], ['FOCUS', 'IN']]:
|
||||||
|
self.window.nvda.speak_and_braille(button)
|
||||||
|
case [_, ['KEY', 'ENTER']]:
|
||||||
|
popup.find_element_with_focus().click()
|
||||||
|
case ['Ok']:
|
||||||
|
data = values
|
||||||
|
break
|
||||||
|
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}',
|
||||||
|
)
|
||||||
|
for driver in ('MME', 'WDM', 'KS', 'ASIO')
|
||||||
|
],
|
||||||
|
]
|
||||||
|
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))])
|
||||||
|
|
||||||
|
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 = 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.parse_string(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_and_braille(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_and_braille(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_and_braille(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_and_braille(
|
||||||
|
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:
|
||||||
|
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.TKroot.after(
|
||||||
|
200, self.window.nvda.speak_and_braille, 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_and_braille(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_and_braille(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 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}', propagate=False
|
||||||
|
)
|
||||||
|
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}',
|
||||||
|
propagate=False,
|
||||||
|
)
|
||||||
|
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.parse_string(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_and_braille(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_and_braille(str(round(val, 2)))
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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_and_braille(str(round(val, 2)))
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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_and_braille(str(round(val, 2)))
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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_and_braille(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_and_braille(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_and_braille(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_and_braille(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_and_braille(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_and_braille(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_and_braille(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_and_braille(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_and_braille('on' if val else 'off')
|
||||||
|
case [[button], ['FOCUS', 'IN']]:
|
||||||
|
if button == 'MAKEUP':
|
||||||
|
self.window.nvda.speak_and_braille(
|
||||||
|
f'{button} {"on" if self.window.vm.strip[index].comp.makeup else "off"}'
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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}', propagate=False
|
||||||
|
)
|
||||||
|
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}',
|
||||||
|
propagate=False,
|
||||||
|
)
|
||||||
|
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.parse_string(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_and_braille(
|
||||||
|
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_and_braille(str(int(val)))
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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_and_braille(str(int(val)))
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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_and_braille(str(int(val)))
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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_and_braille(str(int(val)))
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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_and_braille(str(int(val)))
|
||||||
|
else:
|
||||||
|
self.window.nvda.speak_and_braille(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_and_braille(str(round(val, 1)))
|
||||||
|
|
||||||
|
case [[button], ['FOCUS', 'IN']]:
|
||||||
|
self.window.nvda.speak_and_braille(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()
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
def get_asio_checkbox_index(channel, num) -> int:
|
from typing import Iterable
|
||||||
|
|
||||||
|
import FreeSimpleGUI as psg
|
||||||
|
|
||||||
|
|
||||||
|
def get_asio_input_spinbox_index(channel, num) -> int:
|
||||||
if channel == 0:
|
if channel == 0:
|
||||||
return 2 * num - 2
|
return 2 * num - 2
|
||||||
return 2 * num - 1
|
return 2 * num - 1
|
||||||
@@ -8,67 +13,85 @@ def get_insert_checkbox_index(kind, channel, num) -> int:
|
|||||||
if num <= kind.phys_in:
|
if num <= kind.phys_in:
|
||||||
if channel == 0:
|
if channel == 0:
|
||||||
return 2 * num - 2
|
return 2 * num - 2
|
||||||
else:
|
|
||||||
return 2 * num - 1
|
return 2 * num - 1
|
||||||
return (2 * kind.phys_in) + (8 * (num - kind.phys_in - 1)) + channel
|
return (2 * kind.phys_in) + (8 * (num - kind.phys_in - 1)) + channel
|
||||||
|
|
||||||
|
|
||||||
|
_rejected_ids = (
|
||||||
|
'VBAudio100VMVAIO3',
|
||||||
|
'{F5735BD4-6EAF-4758-9710-9886E5AD0FF3}',
|
||||||
|
'{0239BE07-CEEF-4236-A900-AA778D432FD4}',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_input_device_list(vm) -> list:
|
def get_input_device_list(vm) -> list:
|
||||||
return ["{type}: {name}".format(**vm.device.output(i)) for i in range(vm.device.outs)]
|
devices = []
|
||||||
|
for j in range(vm.device.ins):
|
||||||
|
device = vm.device.input(j)
|
||||||
|
if device['id'] not in _rejected_ids:
|
||||||
|
devices.append('{type}: {name}'.format(**device))
|
||||||
|
return devices
|
||||||
|
|
||||||
|
|
||||||
|
def get_output_device_list(i, vm) -> list:
|
||||||
|
devices = []
|
||||||
|
for j in range(vm.device.outs):
|
||||||
|
device = vm.device.output(j)
|
||||||
|
if device['id'] not in _rejected_ids:
|
||||||
|
devices.append('{type}: {name}'.format(**device))
|
||||||
|
if i == 0:
|
||||||
|
return devices
|
||||||
|
devices.append('- remove device selection -')
|
||||||
|
return [device for device in devices if not device.startswith('asio')]
|
||||||
|
|
||||||
|
|
||||||
def get_patch_composite_list(kind) -> list:
|
def get_patch_composite_list(kind) -> list:
|
||||||
temp = []
|
temp = []
|
||||||
for i in range(kind.phys_out):
|
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):
|
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
|
return temp
|
||||||
|
|
||||||
|
|
||||||
def get_patch_insert_channels() -> list:
|
def get_patch_insert_channels() -> list:
|
||||||
return [
|
return [
|
||||||
"left",
|
'left',
|
||||||
"right",
|
'right',
|
||||||
"center",
|
'center',
|
||||||
"low frequency effect",
|
'low frequency effect',
|
||||||
"surround left",
|
'surround left',
|
||||||
"surround right",
|
'surround right',
|
||||||
"back left",
|
'back left',
|
||||||
"back right",
|
'back right',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
_patch_insert_channels = get_patch_insert_channels()
|
_patch_insert_channels = get_patch_insert_channels()
|
||||||
|
|
||||||
|
|
||||||
def get_asio_samples_list() -> list:
|
def get_asio_samples_list(driver) -> list:
|
||||||
return [
|
if driver == 'MME':
|
||||||
"1024",
|
samples = ['2048', '1536', '1024', '896', '768', '704', '640', '576', '512', '480', '441']
|
||||||
"768",
|
else:
|
||||||
"704",
|
# fmt: off
|
||||||
"640",
|
samples = [
|
||||||
"576",
|
"2048", "1536", "1024", "768", "704", "640", "576", "512", "480", "448", "441", "416", "384",
|
||||||
"512",
|
"352", "320", "288", "256", "224", "192", "160", "128"
|
||||||
"480",
|
|
||||||
"448",
|
|
||||||
"441",
|
|
||||||
"416",
|
|
||||||
"384",
|
|
||||||
"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')
|
||||||
|
return samples
|
||||||
|
|
||||||
|
|
||||||
def get_tabs_labels() -> list:
|
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:
|
def open_context_menu_for_buttonmenu(window, identifier) -> None:
|
||||||
@@ -83,8 +106,141 @@ def get_channel_identifier_list(vm) -> list:
|
|||||||
identifiers = []
|
identifiers = []
|
||||||
for i in range(vm.kind.phys_in):
|
for i in range(vm.kind.phys_in):
|
||||||
for j in range(2):
|
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 i in range(vm.kind.phys_in, vm.kind.phys_in + vm.kind.virt_in):
|
||||||
for j in range(8):
|
for j in range(8):
|
||||||
identifiers.append(f"IN{i + 1} {j}")
|
identifiers.append(f'IN{i + 1} {j}')
|
||||||
return identifiers
|
return identifiers
|
||||||
|
|
||||||
|
|
||||||
|
_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':
|
||||||
|
return [
|
||||||
|
'normal',
|
||||||
|
'amix',
|
||||||
|
'repeat',
|
||||||
|
'composite',
|
||||||
|
]
|
||||||
|
return [
|
||||||
|
'normal',
|
||||||
|
'amix',
|
||||||
|
'bmix',
|
||||||
|
'repeat',
|
||||||
|
'composite',
|
||||||
|
'tvmix',
|
||||||
|
'upmix21',
|
||||||
|
'upmix41',
|
||||||
|
'upmix61',
|
||||||
|
'centeronly',
|
||||||
|
'lfeonly',
|
||||||
|
'rearonly',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def get_bus_mono() -> list:
|
||||||
|
return ['off', 'on', 'stereo reverse']
|
||||||
|
|
||||||
|
|
||||||
|
def check_bounds(val, bounds: tuple) -> int | float:
|
||||||
|
lower, upper = bounds
|
||||||
|
if val > upper:
|
||||||
|
val = upper
|
||||||
|
elif val < lower:
|
||||||
|
val = lower
|
||||||
|
return val
|
||||||
|
|
||||||
|
|
||||||
|
def get_slider_params(i, 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
302
tools/dynamic_builder.py
Normal file
302
tools/dynamic_builder.py
Normal file
@@ -0,0 +1,302 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Dynamic build system for nvda-voicemeeter.
|
||||||
|
|
||||||
|
This script generates PyInstaller spec files on-the-fly and builds executables
|
||||||
|
without storing intermediate files in the repository.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
python tools/dynamic_builder.py # Build all kinds
|
||||||
|
python tools/dynamic_builder.py basic # Build basic only
|
||||||
|
python tools/dynamic_builder.py basic banana # Build specific kinds
|
||||||
|
python tools/dynamic_builder.py all # Build all kinds (explicit)
|
||||||
|
|
||||||
|
Requirements:
|
||||||
|
- PDM environment with PyInstaller installed
|
||||||
|
- controllerClient DLL files in controllerClient/{x64,x86}/
|
||||||
|
- nvda_voicemeeter package installed in environment
|
||||||
|
|
||||||
|
Environment Variables:
|
||||||
|
- PDM_BIN: Path to PDM executable (default: 'pdm')
|
||||||
|
|
||||||
|
Exit Codes:
|
||||||
|
- 0: All builds successful
|
||||||
|
- 1: One or more builds failed
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import tempfile
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
# Build configuration
|
||||||
|
KINDS = ['basic', 'banana', 'potato']
|
||||||
|
|
||||||
|
# Templates
|
||||||
|
PYTHON_TEMPLATE = """import voicemeeterlib
|
||||||
|
|
||||||
|
import nvda_voicemeeter
|
||||||
|
|
||||||
|
KIND_ID = '{kind}'
|
||||||
|
|
||||||
|
with voicemeeterlib.api(KIND_ID) as vm:
|
||||||
|
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
|
||||||
|
window.run()
|
||||||
|
"""
|
||||||
|
|
||||||
|
SPEC_TEMPLATE = """# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
block_cipher = None
|
||||||
|
|
||||||
|
added_files = [
|
||||||
|
( '{controller_x64_path}', 'controllerClient/x64' ),
|
||||||
|
( '{controller_x86_path}', 'controllerClient/x86' ),
|
||||||
|
]
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['{script_path}'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=added_files,
|
||||||
|
hiddenimports=[],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={{}},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=block_cipher,
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
[],
|
||||||
|
exclude_binaries=True,
|
||||||
|
name='{kind}',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
)
|
||||||
|
coll = COLLECT(
|
||||||
|
exe,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
name='{kind}',
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class DynamicBuilder:
|
||||||
|
def __init__(self, base_dir: Path, dist_dir: Path):
|
||||||
|
self.base_dir = base_dir
|
||||||
|
self.dist_dir = dist_dir
|
||||||
|
self.temp_dir = None
|
||||||
|
|
||||||
|
def validate_environment(self) -> bool:
|
||||||
|
"""Validate that all required files and dependencies are present."""
|
||||||
|
|
||||||
|
# Check for controller client DLLs
|
||||||
|
x64_dll = self.base_dir / 'controllerClient' / 'x64' / 'nvdaControllerClient.dll'
|
||||||
|
x86_dll = self.base_dir / 'controllerClient' / 'x86' / 'nvdaControllerClient.dll'
|
||||||
|
|
||||||
|
if not x64_dll.exists():
|
||||||
|
print(f'[ERROR] Missing x64 controller client: {x64_dll}')
|
||||||
|
return False
|
||||||
|
|
||||||
|
if not x86_dll.exists():
|
||||||
|
print(f'[ERROR] Missing x86 controller client: {x86_dll}')
|
||||||
|
return False
|
||||||
|
|
||||||
|
print('[OK] Controller client DLLs found')
|
||||||
|
|
||||||
|
# Check PyInstaller availability
|
||||||
|
try:
|
||||||
|
result = subprocess.run(['pdm', 'list'], capture_output=True, text=True)
|
||||||
|
if 'pyinstaller' not in result.stdout.lower():
|
||||||
|
print('[ERROR] PyInstaller not found in PDM environment')
|
||||||
|
return False
|
||||||
|
print('[OK] PyInstaller available')
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
print('[ERROR] Failed to check PDM environment')
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def __enter__(self):
|
||||||
|
# Validate environment first
|
||||||
|
if not self.validate_environment():
|
||||||
|
print('[ERROR] Environment validation failed!')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
self.temp_dir = Path(tempfile.mkdtemp(prefix='nvda_voicemeeter_build_'))
|
||||||
|
print(f'Using temp directory: {self.temp_dir}')
|
||||||
|
return self
|
||||||
|
|
||||||
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
|
if self.temp_dir and self.temp_dir.exists():
|
||||||
|
shutil.rmtree(self.temp_dir)
|
||||||
|
print(f'Cleaned up temp directory: {self.temp_dir}')
|
||||||
|
|
||||||
|
def create_python_file(self, kind: str) -> Path:
|
||||||
|
"""Create a temporary Python launcher file."""
|
||||||
|
content = PYTHON_TEMPLATE.format(kind=kind)
|
||||||
|
|
||||||
|
py_file = self.temp_dir / f'{kind}.py'
|
||||||
|
with open(py_file, 'w') as f:
|
||||||
|
f.write(content)
|
||||||
|
|
||||||
|
return py_file
|
||||||
|
|
||||||
|
def create_spec_file(self, kind: str, py_file: Path) -> Path:
|
||||||
|
"""Create a temporary PyInstaller spec file."""
|
||||||
|
controller_x64_path = (self.base_dir / 'controllerClient' / 'x64').as_posix()
|
||||||
|
controller_x86_path = (self.base_dir / 'controllerClient' / 'x86').as_posix()
|
||||||
|
|
||||||
|
content = SPEC_TEMPLATE.format(
|
||||||
|
script_path=py_file.as_posix(),
|
||||||
|
controller_x64_path=controller_x64_path,
|
||||||
|
controller_x86_path=controller_x86_path,
|
||||||
|
kind=kind,
|
||||||
|
)
|
||||||
|
|
||||||
|
spec_file = self.temp_dir / f'{kind}.spec'
|
||||||
|
with open(spec_file, 'w') as f:
|
||||||
|
f.write(content)
|
||||||
|
|
||||||
|
return spec_file
|
||||||
|
|
||||||
|
def build_variant(self, kind: str) -> bool:
|
||||||
|
"""Build a single kind variant."""
|
||||||
|
print(f'Building {kind}...')
|
||||||
|
|
||||||
|
# Validate kind
|
||||||
|
if kind not in KINDS:
|
||||||
|
print(f'[ERROR] Unknown kind: {kind}. Valid kinds: {", ".join(KINDS)}')
|
||||||
|
return False
|
||||||
|
|
||||||
|
# Create temporary files
|
||||||
|
py_file = self.create_python_file(kind)
|
||||||
|
spec_file = self.create_spec_file(kind, py_file)
|
||||||
|
|
||||||
|
# Build with PyInstaller
|
||||||
|
dist_path = self.dist_dir / kind
|
||||||
|
pdm_bin = os.getenv('PDM_BIN', 'pdm')
|
||||||
|
cmd = [
|
||||||
|
pdm_bin,
|
||||||
|
'run',
|
||||||
|
'pyinstaller',
|
||||||
|
'--noconfirm',
|
||||||
|
'--distpath',
|
||||||
|
str(dist_path.parent),
|
||||||
|
str(spec_file),
|
||||||
|
]
|
||||||
|
|
||||||
|
try:
|
||||||
|
result = subprocess.run(cmd, cwd=self.base_dir, capture_output=True, text=True)
|
||||||
|
if result.returncode == 0:
|
||||||
|
print(f'[OK] Built {kind}')
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
print(f'[FAIL] Failed to build {kind}')
|
||||||
|
print(f'Error: {result.stderr}')
|
||||||
|
return False
|
||||||
|
except Exception as e:
|
||||||
|
print(f'[ERROR] Exception building {kind}: {e}')
|
||||||
|
return False
|
||||||
|
|
||||||
|
def build_all_kinds(self) -> Dict[str, bool]:
|
||||||
|
"""Build all kind variants."""
|
||||||
|
results = {}
|
||||||
|
|
||||||
|
for kind in KINDS:
|
||||||
|
success = self.build_variant(kind)
|
||||||
|
results[kind] = success
|
||||||
|
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Dynamic build system for nvda-voicemeeter')
|
||||||
|
parser.add_argument(
|
||||||
|
'kinds',
|
||||||
|
nargs='*',
|
||||||
|
choices=KINDS + ['all'],
|
||||||
|
help='Kinds to build (default: all)',
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--dist-dir',
|
||||||
|
type=Path,
|
||||||
|
default=Path('dist'),
|
||||||
|
help='Distribution output directory',
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if not args.kinds or 'all' in args.kinds:
|
||||||
|
kinds_to_build = KINDS
|
||||||
|
else:
|
||||||
|
kinds_to_build = args.kinds
|
||||||
|
|
||||||
|
base_dir = Path.cwd()
|
||||||
|
args.dist_dir.mkdir(exist_ok=True)
|
||||||
|
|
||||||
|
print(f'Building kinds: {", ".join(kinds_to_build)}')
|
||||||
|
|
||||||
|
all_results = {}
|
||||||
|
|
||||||
|
with DynamicBuilder(base_dir, args.dist_dir) as builder:
|
||||||
|
if 'all' in kinds_to_build or len(kinds_to_build) == len(KINDS):
|
||||||
|
# Build all kinds
|
||||||
|
results = builder.build_all_kinds()
|
||||||
|
all_results.update(results)
|
||||||
|
else:
|
||||||
|
# Build specific kinds
|
||||||
|
for kind in kinds_to_build:
|
||||||
|
success = builder.build_variant(kind)
|
||||||
|
all_results[kind] = success
|
||||||
|
|
||||||
|
# Report results
|
||||||
|
print('\n' + '=' * 50)
|
||||||
|
print('BUILD SUMMARY')
|
||||||
|
print('=' * 50)
|
||||||
|
|
||||||
|
success_count = 0
|
||||||
|
total_count = 0
|
||||||
|
|
||||||
|
for build_name, success in all_results.items():
|
||||||
|
status = '[OK]' if success else '[FAIL]'
|
||||||
|
print(f'{status} {build_name}')
|
||||||
|
if success:
|
||||||
|
success_count += 1
|
||||||
|
total_count += 1
|
||||||
|
|
||||||
|
print(f'\nSuccess: {success_count}/{total_count}')
|
||||||
|
|
||||||
|
if success_count == total_count:
|
||||||
|
print('All builds completed successfully!')
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
|
print('Some builds failed!')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
280
tools/spec_generator.py
Normal file
280
tools/spec_generator.py
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
PyInstaller spec file generator for nvda-voicemeeter project.
|
||||||
|
|
||||||
|
This script generates .spec files for different Voicemeeter kinds (basic, banana, potato).
|
||||||
|
Based on the existing spec file patterns in the spec/ directory.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
python tools/spec_generator.py [kind]
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
kind: The Voicemeeter kind to generate spec for (basic, banana, potato).
|
||||||
|
If not provided, generates all spec files.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
python tools/spec_generator.py basic
|
||||||
|
python tools/spec_generator.py
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
|
class SpecGenerator:
|
||||||
|
"""Generate PyInstaller spec files for nvda-voicemeeter project."""
|
||||||
|
|
||||||
|
# Supported Voicemeeter kinds
|
||||||
|
KINDS = ['basic', 'banana', 'potato']
|
||||||
|
|
||||||
|
def __init__(self, project_root: Path = None):
|
||||||
|
"""Initialize the spec generator.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
project_root: Path to the project root. If None, uses current directory.
|
||||||
|
"""
|
||||||
|
if project_root is None:
|
||||||
|
# Assume we're running from tools/ directory
|
||||||
|
project_root = Path(__file__).parent.parent
|
||||||
|
|
||||||
|
self.project_root = Path(project_root)
|
||||||
|
self.spec_dir = self.project_root / 'spec'
|
||||||
|
|
||||||
|
# Ensure spec directory exists
|
||||||
|
self.spec_dir.mkdir(exist_ok=True)
|
||||||
|
|
||||||
|
def generate_spec_template(self, kind: str) -> str:
|
||||||
|
"""Generate a PyInstaller spec file template for the given kind.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
kind: The Voicemeeter kind (basic, banana, potato).
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The generated spec file content as a string.
|
||||||
|
"""
|
||||||
|
if kind not in self.KINDS:
|
||||||
|
raise ValueError(f'Unsupported kind: {kind}. Supported kinds: {self.KINDS}')
|
||||||
|
|
||||||
|
template = f"""# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
block_cipher = None
|
||||||
|
|
||||||
|
added_files = [
|
||||||
|
( '../controllerClient/x64', 'controllerClient/x64' ),
|
||||||
|
( '../controllerClient/x86', 'controllerClient/x86' ),
|
||||||
|
]
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['{kind}.py'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=added_files,
|
||||||
|
hiddenimports=[],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={{}},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=block_cipher,
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
[],
|
||||||
|
exclude_binaries=True,
|
||||||
|
name='{kind}',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
)
|
||||||
|
coll = COLLECT(
|
||||||
|
exe,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
name='{kind}',
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
return template
|
||||||
|
|
||||||
|
def generate_entry_point(self, kind: str) -> str:
|
||||||
|
"""Generate a Python entry point script for the given kind.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
kind: The Voicemeeter kind (basic, banana, potato).
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The generated Python script content as a string.
|
||||||
|
"""
|
||||||
|
if kind not in self.KINDS:
|
||||||
|
raise ValueError(f'Unsupported kind: {kind}. Supported kinds: {self.KINDS}')
|
||||||
|
|
||||||
|
entry_point = f"""import voicemeeterlib
|
||||||
|
|
||||||
|
import nvda_voicemeeter
|
||||||
|
|
||||||
|
KIND_ID = '{kind}'
|
||||||
|
|
||||||
|
with voicemeeterlib.api(KIND_ID) as vm:
|
||||||
|
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
|
||||||
|
window.run()
|
||||||
|
"""
|
||||||
|
return entry_point
|
||||||
|
|
||||||
|
def write_spec_file(self, kind: str, overwrite: bool = False) -> Path:
|
||||||
|
"""Write a spec file for the given kind.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
kind: The Voicemeeter kind (basic, banana, potato).
|
||||||
|
overwrite: Whether to overwrite existing files.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Path to the created spec file.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
FileExistsError: If file exists and overwrite is False.
|
||||||
|
"""
|
||||||
|
spec_file = self.spec_dir / f'{kind}.spec'
|
||||||
|
entry_file = self.spec_dir / f'{kind}.py'
|
||||||
|
|
||||||
|
if spec_file.exists() and not overwrite:
|
||||||
|
raise FileExistsError(f'Spec file already exists: {spec_file}')
|
||||||
|
|
||||||
|
if entry_file.exists() and not overwrite:
|
||||||
|
raise FileExistsError(f'Entry point file already exists: {entry_file}')
|
||||||
|
|
||||||
|
# Write spec file
|
||||||
|
spec_content = self.generate_spec_template(kind)
|
||||||
|
spec_file.write_text(spec_content, encoding='utf-8')
|
||||||
|
print(f'Generated spec file: {spec_file}')
|
||||||
|
|
||||||
|
# Write entry point script
|
||||||
|
entry_content = self.generate_entry_point(kind)
|
||||||
|
entry_file.write_text(entry_content, encoding='utf-8')
|
||||||
|
print(f'Generated entry point: {entry_file}')
|
||||||
|
|
||||||
|
return spec_file
|
||||||
|
|
||||||
|
def generate_all_specs(self, overwrite: bool = False) -> List[Path]:
|
||||||
|
"""Generate spec files for all supported kinds.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
overwrite: Whether to overwrite existing files.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
List of paths to the created spec files.
|
||||||
|
"""
|
||||||
|
spec_files = []
|
||||||
|
for kind in self.KINDS:
|
||||||
|
try:
|
||||||
|
spec_file = self.write_spec_file(kind, overwrite=overwrite)
|
||||||
|
spec_files.append(spec_file)
|
||||||
|
except FileExistsError as e:
|
||||||
|
print(f'Skipped {kind}: {e}')
|
||||||
|
continue
|
||||||
|
|
||||||
|
return spec_files
|
||||||
|
|
||||||
|
def list_existing_specs(self) -> List[str]:
|
||||||
|
"""List existing spec files in the spec directory.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
List of existing spec file kinds.
|
||||||
|
"""
|
||||||
|
existing = []
|
||||||
|
for kind in self.KINDS:
|
||||||
|
spec_file = self.spec_dir / f'{kind}.spec'
|
||||||
|
if spec_file.exists():
|
||||||
|
existing.append(kind)
|
||||||
|
|
||||||
|
return existing
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Main entry point for the spec generator."""
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description='Generate PyInstaller spec files for nvda-voicemeeter project',
|
||||||
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||||
|
epilog="""
|
||||||
|
Examples:
|
||||||
|
python tools/spec_generator.py basic # Generate basic.spec
|
||||||
|
python tools/spec_generator.py # Generate all spec files
|
||||||
|
python tools/spec_generator.py --list # List existing spec files
|
||||||
|
python tools/spec_generator.py --force # Overwrite existing files
|
||||||
|
""",
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'kind',
|
||||||
|
nargs='?',
|
||||||
|
choices=SpecGenerator.KINDS,
|
||||||
|
help=f'Voicemeeter kind to generate spec for ({", ".join(SpecGenerator.KINDS)})',
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--force', '-f', action='store_true', help='Overwrite existing spec files')
|
||||||
|
|
||||||
|
parser.add_argument('--list', '-l', action='store_true', help='List existing spec files')
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'--project-root', type=Path, help='Path to project root (default: detect from script location)'
|
||||||
|
)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Initialize generator
|
||||||
|
generator = SpecGenerator(project_root=args.project_root)
|
||||||
|
|
||||||
|
# List existing files if requested
|
||||||
|
if args.list:
|
||||||
|
existing = generator.list_existing_specs()
|
||||||
|
if existing:
|
||||||
|
print('Existing spec files:')
|
||||||
|
for kind in existing:
|
||||||
|
spec_file = generator.spec_dir / f'{kind}.spec'
|
||||||
|
print(f' {kind}: {spec_file}')
|
||||||
|
else:
|
||||||
|
print('No existing spec files found.')
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
if args.kind:
|
||||||
|
# Generate specific kind
|
||||||
|
generator.write_spec_file(args.kind, overwrite=args.force)
|
||||||
|
print(f'Successfully generated spec for: {args.kind}')
|
||||||
|
else:
|
||||||
|
# Generate all kinds
|
||||||
|
spec_files = generator.generate_all_specs(overwrite=args.force)
|
||||||
|
if spec_files:
|
||||||
|
print(f'Successfully generated {len(spec_files)} spec files.')
|
||||||
|
else:
|
||||||
|
print('No spec files were generated (use --force to overwrite existing files).')
|
||||||
|
|
||||||
|
except ValueError as e:
|
||||||
|
print(f'Error: {e}')
|
||||||
|
return 1
|
||||||
|
except FileExistsError as e:
|
||||||
|
print(f'Error: {e}')
|
||||||
|
print('Use --force to overwrite existing files.')
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
exit(main())
|
||||||
Reference in New Issue
Block a user