Skip to content

Commit af7e582

Browse files
authored
Merge 43ddcb8 into f055abb
2 parents f055abb + 43ddcb8 commit af7e582

2 files changed

Lines changed: 23 additions & 11 deletions

File tree

source/gui/settingsDialogs.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import typing
1919
import wx
2020
from NVDAState import WritePaths
21+
from buildVersion import version_year
2122

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

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

1136+
config.conf["speech"]["outputDevice"] = self.deviceList.GetStringSelection()
1137+
11331138
newSynth=self.synthNames[self.synthList.GetSelection()]
11341139
if not setSynth(newSynth):
11351140
_synthWarningDialog(newSynth.name)
@@ -2581,37 +2586,41 @@ class AudioPanel(SettingsPanel):
25812586
title = _("Audio")
25822587
helpId = "AudioSettings"
25832588

2584-
def makeSettings(self, settingsSizer: wx.BoxSizer) -> None:
2585-
sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
2586-
2587-
# Translators: This is the label for the select output device combo in the synthesizer dialog.
2589+
@staticmethod
2590+
def _addAudioCombos(panel: SettingsPanel, sHelper: guiHelper.BoxSizerHelper):
2591+
# Translators: This is the label for the select output device combo in NVDA audio settings.
25882592
# Examples of an output device are default soundcard, usb headphones, etc.
25892593
deviceListLabelText = _("Audio output &device:")
25902594
deviceNames = nvwave.getOutputDeviceNames()
25912595
# #11349: On Windows 10 20H1 and 20H2, Microsoft Sound Mapper returns an empty string.
25922596
if deviceNames[0] in ("", "Microsoft Sound Mapper"):
25932597
# Translators: name for default (Microsoft Sound Mapper) audio output device.
25942598
deviceNames[0] = _("Microsoft Sound Mapper")
2595-
self.deviceList = sHelper.addLabeledControl(deviceListLabelText, wx.Choice, choices=deviceNames)
2596-
self.bindHelpEvent("SelectSynthesizerOutputDevice", self.deviceList)
2599+
panel.deviceList = sHelper.addLabeledControl(deviceListLabelText, wx.Choice, choices=deviceNames)
2600+
panel.bindHelpEvent("SelectSynthesizerOutputDevice", panel.deviceList)
25972601
try:
25982602
selection = deviceNames.index(config.conf["speech"]["outputDevice"])
25992603
except ValueError:
26002604
selection = 0
2601-
self.deviceList.SetSelection(selection)
2605+
panel.deviceList.SetSelection(selection)
26022606

26032607
# Translators: This is a label for the audio ducking combo box in the Audio Settings dialog.
26042608
duckingListLabelText = _("Audio d&ucking mode:")
2605-
self.duckingList = sHelper.addLabeledControl(
2609+
panel.duckingList = sHelper.addLabeledControl(
26062610
duckingListLabelText,
26072611
wx.Choice,
26082612
choices=[mode.displayString for mode in audioDucking.AudioDuckingMode]
26092613
)
2610-
self.bindHelpEvent("SelectSynthesizerDuckingMode", self.duckingList)
2614+
panel.bindHelpEvent("SelectSynthesizerDuckingMode", panel.duckingList)
26112615
index = config.conf["audio"]["audioDuckingMode"]
2612-
self.duckingList.SetSelection(index)
2616+
panel.duckingList.SetSelection(index)
26132617
if not audioDucking.isAudioDuckingSupported():
2614-
self.duckingList.Disable()
2618+
panel.duckingList.Disable()
2619+
2620+
def makeSettings(self, settingsSizer: wx.BoxSizer) -> None:
2621+
sHelper = guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
2622+
2623+
AudioPanel._addAudioCombos(self, sHelper)
26152624

26162625
# Translators: This is the label for a checkbox control in the
26172626
# Audio settings panel.

user_docs/en/changes.t2t

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ There's also been bug fixes for the Add-on Store, Microsoft Office, Microsoft Ed
1919

2020
== New Features ==
2121
- Enhanced sound management:
22+
- New "audio" panel in settings. (#15472)
2223
- 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)
2324
- An option in Audio settings to separately configure the volume of NVDA sounds. (#1409, #15038)
2425
- 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)
@@ -55,6 +56,8 @@ There's also been bug fixes for the Add-on Store, Microsoft Office, Microsoft Ed
5556
You can now disable specific drivers for braille display auto detection in the braille display selection dialog. (#15196)
5657
-
5758
- 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)
59+
- These options will be removed from the "select synthesizer" dialog in 2024.1. (#15486)
60+
-
5861
- Add-on Store: Installed add-ons will now be listed in the Available Add-ons tab, if they are available in the store. (#15374)
5962
- Some shortcut keys have been updated in the NVDA menu. (#15364)
6063
-

0 commit comments

Comments
 (0)