Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mltony committed Apr 18, 2024
1 parent 758ea80 commit 0c8aa41
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions source/globalCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import vision
from utils.security import objectBelowLockScreenAndWindowsIsLocked
import audio
import nvwave


#: Script category for text review commands.
Expand Down Expand Up @@ -4520,6 +4521,14 @@ def script_cycleSoundSplit(self, gesture: "inputCore.InputGesture") -> None:
gesture="kb:NVDA+alt+pageUp",
)
def script_increaseApplicationsVolume(self, gesture: "inputCore.InputGesture") -> None:
if not nvwave.usingWasapiWavePlayer():
message = _(
# Translators: error message when wasapi is turned off.
"Cannot adjust volume of other applications. "
"Please enable WASAPI in the Advanced category in NVDA Settings to use it."
)
ui.message(message)
return
state = audio.soundSplit.SoundSplitState(config.conf["audio"]["soundSplitState"])
if state == audio.soundSplit.SoundSplitState.OFF:
# Translators: An error message while trying to adjust applications volume
Expand All @@ -4544,6 +4553,14 @@ def script_increaseApplicationsVolume(self, gesture: "inputCore.InputGesture") -
gesture="kb:NVDA+alt+pageDown",
)
def script_decreaseApplicationsVolume(self, gesture: "inputCore.InputGesture") -> None:
if not nvwave.usingWasapiWavePlayer():
message = _(
# Translators: error message when wasapi is turned off.
"Cannot adjust volume of other applications. "
"Please enable WASAPI in the Advanced category in NVDA Settings to use it."
)
ui.message(message)
return
state = audio.soundSplit.SoundSplitState(config.conf["audio"]["soundSplitState"])
if state == audio.soundSplit.SoundSplitState.OFF:
# Translators: An error message while trying to adjust applications volume
Expand All @@ -4568,6 +4585,14 @@ def script_decreaseApplicationsVolume(self, gesture: "inputCore.InputGesture") -
gesture="kb:NVDA+alt+delete",
)
def script_toggleApplicationsMute(self, gesture: "inputCore.InputGesture") -> None:
if not nvwave.usingWasapiWavePlayer():
message = _(
# Translators: error message when wasapi is turned off.
"Cannot mute other applications. "
"Please enable WASAPI in the Advanced category in NVDA Settings to use it."
)
ui.message(message)
return
state = audio.soundSplit.SoundSplitState(config.conf["audio"]["soundSplitState"])
if state == audio.soundSplit.SoundSplitState.OFF:
# Translators: An error message while trying to adjust applications volume
Expand Down

0 comments on commit 0c8aa41

Please sign in to comment.