Skip to content

Commit

Permalink
implements reset binds
Browse files Browse the repository at this point in the history
Advanced Comp|Gate section added to README.

bump to version 0.5.0b1
  • Loading branch information
onyx-and-iris committed Sep 26, 2023
1 parent 5befe72 commit 0aeb336
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 3 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,30 @@ All sliders may be controlled in three different ways:
- `Shift + Left|Right arrow` to move a slider by 0.1 steps.
- `Control + Left|Right arrow` to move a slider by 3 steps.

To 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`

A single menu item `Voicemeeter` can be opened using `Alt` and then `v`. The menu allows you to:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "nvda_voicemeeter"
version = "0.5.0a2"
version = "0.5.0b1"
description = "A Voicemeeter app compatible with NVDA"
authors = [
{ name = "onyx-and-iris", email = "[email protected]" },
Expand Down
46 changes: 46 additions & 0 deletions src/nvda_voicemeeter/popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def _make_comp_frame() -> psg.Frame:
self.popup[f"COMPRESSOR||SLIDER {param}"].bind(
f"<Control-Alt-{event}-{direction}>", f"||KEY CTRL ALT {direction.upper()} {event_id}"
)
self.popup[f"COMPRESSOR||SLIDER {param}"].bind("<Control-Shift-KeyPress-R>", "||KEY CTRL SHIFT R")
self.popup["MAKEUP"].bind("<FocusIn>", "||FOCUS IN")
self.popup["MAKEUP"].bind("<Return>", "||KEY ENTER")
self.popup["Exit"].bind("<FocusIn>", "||FOCUS IN")
Expand Down Expand Up @@ -458,6 +459,33 @@ def _make_comp_frame() -> psg.Frame:
else:
self.window.vm.event.pdirty = True

case [
["COMPRESSOR"],
["SLIDER", "INPUT" | "OUTPUT" as direction, "GAIN"],
["KEY", "CTRL", "SHIFT", "R"],
]:
if direction == "INPUT":
self.window.vm.strip[index].comp.gainin = 0
else:
self.window.vm.strip[index].comp.gainout = 0
self.popup[f"COMPRESSOR||SLIDER {direction} GAIN"].update(value=0)
self.window.nvda.speak(str(0))
case [["COMPRESSOR"], ["SLIDER", param], ["KEY", "CTRL", "SHIFT", "R"]]:
match param:
case "RATIO":
val = 1
case "THRESHOLD":
val = -20
case "ATTACK":
val = 10
case "RELEASE":
val = 50
case "KNEE":
val = 0.5
setattr(self.window.vm.strip[index].comp, param.lower(), val)
self.popup[f"COMPRESSOR||SLIDER {param}"].update(value=val)
self.window.nvda.speak(str(round(val, 1)))

case ["MAKEUP"]:
val = not self.window.vm.strip[index].comp.makeup
self.window.vm.strip[index].comp.makeup = val
Expand Down Expand Up @@ -516,6 +544,7 @@ def _make_gate_frame() -> psg.Frame:
self.popup[f"GATE||SLIDER {param}"].bind(
f"<Control-Alt-{event}-{direction}>", f"||KEY CTRL ALT {direction.upper()} {event_id}"
)
self.popup[f"GATE||SLIDER {param}"].bind("<Control-Shift-KeyPress-R>", "||KEY CTRL SHIFT R")
self.popup["Exit"].bind("<FocusIn>", "||FOCUS IN")
self.popup["Exit"].bind("<Return>", "||KEY ENTER")
self.window.vm.observer.add(self.on_pdirty)
Expand Down Expand Up @@ -658,6 +687,23 @@ def _make_gate_frame() -> psg.Frame:
self.window.nvda.speak(str(round(val, 1)))
else:
self.window.vm.event.pdirty = True
case [["GATE"], ["SLIDER", param], ["KEY", "CTRL", "SHIFT", "R"]]:
match param:
case "THRESHOLD":
val = -60
case "DAMPING":
val = -60
case "BPSIDECHAIN":
val = 100
case "ATTACK":
val = 0
case "HOLD":
val = 500
case "RELEASE":
val = 1000
setattr(self.window.vm.strip[index].gate, param.lower(), val)
self.popup[f"GATE||SLIDER {param}"].update(value=val)
self.window.nvda.speak(str(round(val, 1)))

case [[button], ["FOCUS", "IN"]]:
self.window.nvda.speak(button)
Expand Down
6 changes: 4 additions & 2 deletions src/nvda_voicemeeter/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ def run(self):
case "tab||Settings":
self.write_event_value("ADVANCED SETTINGS", None)
case "tab||Physical Strip":
if self.kind.name != "potato":
continue
if values["tabgroup||Physical Strip"] == "tab||Physical Strip||sliders":
if focus := self.find_element_with_focus():
identifier, partial = focus.key.split("||")
Expand Down Expand Up @@ -973,7 +975,7 @@ def run(self):
case "LIMIT":
self.vm.strip[int(index)].limit = 12
self[f"STRIP {index}||SLIDER {param}"].update(value=12)
self.nvda.speak(f"{param} {12 if param == 'LABEL' else 0}")
self.nvda.speak(f"{12 if param == 'LIMIT' else 0}")

# Bus Params
case [["BUS", index], [param]]:
Expand Down Expand Up @@ -1106,7 +1108,7 @@ def run(self):
case [["BUS", index], ["SLIDER", "GAIN"], ["KEY", "CTRL", "SHIFT", "R"]]:
self.vm.bus[int(index)].gain = 0
self[f"BUS {index}||SLIDER GAIN"].update(value=0)
self.nvda.speak(str(val))
self.nvda.speak(str(0))

# Unknown
case _:
Expand Down

0 comments on commit 0aeb336

Please sign in to comment.