mirror of
https://github.com/onyx-and-iris/nvda-addon-voicemeeter.git
synced 2026-03-30 00:19:10 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 99b8d0e45c | |||
| f8fc84b2be | |||
| 87d0d6541d | |||
| 6c9e4b1a89 |
@ -2,6 +2,11 @@ repos:
|
|||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.3.0
|
rev: v4.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-ast
|
|
||||||
- id: check-case-conflict
|
|
||||||
- id: check-yaml
|
- 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
|
||||||
|
|||||||
59
README.md
59
README.md
@ -15,27 +15,27 @@ This addon can be installed through the Add-on store, `Install from external sou
|
|||||||
|
|
||||||
## Default Keybinds
|
## Default Keybinds
|
||||||
|
|
||||||
### Controllers
|
### Channel Controllers
|
||||||
|
|
||||||
- `NVDA+alt+s`: Enable strip mode
|
- `NVDA+alt+s`: Enable strip controller
|
||||||
- `NVDA+alt+b`: Enable bus mode.
|
- `NVDA+alt+b`: Enable bus controller.
|
||||||
|
|
||||||
- `NVDA+alt+1`: Enable controller for channel 1 (strip|bus)
|
- `NVDA+alt+1`: Enable controller index 1 (strip|bus)
|
||||||
- `NVDA+alt+2`: Enable controller for channel 2 (strip|bus)
|
- `NVDA+alt+2`: Enable controller index 2 (strip|bus)
|
||||||
- `NVDA+alt+3`: Enable controller for channel 3 (strip|bus)
|
- `NVDA+alt+3`: Enable controller index 3 (strip|bus)
|
||||||
- `NVDA+alt+4`: Enable controller for channel 4 (strip|bus)
|
- `NVDA+alt+4`: Enable controller index 4 (strip|bus)
|
||||||
- `NVDA+alt+5`: Enable controller for channel 5 (strip|bus)
|
- `NVDA+alt+5`: Enable controller index 5 (strip|bus)
|
||||||
- `NVDA+alt+6`: Enable controller for channel 6 (strip|bus)
|
- `NVDA+alt+6`: Enable controller index 6 (strip|bus)
|
||||||
- `NVDA+alt+7`: Enable controller for channel 7 (strip|bus)
|
- `NVDA+alt+7`: Enable controller index 7 (strip|bus)
|
||||||
- `NVDA+alt+8`: Enable controller for channel 8 (strip|bus)
|
- `NVDA+alt+8`: Enable controller index 8 (strip|bus)
|
||||||
|
|
||||||
### Slider Modes
|
### Slider Controllers
|
||||||
|
|
||||||
- `NVDA+alt+g`: Enable gain slider mode.
|
- `NVDA+alt+g`: Enable gain slider controller.
|
||||||
- `NVDA+alt+c`: Enable comp slider mode.
|
- `NVDA+alt+c`: Enable comp slider controller.
|
||||||
- `NVDA+alt+t`: Enable gate slider mode.
|
- `NVDA+alt+t`: Enable gate slider controller.
|
||||||
- `NVDA+alt+d`: Enable denoiser slider mode.
|
- `NVDA+alt+d`: Enable denoiser slider controller.
|
||||||
- `NVDA+alt+a`: Enable audibility slider mode.
|
- `NVDA+alt+a`: Enable audibility slider controller.
|
||||||
|
|
||||||
### Sliders
|
### Sliders
|
||||||
|
|
||||||
@ -53,22 +53,24 @@ This addon can be installed through the Add-on store, `Install from external sou
|
|||||||
- `NVDA+shift+m`: Mute
|
- `NVDA+shift+m`: Mute
|
||||||
- `NVDA+shift+c`: MC
|
- `NVDA+shift+c`: MC
|
||||||
- `NVDA+shift+k`: Karaoke
|
- `NVDA+shift+k`: Karaoke
|
||||||
|
- `NVDA+shift+n`: Next Bus Mode
|
||||||
|
- `NVDA+shift+p`: Previous Bus Mode
|
||||||
|
|
||||||
### Bus Assignments (A1-A5|B1-B3)
|
### Bus Assignments (A1-A5|B1-B3)
|
||||||
|
|
||||||
- `NVDA+shift+1`: Toggle BUS assignment 1 for a strip
|
- `NVDA+shift+1`: Toggle BUS assignment 1
|
||||||
- `NVDA+shift+2`: Toggle BUS assignment 2 for a strip
|
- `NVDA+shift+2`: Toggle BUS assignment 2
|
||||||
- `NVDA+shift+3`: Toggle BUS assignment 3 for a strip
|
- `NVDA+shift+3`: Toggle BUS assignment 3
|
||||||
- `NVDA+shift+4`: Toggle BUS assignment 4 for a strip
|
- `NVDA+shift+4`: Toggle BUS assignment 4
|
||||||
- `NVDA+shift+5`: Toggle BUS assignment 5 for a strip
|
- `NVDA+shift+5`: Toggle BUS assignment 5
|
||||||
- `NVDA+shift+6`: Toggle BUS assignment 6 for a strip
|
- `NVDA+shift+6`: Toggle BUS assignment 6
|
||||||
- `NVDA+shift+7`: Toggle BUS assignment 7 for a strip
|
- `NVDA+shift+7`: Toggle BUS assignment 7
|
||||||
- `NVDA+shift+8`: Toggle BUS assignment 8 for a strip
|
- `NVDA+shift+8`: Toggle BUS assignment 8
|
||||||
|
|
||||||
### Announcements
|
### Announcements
|
||||||
|
|
||||||
- `NVDA+shift+q`: Announce current controller.
|
- `NVDA+shift+q`: Announce current controller.
|
||||||
- `NVDA+shift+a`: Announce Voicemeeter kind.
|
- `NVDA+shift+a`: Announce Voicemeeter kind and version.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@ -96,10 +98,13 @@ example:
|
|||||||
"NVDA+alt+a": "audibility_mode",
|
"NVDA+alt+a": "audibility_mode",
|
||||||
"NVDA+shift+q": "announce_controller",
|
"NVDA+shift+q": "announce_controller",
|
||||||
"NVDA+shift+z": "announce_voicemeeter_version",
|
"NVDA+shift+z": "announce_voicemeeter_version",
|
||||||
|
"NVDA+shift+o": "rotate_mono",
|
||||||
"NVDA+shift+s": "toggle_solo",
|
"NVDA+shift+s": "toggle_solo",
|
||||||
"NVDA+shift+m": "toggle_mute",
|
"NVDA+shift+m": "toggle_mute",
|
||||||
"NVDA+shift+c": "toggle_mc",
|
"NVDA+shift+c": "toggle_mc",
|
||||||
"NVDA+shift+k": "karaoke",
|
"NVDA+shift+k": "rotate_karaoke",
|
||||||
|
"NVDA+shift+n": "rotate_bus_mode_next",
|
||||||
|
"NVDA+shift+p": "rotate_bus_mode_previous",
|
||||||
"NVDA+shift+upArrow": "slider_increase_by_point_one",
|
"NVDA+shift+upArrow": "slider_increase_by_point_one",
|
||||||
"NVDA+shift+downArrow": "slider_decrease_by_point_one",
|
"NVDA+shift+downArrow": "slider_decrease_by_point_one",
|
||||||
"NVDA+shift+alt+upArrow": "slider_increase_by_one",
|
"NVDA+shift+alt+upArrow": "slider_increase_by_one",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import ui
|
import ui
|
||||||
from logHandler import log
|
from logHandler import log
|
||||||
|
|
||||||
from . import context
|
from . import context, util
|
||||||
|
|
||||||
|
|
||||||
class CommandsMixin:
|
class CommandsMixin:
|
||||||
@ -56,7 +56,7 @@ class CommandsMixin:
|
|||||||
def script_audibility_mode(self, _):
|
def script_audibility_mode(self, _):
|
||||||
self.__set_slider_mode('audibility')
|
self.__set_slider_mode('audibility')
|
||||||
|
|
||||||
# Mono is a special case because the parameter is a boolean for strips and an int for buses
|
### STRIP|BUS PARAMETERS ###
|
||||||
|
|
||||||
def script_rotate_mono(self, _):
|
def script_rotate_mono(self, _):
|
||||||
if isinstance(self.controller.ctx.strategy, context.StripStrategy):
|
if isinstance(self.controller.ctx.strategy, context.StripStrategy):
|
||||||
@ -70,7 +70,12 @@ class CommandsMixin:
|
|||||||
self.controller.ctx.set_int('mono', new_val)
|
self.controller.ctx.set_int('mono', new_val)
|
||||||
ui.message(opts[new_val])
|
ui.message(opts[new_val])
|
||||||
|
|
||||||
### BOOLEAN PARAMETERS ###
|
def script_toggle_mute(self, _):
|
||||||
|
val = not self.controller.ctx.get_bool('mute')
|
||||||
|
self.controller.ctx.set_bool('mute', val)
|
||||||
|
ui.message('on' if val else 'off')
|
||||||
|
|
||||||
|
### STRIP PARAMETERS ###
|
||||||
|
|
||||||
def script_toggle_solo(self, _):
|
def script_toggle_solo(self, _):
|
||||||
if not isinstance(self.controller.ctx.strategy, context.StripStrategy):
|
if not isinstance(self.controller.ctx.strategy, context.StripStrategy):
|
||||||
@ -81,11 +86,6 @@ class CommandsMixin:
|
|||||||
self.controller.ctx.set_bool('solo', val)
|
self.controller.ctx.set_bool('solo', val)
|
||||||
ui.message('on' if val else 'off')
|
ui.message('on' if val else 'off')
|
||||||
|
|
||||||
def script_toggle_mute(self, _):
|
|
||||||
val = not self.controller.ctx.get_bool('mute')
|
|
||||||
self.controller.ctx.set_bool('mute', val)
|
|
||||||
ui.message('on' if val else 'off')
|
|
||||||
|
|
||||||
def script_toggle_mc(self, _):
|
def script_toggle_mc(self, _):
|
||||||
if not isinstance(self.controller.ctx.strategy, context.StripStrategy):
|
if not isinstance(self.controller.ctx.strategy, context.StripStrategy):
|
||||||
ui.message('MC only available for strips')
|
ui.message('MC only available for strips')
|
||||||
@ -110,7 +110,7 @@ class CommandsMixin:
|
|||||||
self.controller.ctx.set_bool('mc', val)
|
self.controller.ctx.set_bool('mc', val)
|
||||||
ui.message('on' if val else 'off')
|
ui.message('on' if val else 'off')
|
||||||
|
|
||||||
def script_karaoke(self, _):
|
def script_rotate_karaoke(self, _):
|
||||||
if not isinstance(self.controller.ctx.strategy, context.StripStrategy):
|
if not isinstance(self.controller.ctx.strategy, context.StripStrategy):
|
||||||
ui.message('Karaoke mode only available for strips')
|
ui.message('Karaoke mode only available for strips')
|
||||||
return
|
return
|
||||||
@ -152,34 +152,76 @@ class CommandsMixin:
|
|||||||
self.controller.ctx.set_bool(output, val)
|
self.controller.ctx.set_bool(output, val)
|
||||||
ui.message('on' if val else 'off')
|
ui.message('on' if val else 'off')
|
||||||
|
|
||||||
|
### BUS PARAMETERS ###
|
||||||
|
|
||||||
|
def script_rotate_bus_mode_next(self, _):
|
||||||
|
if not isinstance(self.controller.ctx.strategy, context.BusStrategy):
|
||||||
|
ui.message('Bus mode only available for buses')
|
||||||
|
return
|
||||||
|
|
||||||
|
opts = util._get_bus_mode_opts(self.kind.name)
|
||||||
|
for mode in opts:
|
||||||
|
if self.controller.ctx.get_bool(f'mode.{mode}'):
|
||||||
|
current_mode = mode
|
||||||
|
log.info(f'INFO - bus {self.controller.ctx.index} current mode {current_mode}')
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
log.warning(f'WARNING - no bus mode found for bus {self.controller.ctx.index}')
|
||||||
|
return
|
||||||
|
|
||||||
|
new_val = (opts.index(current_mode) + 1) % len(opts)
|
||||||
|
log.info(f'INFO - bus {self.controller.ctx.index} mode {opts[new_val]}')
|
||||||
|
self.controller.ctx.set_bool(f'mode.{opts[new_val]}', True)
|
||||||
|
ui.message(util._get_bus_mode_readable_name(opts[new_val]))
|
||||||
|
|
||||||
|
def script_rotate_bus_mode_previous(self, _):
|
||||||
|
if not isinstance(self.controller.ctx.strategy, context.BusStrategy):
|
||||||
|
ui.message('Bus mode only available for buses')
|
||||||
|
return
|
||||||
|
|
||||||
|
opts = util._get_bus_mode_opts(self.kind.name)
|
||||||
|
for mode in opts:
|
||||||
|
if self.controller.ctx.get_bool(f'mode.{mode}'):
|
||||||
|
current_mode = mode
|
||||||
|
log.info(f'INFO - bus {self.controller.ctx.index} current mode {current_mode}')
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
log.warning(f'WARNING - no bus mode found for bus {self.controller.ctx.index}')
|
||||||
|
return
|
||||||
|
|
||||||
|
new_val = (opts.index(current_mode) - 1) % len(opts)
|
||||||
|
log.info(f'INFO - bus {self.controller.ctx.index} mode {opts[new_val]}')
|
||||||
|
self.controller.ctx.set_bool(f'mode.{opts[new_val]}', True)
|
||||||
|
ui.message(util._get_bus_mode_readable_name(opts[new_val]))
|
||||||
|
|
||||||
### CONTROL SLIDERS ###
|
### CONTROL SLIDERS ###
|
||||||
|
|
||||||
def script_slider_increase_by_point_one(self, gesture):
|
def script_slider_increase_by_point_one(self, _):
|
||||||
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) + 0.1
|
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) + 0.1
|
||||||
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
||||||
ui.message(str(round(val, 1)))
|
ui.message(str(round(val, 1)))
|
||||||
|
|
||||||
def script_slider_decrease_by_point_one(self, gesture):
|
def script_slider_decrease_by_point_one(self, _):
|
||||||
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) - 0.1
|
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) - 0.1
|
||||||
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
||||||
ui.message(str(round(val, 1)))
|
ui.message(str(round(val, 1)))
|
||||||
|
|
||||||
def script_slider_increase_by_one(self, gesture):
|
def script_slider_increase_by_one(self, _):
|
||||||
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) + 1
|
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) + 1
|
||||||
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
||||||
ui.message(str(round(val, 1)))
|
ui.message(str(round(val, 1)))
|
||||||
|
|
||||||
def script_slider_decrease_by_one(self, gesture):
|
def script_slider_decrease_by_one(self, _):
|
||||||
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) - 1
|
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) - 1
|
||||||
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
||||||
ui.message(str(round(val, 1)))
|
ui.message(str(round(val, 1)))
|
||||||
|
|
||||||
def script_slider_increase_by_three(self, gesture):
|
def script_slider_increase_by_three(self, _):
|
||||||
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) + 3
|
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) + 3
|
||||||
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
||||||
ui.message(str(round(val, 1)))
|
ui.message(str(round(val, 1)))
|
||||||
|
|
||||||
def script_slider_decrease_by_three(self, gesture):
|
def script_slider_decrease_by_three(self, _):
|
||||||
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) - 3
|
val = self.controller.ctx.get_float(self.controller.ctx.slider_mode) - 3
|
||||||
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
self.controller.ctx.set_float(self.controller.ctx.slider_mode, val)
|
||||||
ui.message(str(round(val, 1)))
|
ui.message(str(round(val, 1)))
|
||||||
|
|||||||
@ -92,20 +92,6 @@ class Context:
|
|||||||
def slider_mode(self, val):
|
def slider_mode(self, val):
|
||||||
self._strategy._slider_mode = val
|
self._strategy._slider_mode = val
|
||||||
|
|
||||||
def get_bool(self, *args) -> bool:
|
def __getattr__(self, name):
|
||||||
return self._strategy.get_bool(*args)
|
"""Delegate method calls to the strategy object."""
|
||||||
|
return getattr(self._strategy, name)
|
||||||
def set_bool(self, *args):
|
|
||||||
self._strategy.set_bool(*args)
|
|
||||||
|
|
||||||
def get_float(self, *args) -> float:
|
|
||||||
return self._strategy.get_float(*args)
|
|
||||||
|
|
||||||
def set_float(self, *args):
|
|
||||||
self._strategy.set_float(*args)
|
|
||||||
|
|
||||||
def get_int(self, *args) -> int:
|
|
||||||
return self._strategy.get_int(*args)
|
|
||||||
|
|
||||||
def set_int(self, *args):
|
|
||||||
self._strategy.set_int(*args)
|
|
||||||
|
|||||||
@ -30,7 +30,9 @@ def _make_gestures(kind_id):
|
|||||||
'kb:NVDA+shift+s': 'toggle_solo',
|
'kb:NVDA+shift+s': 'toggle_solo',
|
||||||
'kb:NVDA+shift+m': 'toggle_mute',
|
'kb:NVDA+shift+m': 'toggle_mute',
|
||||||
'kb:NVDA+shift+c': 'toggle_mc',
|
'kb:NVDA+shift+c': 'toggle_mc',
|
||||||
'kb:NVDA+shift+k': 'karaoke',
|
'kb:NVDA+shift+k': 'rotate_karaoke',
|
||||||
|
'kb:NVDA+shift+n': 'rotate_bus_mode_next',
|
||||||
|
'kb:NVDA+shift+p': 'rotate_bus_mode_previous',
|
||||||
'kb:NVDA+shift+upArrow': 'slider_increase_by_point_one',
|
'kb:NVDA+shift+upArrow': 'slider_increase_by_point_one',
|
||||||
'kb:NVDA+shift+downArrow': 'slider_decrease_by_point_one',
|
'kb:NVDA+shift+downArrow': 'slider_decrease_by_point_one',
|
||||||
'kb:NVDA+shift+alt+upArrow': 'slider_increase_by_one',
|
'kb:NVDA+shift+alt+upArrow': 'slider_increase_by_one',
|
||||||
@ -49,3 +51,47 @@ def _make_gestures(kind_id):
|
|||||||
defaults = {k: v for k, v in defaults.items() if v not in matching_values}
|
defaults = {k: v for k, v in defaults.items() if v not in matching_values}
|
||||||
return {**defaults, **overrides}
|
return {**defaults, **overrides}
|
||||||
return defaults
|
return defaults
|
||||||
|
|
||||||
|
|
||||||
|
_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',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _get_bus_mode_opts(kind_id):
|
||||||
|
if kind_id == 'basic':
|
||||||
|
return [
|
||||||
|
'normal',
|
||||||
|
'amix',
|
||||||
|
'repeat',
|
||||||
|
'composite',
|
||||||
|
]
|
||||||
|
return [
|
||||||
|
'normal',
|
||||||
|
'amix',
|
||||||
|
'bmix',
|
||||||
|
'repeat',
|
||||||
|
'composite',
|
||||||
|
'tvmix',
|
||||||
|
'upmix21',
|
||||||
|
'upmix41',
|
||||||
|
'upmix61',
|
||||||
|
'centeronly',
|
||||||
|
'lfeonly',
|
||||||
|
'rearonly',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def _get_bus_mode_readable_name(mode):
|
||||||
|
return _bus_mode_map.get(mode, mode)
|
||||||
|
|||||||
@ -28,7 +28,7 @@ addon_info = {
|
|||||||
The add-on requires Voicemeeter to be installed."""
|
The add-on requires Voicemeeter to be installed."""
|
||||||
),
|
),
|
||||||
# version
|
# version
|
||||||
'addon_version': '1.2.1',
|
'addon_version': '1.3.0',
|
||||||
# Author(s)
|
# Author(s)
|
||||||
'addon_author': 'onyx-and-iris <code@onyxandiris.online>',
|
'addon_author': 'onyx-and-iris <code@onyxandiris.online>',
|
||||||
# URL for the add-on documentation support
|
# URL for the add-on documentation support
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "nvda-addon-voicemeeter"
|
name = "nvda-addon-voicemeeter"
|
||||||
version = "1.2.1"
|
version = "1.3.0"
|
||||||
description = "A GUI-less NVDA Addon for Voicemeeter using the Remote API"
|
description = "A GUI-less NVDA Addon for Voicemeeter using the Remote API"
|
||||||
authors = [{ name = "Onyx and Iris", email = "code@onyxandiris.online" }]
|
authors = [{ name = "Onyx and Iris", email = "code@onyxandiris.online" }]
|
||||||
dependencies = []
|
dependencies = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user