1818import typing
1919import wx
2020from NVDAState import WritePaths
21- from buildVersion import version_year
2221
2322from vision .providerBase import VisionEnhancementProviderSettings
2423from wx .lib .expando import ExpandoTextCtrl
@@ -1109,8 +1108,6 @@ def makeSettings(self, settingsSizer):
11091108 self .synthList = settingsSizerHelper .addLabeledControl (synthListLabelText , wx .Choice , choices = [])
11101109 self .bindHelpEvent ("SelectSynthesizerSynthesizer" , self .synthList )
11111110 self .updateSynthesizerList ()
1112- if version_year < 2024 :
1113- AudioPanel ._addAudioCombos (self , settingsSizerHelper )
11141111
11151112 def postInit (self ):
11161113 # Finally, ensure that focus is on the synthlist
@@ -1133,8 +1130,6 @@ def onOk(self, evt):
11331130 # The list of synths has not been populated yet, so we didn't change anything in this panel
11341131 return
11351132
1136- config .conf ["speech" ]["outputDevice" ] = self .deviceList .GetStringSelection ()
1137-
11381133 newSynth = self .synthNames [self .synthList .GetSelection ()]
11391134 if not setSynth (newSynth ):
11401135 _synthWarningDialog (newSynth )
@@ -2586,8 +2581,9 @@ class AudioPanel(SettingsPanel):
25862581 title = _ ("Audio" )
25872582 helpId = "AudioSettings"
25882583
2589- @staticmethod
2590- def _addAudioCombos (panel : SettingsPanel , sHelper : guiHelper .BoxSizerHelper ):
2584+ def makeSettings (self , settingsSizer : wx .BoxSizer ) -> None :
2585+ sHelper = guiHelper .BoxSizerHelper (self , sizer = settingsSizer )
2586+
25912587 # Translators: This is the label for the select output device combo in NVDA audio settings.
25922588 # Examples of an output device are default soundcard, usb headphones, etc.
25932589 deviceListLabelText = _ ("Audio output &device:" )
@@ -2596,31 +2592,26 @@ def _addAudioCombos(panel: SettingsPanel, sHelper: guiHelper.BoxSizerHelper):
25962592 if deviceNames [0 ] in ("" , "Microsoft Sound Mapper" ):
25972593 # Translators: name for default (Microsoft Sound Mapper) audio output device.
25982594 deviceNames [0 ] = _ ("Microsoft Sound Mapper" )
2599- panel .deviceList = sHelper .addLabeledControl (deviceListLabelText , wx .Choice , choices = deviceNames )
2600- panel .bindHelpEvent ("SelectSynthesizerOutputDevice" , panel .deviceList )
2595+ self .deviceList = sHelper .addLabeledControl (deviceListLabelText , wx .Choice , choices = deviceNames )
2596+ self .bindHelpEvent ("SelectSynthesizerOutputDevice" , self .deviceList )
26012597 try :
26022598 selection = deviceNames .index (config .conf ["speech" ]["outputDevice" ])
26032599 except ValueError :
26042600 selection = 0
2605- panel .deviceList .SetSelection (selection )
2601+ self .deviceList .SetSelection (selection )
26062602
26072603 # Translators: This is a label for the audio ducking combo box in the Audio Settings dialog.
26082604 duckingListLabelText = _ ("Audio d&ucking mode:" )
2609- panel .duckingList = sHelper .addLabeledControl (
2605+ self .duckingList = sHelper .addLabeledControl (
26102606 duckingListLabelText ,
26112607 wx .Choice ,
26122608 choices = [mode .displayString for mode in audioDucking .AudioDuckingMode ]
26132609 )
2614- panel .bindHelpEvent ("SelectSynthesizerDuckingMode" , panel .duckingList )
2610+ self .bindHelpEvent ("SelectSynthesizerDuckingMode" , self .duckingList )
26152611 index = config .conf ["audio" ]["audioDuckingMode" ]
2616- panel .duckingList .SetSelection (index )
2612+ self .duckingList .SetSelection (index )
26172613 if not audioDucking .isAudioDuckingSupported ():
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 )
2614+ self .duckingList .Disable ()
26242615
26252616 # Translators: This is the label for a checkbox control in the
26262617 # Audio settings panel.
0 commit comments