From: Carl Hetherington Date: Sun, 14 Apr 2019 23:07:16 +0000 (+0100) Subject: Add some details of the what the configured sound output means. X-Git-Tag: v2.13.146~3 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=b8cd038b2f5e6d521b3593c4f6024bf1cd287670 Add some details of the what the configured sound output means. --- diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 56456c3a7..b5490f05a 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -23,6 +23,7 @@ #include "check_box.h" #include "nag_dialog.h" #include "dcpomatic_button.h" +#include using std::string; using std::vector; @@ -158,10 +159,19 @@ GeneralPage::add_play_sound_controls (wxGridBagSizer* table, int& r) { _sound = new CheckBox (_panel, _("Play sound via")); table->Add (_sound, wxGBPosition (r, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); _sound_output = new wxChoice (_panel, wxID_ANY); - table->Add (_sound_output, wxGBPosition (r, 1)); + s->Add (_sound_output, 0); + _sound_output_details = new wxStaticText (_panel, wxID_ANY, wxT("")); + s->Add (_sound_output_details, 1, wxALIGN_CENTER_VERTICAL | wxLEFT, DCPOMATIC_SIZER_X_GAP); + table->Add (s, wxGBPosition(r, 1)); ++r; + wxFont font = _sound_output_details->GetFont(); + font.SetStyle (wxFONTSTYLE_ITALIC); + font.SetPointSize (font.GetPointSize() - 1); + _sound_output_details->SetFont (font); + RtAudio audio (DCPOMATIC_RTAUDIO_API); for (unsigned int i = 0; i < audio.getDeviceCount(); ++i) { RtAudio::DeviceInfo dev = audio.getDeviceInfo (i); @@ -252,6 +262,33 @@ GeneralPage::config_changed () } } + RtAudio audio (DCPOMATIC_RTAUDIO_API); + + map apis; + apis[RtAudio::MACOSX_CORE] = _("CoreAudio"); + apis[RtAudio::WINDOWS_ASIO] = _("ASIO"); + apis[RtAudio::WINDOWS_DS] = _("Direct Sound"); + apis[RtAudio::WINDOWS_WASAPI] = _("WASAPI"); + apis[RtAudio::UNIX_JACK] = _("JACK"); + apis[RtAudio::LINUX_ALSA] = _("ALSA"); + apis[RtAudio::LINUX_PULSE] = _("Pulseaudio"); + apis[RtAudio::LINUX_OSS] = _("OSS"); + apis[RtAudio::RTAUDIO_DUMMY] = _("Dummy"); + + int channels = 0; + if (configured_so) { + for (unsigned int i = 0; i < audio.getDeviceCount(); ++i) { + RtAudio::DeviceInfo info = audio.getDeviceInfo(i); + if (info.name == *configured_so && info.outputChannels > 0) { + channels = info.outputChannels; + } + } + } + + _sound_output_details->SetLabel ( + wxString::Format(_("%d channels on %s"), channels, apis[audio.getCurrentApi()]) + ); + setup_sensitivity (); } diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h index ab2553e56..ac90cd42d 100644 --- a/src/wx/config_dialog.h +++ b/src/wx/config_dialog.h @@ -107,6 +107,7 @@ private: wxChoice* _language; wxCheckBox* _sound; wxChoice* _sound_output; + wxStaticText* _sound_output_details; wxCheckBox* _check_for_updates; wxCheckBox* _check_for_test_updates; }; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index e7b338409..b728f6b2a 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -652,7 +652,6 @@ FilmViewer::config_changed (Config::Property p) } _audio_channels = _audio.getDeviceInfo(st).outputChannels; - cout << "Opening stream " << st << "(" << _audio.getDeviceInfo(st).name << ") probed=" << _audio.getDeviceInfo(st).probed << " with " << _audio_channels << "\n"; RtAudio::StreamParameters sp; sp.deviceId = st;