summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-04-15 00:07:16 +0100
committerCarl Hetherington <cth@carlh.net>2019-04-15 01:05:19 +0100
commitb8cd038b2f5e6d521b3593c4f6024bf1cd287670 (patch)
treee85ef0e933e9297cdd0176757f7435204df55688 /src
parent6c4ba247bc27d55ed16b012225acd10d485c1f48 (diff)
Add some details of the what the configured sound output means.
Diffstat (limited to 'src')
-rw-r--r--src/wx/config_dialog.cc39
-rw-r--r--src/wx/config_dialog.h1
-rw-r--r--src/wx/film_viewer.cc1
3 files changed, 39 insertions, 2 deletions
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 <iostream>
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<int, wxString> 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;