Skip to content

Commit

Permalink
Merge 43ddcb8 into f055abb
Browse files Browse the repository at this point in the history
  • Loading branch information
codeofdusk committed Sep 22, 2023
2 parents f055abb + 43ddcb8 commit af7e582
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
31 changes: 20 additions & 11 deletions source/gui/settingsDialogs.py
Expand Up @@ -18,6 +18,7 @@
import typing
import wx
from NVDAState import WritePaths
from buildVersion import version_year

from vision.providerBase import VisionEnhancementProviderSettings
from wx.lib.expando import ExpandoTextCtrl
Expand Down Expand Up @@ -1108,6 +1109,8 @@ def makeSettings(self, settingsSizer):
self.synthList = settingsSizerHelper.addLabeledControl(synthListLabelText, wx.Choice, choices=[])
self.bindHelpEvent("SelectSynthesizerSynthesizer", self.synthList)
self.updateSynthesizerList()
if version_year < 2024:
AudioPanel._addAudioCombos(self, settingsSizerHelper)

def postInit(self):
# Finally, ensure that focus is on the synthlist
Expand All @@ -1130,6 +1133,8 @@ def onOk(self, evt):
# The list of synths has not been populated yet, so we didn't change anything in this panel
return

config.conf["speech"]["outputDevice"] = self.deviceList.GetStringSelection()

newSynth=self.synthNames[self.synthList.GetSelection()]
if not setSynth(newSynth):
_synthWarningDialog(newSynth.name)
Expand Down Expand Up @@ -2581,37 +2586,41 @@ class AudioPanel(SettingsPanel):
title = _("Audio")
helpId = "AudioSettings"

def makeSettings(self, settingsSizer: wx.BoxSizer) -> None:
sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)

# Translators: This is the label for the select output device combo in the synthesizer dialog.
@staticmethod
def _addAudioCombos(panel: SettingsPanel, sHelper: guiHelper.BoxSizerHelper):
# Translators: This is the label for the select output device combo in NVDA audio settings.
# Examples of an output device are default soundcard, usb headphones, etc.
deviceListLabelText = _("Audio output &device:")
deviceNames = nvwave.getOutputDeviceNames()
# #11349: On Windows 10 20H1 and 20H2, Microsoft Sound Mapper returns an empty string.
if deviceNames[0] in ("", "Microsoft Sound Mapper"):
# Translators: name for default (Microsoft Sound Mapper) audio output device.
deviceNames[0] = _("Microsoft Sound Mapper")
self.deviceList = sHelper.addLabeledControl(deviceListLabelText, wx.Choice, choices=deviceNames)
self.bindHelpEvent("SelectSynthesizerOutputDevice", self.deviceList)
panel.deviceList = sHelper.addLabeledControl(deviceListLabelText, wx.Choice, choices=deviceNames)
panel.bindHelpEvent("SelectSynthesizerOutputDevice", panel.deviceList)
try:
selection = deviceNames.index(config.conf["speech"]["outputDevice"])
except ValueError:
selection = 0
self.deviceList.SetSelection(selection)
panel.deviceList.SetSelection(selection)

# Translators: This is a label for the audio ducking combo box in the Audio Settings dialog.
duckingListLabelText = _("Audio d&ucking mode:")
self.duckingList = sHelper.addLabeledControl(
panel.duckingList = sHelper.addLabeledControl(
duckingListLabelText,
wx.Choice,
choices=[mode.displayString for mode in audioDucking.AudioDuckingMode]
)
self.bindHelpEvent("SelectSynthesizerDuckingMode", self.duckingList)
panel.bindHelpEvent("SelectSynthesizerDuckingMode", panel.duckingList)
index = config.conf["audio"]["audioDuckingMode"]
self.duckingList.SetSelection(index)
panel.duckingList.SetSelection(index)
if not audioDucking.isAudioDuckingSupported():
self.duckingList.Disable()
panel.duckingList.Disable()

def makeSettings(self, settingsSizer: wx.BoxSizer) -> None:
sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)

AudioPanel._addAudioCombos(self, sHelper)

# Translators: This is the label for a checkbox control in the
# Audio settings panel.
Expand Down
3 changes: 3 additions & 0 deletions user_docs/en/changes.t2t
Expand Up @@ -19,6 +19,7 @@ There's also been bug fixes for the Add-on Store, Microsoft Office, Microsoft Ed

== New Features ==
- Enhanced sound management:
- New "audio" panel in settings. (#15472)
- An option in Audio settings to have the volume of NVDA sounds and beeps follow the volume setting of the voice you are using. (#1409)
- An option in Audio settings to separately configure the volume of NVDA sounds. (#1409, #15038)
- NVDA will now output audio via the Windows Audio Session API (WASAPI), which may improve the responsiveness, performance and stability of NVDA speech and sounds. (#14697, #11169, #11615, #5096, #10185, #11061)
Expand Down Expand Up @@ -55,6 +56,8 @@ There's also been bug fixes for the Add-on Store, Microsoft Office, Microsoft Ed
You can now disable specific drivers for braille display auto detection in the braille display selection dialog. (#15196)
-
- The settings to change audio output device and toggle audio ducking have been moved to the new Audio settings panel from the Select Synthesizer dialog. (#8711)
- These options will be removed from the "select synthesizer" dialog in 2024.1. (#15486)
-
- Add-on Store: Installed add-ons will now be listed in the Available Add-ons tab, if they are available in the store. (#15374)
- Some shortcut keys have been updated in the NVDA menu. (#15364)
-
Expand Down

0 comments on commit af7e582

Please sign in to comment.