mirror of
https://github.com/onyx-and-iris/nvda-addon-voicemeeter.git
synced 2025-04-19 20:13:46 +01:00
Compare commits
No commits in common. "51ccd76c2a7b606caabbb75d9e605197ca57ef88" and "770a7742a20ea0af1801a48de48897fd21fe8542" have entirely different histories.
51ccd76c2a
...
770a7742a2
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"python.analysis.diagnosticSeverityOverrides": {
|
"python.analysis.diagnosticSeverityOverrides": {
|
||||||
"reportMissingImports": "none"
|
"reportMissingImports": "none"
|
||||||
}
|
},
|
||||||
|
"black-formatter.args": [
|
||||||
|
"--line-length=120"
|
||||||
|
]
|
||||||
}
|
}
|
@ -14,11 +14,11 @@ def _make_gestures():
|
|||||||
defaults = {
|
defaults = {
|
||||||
"kb:NVDA+alt+s": "strip_mode",
|
"kb:NVDA+alt+s": "strip_mode",
|
||||||
"kb:NVDA+alt+b": "bus_mode",
|
"kb:NVDA+alt+b": "bus_mode",
|
||||||
"kb:NVDA+alt+g": "slider_mode", # Gate
|
"kb:NVDA+alt+g": "slider_mode",
|
||||||
"kb:NVDA+alt+c": "slider_mode", # Comp
|
"kb:NVDA+alt+c": "slider_mode",
|
||||||
"kb:NVDA+alt+t": "slider_mode", # Gate
|
"kb:NVDA+alt+t": "slider_mode",
|
||||||
"kb:NVDA+alt+d": "slider_mode", # Denoiser
|
"kb:NVDA+alt+d": "slider_mode",
|
||||||
"kb:NVDA+alt+a": "slider_mode", # Audibility
|
"kb:NVDA+alt+a": "slider_mode",
|
||||||
"kb:NVDA+shift+q": "announce_controller",
|
"kb:NVDA+shift+q": "announce_controller",
|
||||||
"kb:NVDA+shift+a": "announce_voicemeeter_version",
|
"kb:NVDA+shift+a": "announce_voicemeeter_version",
|
||||||
"kb:NVDA+shift+o": "toggle_mono",
|
"kb:NVDA+shift+o": "toggle_mono",
|
||||||
|
@ -22,10 +22,6 @@ class Binds:
|
|||||||
bind_get_voicemeeter_type.restype = LONG
|
bind_get_voicemeeter_type.restype = LONG
|
||||||
bind_get_voicemeeter_type.argtypes = [ct.POINTER(LONG)]
|
bind_get_voicemeeter_type.argtypes = [ct.POINTER(LONG)]
|
||||||
|
|
||||||
bind_get_voicemeeter_version = libc.VBVMR_GetVoicemeeterVersion
|
|
||||||
bind_get_voicemeeter_version.restype = LONG
|
|
||||||
bind_get_voicemeeter_version.argtypes = [ct.POINTER(LONG)]
|
|
||||||
|
|
||||||
bind_is_parameters_dirty = libc.VBVMR_IsParametersDirty
|
bind_is_parameters_dirty = libc.VBVMR_IsParametersDirty
|
||||||
bind_is_parameters_dirty.restype = LONG
|
bind_is_parameters_dirty.restype = LONG
|
||||||
bind_is_parameters_dirty.argtypes = None
|
bind_is_parameters_dirty.argtypes = None
|
||||||
|
@ -35,7 +35,7 @@ def get_vmpath():
|
|||||||
try:
|
try:
|
||||||
vm_parent = Path(get_vmpath()).parent
|
vm_parent = Path(get_vmpath()).parent
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError as e:
|
||||||
raise VMError("Unable to fetch DLL path from the registry") from e
|
raise VMError(f"Unable to fetch DLL path from the registry") from e
|
||||||
|
|
||||||
DLL_NAME = f'VoicemeeterRemote{"64" if BITS == 64 else ""}.dll'
|
DLL_NAME = f'VoicemeeterRemote{"64" if BITS == 64 else ""}.dll'
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ class CommandsMixin:
|
|||||||
### ANNOUNCEMENTS ###
|
### ANNOUNCEMENTS ###
|
||||||
|
|
||||||
def script_announce_voicemeeter_version(self, _):
|
def script_announce_voicemeeter_version(self, _):
|
||||||
ui.message(f"Running Voicemeeter {self.kind} {self.controller.version}")
|
ui.message(f"Running Voicemeeter {self.kind}")
|
||||||
|
|
||||||
def script_announce_controller(self, _):
|
def script_announce_controller(self, _):
|
||||||
ui.message(f"Controller for {self.controller.ctx.strategy} {self.controller.ctx.index + 1}")
|
ui.message(f"Controller for {self.controller.ctx.strategy} {self.controller.ctx.index + 1}")
|
||||||
|
@ -8,9 +8,13 @@ class Strategy(ABC):
|
|||||||
self._slider_mode = "gain"
|
self._slider_mode = "gain"
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def identifier(self):
|
def __str__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@property
|
||||||
|
def identifier(self):
|
||||||
|
return f"{self}[{self._index}]"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def index(self):
|
def index(self):
|
||||||
return self._index
|
return self._index
|
||||||
@ -50,19 +54,11 @@ class StripStrategy(Strategy):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Strip"
|
return "Strip"
|
||||||
|
|
||||||
@property
|
|
||||||
def identifier(self):
|
|
||||||
return f"{self}[{self._index}]"
|
|
||||||
|
|
||||||
|
|
||||||
class BusStrategy(Strategy):
|
class BusStrategy(Strategy):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Bus"
|
return "Bus"
|
||||||
|
|
||||||
@property
|
|
||||||
def identifier(self):
|
|
||||||
return f"{self}[{self._index}]"
|
|
||||||
|
|
||||||
|
|
||||||
class Context:
|
class Context:
|
||||||
def __init__(self, strategy: Strategy) -> None:
|
def __init__(self, strategy: Strategy) -> None:
|
||||||
|
@ -27,17 +27,6 @@ class Controller(Binds):
|
|||||||
self.call(self.bind_get_voicemeeter_type, ct.byref(c_type))
|
self.call(self.bind_get_voicemeeter_type, ct.byref(c_type))
|
||||||
return KindId(c_type.value).name.lower()
|
return KindId(c_type.value).name.lower()
|
||||||
|
|
||||||
@property
|
|
||||||
def version(self):
|
|
||||||
ver = ct.c_long()
|
|
||||||
self.call(self.bind_get_voicemeeter_version, ct.byref(ver))
|
|
||||||
return "{}.{}.{}.{}".format(
|
|
||||||
(ver.value & 0xFF000000) >> 24,
|
|
||||||
(ver.value & 0x00FF0000) >> 16,
|
|
||||||
(ver.value & 0x0000FF00) >> 8,
|
|
||||||
ver.value & 0x000000FF,
|
|
||||||
)
|
|
||||||
|
|
||||||
def run_voicemeeter(self, kind_id):
|
def run_voicemeeter(self, kind_id):
|
||||||
val = kind_id.value
|
val = kind_id.value
|
||||||
if val == 3 and BITS == 64:
|
if val == 3 and BITS == 64:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
class VMError(Exception):
|
class VMError(Exception):
|
||||||
"""Base voicemeeterlib exception class"""
|
"""Base voicemeeterlib exception class."""
|
||||||
|
|
||||||
|
|
||||||
class VMCAPIError(VMError):
|
class VMCAPIError(VMError):
|
||||||
|
@ -4,8 +4,8 @@ param(
|
|||||||
|
|
||||||
function Copy-FilestoScratchpad {
|
function Copy-FilestoScratchpad {
|
||||||
$source = Join-Path $PSScriptRoot "addon" "globalPlugins" "voicemeeter"
|
$source = Join-Path $PSScriptRoot "addon" "globalPlugins" "voicemeeter"
|
||||||
$target = Join-Path $env:appdata "nvda" "scratchpad" "globalPlugins" "voicemeeter"
|
$target = Join-Path $env:appdata "nvda" "scratchpad" "globalPlugins"
|
||||||
Robocopy $source $target /MIR /NFL /NDL /NJH /NJS /nc /ns /np
|
Copy-Item -Path $source -Destination $target -Recurse -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
function main {
|
function main {
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
[tool.black]
|
|
||||||
line-length = 119
|
|
||||||
|
|
||||||
[tool.ruff]
|
|
||||||
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
|
|
||||||
select = ["E", "F"]
|
|
||||||
# Avoid enforcing line-length violations (`E501`). Let Black deal with this.
|
|
||||||
ignore = ["E501"]
|
|
||||||
# Allow autofix for all enabled rules (when `--fix`) is provided.
|
|
||||||
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
|
|
||||||
unfixable = []
|
|
||||||
# Exclude a variety of commonly ignored directories.
|
|
||||||
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",
|
|
||||||
]
|
|
||||||
# Same as Black.
|
|
||||||
line-length = 119
|
|
||||||
# Allow unused variables when underscore-prefixed.
|
|
||||||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
|
||||||
# Assume Python 3.7
|
|
||||||
target-version = "py37"
|
|
||||||
[tool.ruff.mccabe]
|
|
||||||
# Unlike Flake8, default to a complexity level of 10.
|
|
||||||
max-complexity = 10
|
|
||||||
[tool.ruff.per-file-ignores]
|
|
||||||
"__init__.py" = ["E402", "F401"] # Ignore unused import and variable not accessed violations
|
|
Loading…
x
Reference in New Issue
Block a user