Compare commits

...

6 Commits

Author SHA1 Message Date
a19aab3936 closes #10
minor bump
2023-09-20 16:58:33 +01:00
7134b6d209 adds alt + number in quick binds to readme 2023-09-20 16:51:40 +01:00
1525710d31 upd readme image 2023-09-20 16:29:52 +01:00
2745e2c41a refactor slider mode binds 2023-09-20 16:29:42 +01:00
8716149eda fixes attribute error 2023-09-20 13:07:04 +01:00
dde940938f sync not required. using callbacks. 2023-09-20 11:34:06 +01:00
6 changed files with 60 additions and 53 deletions

View File

@ -8,7 +8,7 @@ A remote control app for [Voicemeeter][voicemeeter], designed to be used with th
For an outline of this projects goals see the [SPECIFICATION][spec].
<img src="./img/settings.png" width=350 alt="Image of Voicemeeter NVDA app settings tab">
<img src="./img/nvda-voicemeeter.png" width=960 alt="Image of Voicemeeter NVDA app settings tab">
## Requirements
@ -57,7 +57,7 @@ import nvda_voicemeeter
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:
window.run()
```
@ -94,7 +94,17 @@ To adjust Patch Asio Inputs to Strips and Patch Insert values use `UP` and `DOWN
To access Advanced Settings you may press the Advanced Settings button or use `Control + A` when in the `Settings` tab.
#### `Strip/Bus`
#### `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 rename a strip/bus channel navigate to the relevant tab, then press `F2`. This will open a popup window where you can set the channel index (with a spinbox) and set the new label using a text input box.
@ -114,6 +124,30 @@ The `Save Settings` option opens a popup window with two buttons, `Browse` and `
`Load Settings` and `Load on Startup` both open an Open dialog box immediately.
### `Quick access binds`
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
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.

View File

@ -4,6 +4,6 @@ import nvda_voicemeeter
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:
window.run()

BIN
img/nvda-voicemeeter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 KiB

View File

@ -1,6 +1,6 @@
[project]
name = "nvda_voicemeeter"
version = "0.2.2a1"
version = "0.3.0"
description = "A Voicemeeter app compatible with NVDA"
authors = [
{ name = "onyx-and-iris", email = "code@onyxandiris.online" },

View File

@ -135,7 +135,7 @@ class Popup:
self.logger.debug(f"values::{values}")
if event in (psg.WIN_CLOSED, "Exit"):
break
match parsed_cmd := self.parser.match.parseString(event):
match parsed_cmd := self.window.parser.match.parseString(event):
case ["BUFFER MME" | "BUFFER WDM" | "BUFFER KS" | "BUFFER ASIO"]:
if values[event] == "Default":
if "MME" in event:
@ -147,10 +147,12 @@ class Popup:
else:
val = int(values[event])
driver = event.split()[1]
self.vm.set(f"option.buffer.{driver.lower()}", val)
self.TKroot.after(200, self.window.nvda.speak, f"{driver} BUFFER {val if val else 'default'}")
self.window.vm.set(f"option.buffer.{driver.lower()}", val)
self.window.TKroot.after(
200, self.window.nvda.speak, f"{driver} BUFFER {val if val else 'default'}"
)
case [["BUFFER", driver], ["FOCUS", "IN"]]:
val = int(self.vm.get(f"option.buffer.{driver.lower()}"))
val = int(self.window.vm.get(f"option.buffer.{driver.lower()}"))
self.window.nvda.speak(f"{driver} BUFFER {val if val else 'default'}")
case [["BUFFER", driver], ["KEY", "SPACE" | "ENTER"]]:
util.open_context_menu_for_buttonmenu(popup, f"BUFFER {driver}")

View File

@ -372,54 +372,22 @@ class NVDAVMWindow(psg.Window):
if focus := self.find_element_with_focus():
identifier, param = focus.Key.split("||")
self.write_event_value(f"{identifier}||MUTE", None)
case ["SLIDER-MODE-LEFT"]:
case [
"SLIDER-MODE-LEFT"
| "SLIDER-MODE-RIGHT"
| "SLIDER-MODE-SHIFT-LEFT"
| "SLIDER-MODE-SHIFT-RIGHT"
| "SLIDER-MODE-CTRL-LEFT"
| "SLIDER-MODE-CTRL-RIGHT" as op
]:
op = op.removeprefix("SLIDER-MODE-").split("-")
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
continue
param = values[event]
if focus := self.find_element_with_focus():
identifier, partial = focus.Key.split("||")
if "SLIDER" not in partial:
self.write_event_value(f"{identifier}||SLIDER {param}||KEY LEFT", None)
case ["SLIDER-MODE-RIGHT"]:
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
continue
param = values[event]
if focus := self.find_element_with_focus():
identifier, partial = focus.Key.split("||")
if "SLIDER" not in partial:
self.write_event_value(f"{identifier}||SLIDER {param}||KEY RIGHT", None)
case ["SLIDER-MODE-SHIFT-LEFT"]:
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
continue
param = values[event]
if focus := self.find_element_with_focus():
identifier, partial = focus.Key.split("||")
if "SLIDER" not in partial:
self.write_event_value(f"{identifier}||SLIDER {param}||KEY SHIFT LEFT", None)
case ["SLIDER-MODE-SHIFT-RIGHT"]:
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
continue
param = values[event]
if focus := self.find_element_with_focus():
identifier, partial = focus.Key.split("||")
if "SLIDER" not in partial:
self.write_event_value(f"{identifier}||SLIDER {param}||KEY SHIFT RIGHT", None)
case ["SLIDER-MODE-CTRL-LEFT"]:
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
continue
param = values[event]
if focus := self.find_element_with_focus():
identifier, partial = focus.Key.split("||")
if "SLIDER" not in partial:
self.write_event_value(f"{identifier}||SLIDER {param}||KEY CTRL LEFT", None)
case ["SLIDER-MODE-CTRL-RIGHT"]:
if values["tabgroup"] not in ("tab||Physical Strip", "tab||Virtual Strip", "tab||Buses"):
continue
param = values[event]
if focus := self.find_element_with_focus():
identifier, partial = focus.Key.split("||")
if "SLIDER" not in partial:
self.write_event_value(f"{identifier}||SLIDER {param}||KEY CTRL RIGHT", None)
self.write_event_value(f"{identifier}||SLIDER {param}||KEY {' '.join(op)}", None)
# Rename popups
case ["F2:113"]:
@ -1023,8 +991,10 @@ class NVDAVMWindow(psg.Window):
val += 1
case "LEFT" | "DOWN":
val -= 1
self.vm.bus[int(index)].gain = util.check_bounds(val, (-60, 12))
val = util.check_bounds(val, (-60, 12))
self.vm.bus[int(index)].gain = val
self[f"BUS {index}||SLIDER GAIN"].update(value=val)
self.nvda.speak(str(val))
case [
["BUS", index],
["SLIDER", "GAIN"],
@ -1051,7 +1021,8 @@ class NVDAVMWindow(psg.Window):
val += 0.1
case "LEFT" | "DOWN":
val -= 0.1
self.vm.bus[int(index)].gain = util.check_bounds(val, (-60, 12))
val = util.check_bounds(val, (-60, 12))
self.vm.bus[int(index)].gain = val
self[f"BUS {index}||SLIDER GAIN"].update(value=val)
self.nvda.speak(str(val))
case [["BUS", index], ["SLIDER", "GAIN"], ["KEY", "CTRL", "SHIFT", "R"]]: