summaryrefslogtreecommitdiff
path: root/src/wx/config_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-07-25 16:28:46 +0200
committerCarl Hetherington <cth@carlh.net>2024-07-26 11:39:59 +0200
commit5fc64dfcf121d785de3445d10fa7510a30c55965 (patch)
tree546637897a79ab7c062d1aa1933f97ee0d960d6e /src/wx/config_dialog.cc
parentce34d8e16db29c358e21337be985600cef8a5044 (diff)
Add AudioBackend::output_device_names().
Diffstat (limited to 'src/wx/config_dialog.cc')
-rw-r--r--src/wx/config_dialog.cc22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index bbe2278ac..da6dcbd16 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -881,27 +881,9 @@ SoundPage::setup ()
font.SetPointSize (font.GetPointSize() - 1);
_sound_output_details->SetFont (font);
- auto& audio = AudioBackend::instance()->rtaudio();
-
-#if (RTAUDIO_VERSION_MAJOR >= 6)
- for (auto device_id: audio.getDeviceIds()) {
- auto dev = audio.getDeviceInfo(device_id);
- if (dev.outputChannels > 0) {
- _sound_output->Append(std_to_wx(dev.name));
- }
+ for (auto name: AudioBackend::instance()->output_device_names()) {
+ _sound_output->Append(std_to_wx(name));
}
-#else
- for (unsigned int i = 0; i < audio.getDeviceCount(); ++i) {
- try {
- auto dev = audio.getDeviceInfo (i);
- if (dev.probed && dev.outputChannels > 0) {
- _sound_output->Append (std_to_wx (dev.name));
- }
- } catch (RtAudioError&) {
- /* Something went wrong so let's just ignore that device */
- }
- }
-#endif
_sound->bind(&SoundPage::sound_changed, this);
_sound_output->Bind (wxEVT_CHOICE, bind(&SoundPage::sound_output_changed, this));