MythTV  master
audiogeneralsettings.cpp
Go to the documentation of this file.
1 
2 // -*- Mode: c++ -*-
3 
4 // Standard UNIX C headers
5 #include <chrono> // for milliseconds
6 #include <fcntl.h>
7 #include <sys/stat.h>
8 #include <sys/types.h>
9 #include <thread> // for sleep_for
10 
11 // Qt headers
12 #include <QtGlobal>
13 #include <QCoreApplication>
14 #include <QDir>
15 #include <QEvent>
16 #include <utility>
17 
18 // MythTV headers
20 #include "libmythbase/mythconfig.h"
22 #include "libmythbase/mythdbcon.h"
27 
28 // MythFrontend
29 #include "audiogeneralsettings.h"
30 
31 extern "C" {
32 #include "libavformat/avformat.h"
33 }
34 
36  HostComboBoxSetting("AudioOutputDevice", true), m_parent(parent)
37 {
38  setLabel(tr("Audio output device"));
39 #ifdef Q_OS_ANDROID
40  QString dflt = "OpenSLES:";
41 #elif USING_ALSA
42  QString dflt = "ALSA:default";
43 #elif USING_PULSEOUTPUT
44  QString dflt = "PulseAudio:default";
45 #elif defined(Q_OS_DARWIN)
46  QString dflt = "CoreAudio:";
47 #elif defined(_WIN32)
48  QString dflt = "Windows:";
49 #else
50  QString dflt = "NULL";
51 #endif
52  QString current = gCoreContext->GetSetting(QString("AudioOutputDevice"),
53  dflt);
55 
56  connect(this, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
58 }
59 
61 {
62  AudioRescan();
64 }
65 
67 {
69 
70  if (vect.empty())
71  return;
72 
73  QString value = getValue();
75 
76  // Adding the current value first avoids marking the setting as changed
77  addSelection(value, value, true);
78  for (const auto & it : qAsConst(vect))
79  {
80  if (value != it.m_name)
81  addSelection(it.m_name, it.m_name);
82  }
83 }
84 
86 {
87  QString desc = m_parent->AudioDeviceMap().value(setting->getValue()).m_desc;
88  setHelpText(desc);
89 }
90 
92  GroupSetting *groupSetting)
93  : StandardSettingDialog(parent, name, groupSetting)
94 {
95 }
96 
98 {
99  SetBusyPopupMessage(tr("Scanning for available audio devices"));
101 }
102 
104 {
106 
107  auto *settings = qobject_cast<AudioConfigSettings*>(GetGroupSettings());
108  if (settings == nullptr)
109  return;
110  settings->CheckConfiguration();
111 }
112 
114 {
115  setLabel(tr("Audio System"));
116 
118  // Rescan button
119 
120  auto *rescan = new ButtonStandardSetting("rescan");
121  rescan->setLabel(tr("Rescan"));
122  rescan->setHelpText(tr("Rescan for available audio devices. "
123  "Current entry will be checked and "
124  "capability entries populated."));
125  addChild(rescan);
127 
128  // digital settings
130  m_triggerDigital->setLabel(tr("Digital Audio Capabilities"));
137 
142 
143  //Advanced Settings
144  auto *advancedSettings = new GroupSetting();
145  advancedSettings->setLabel(tr("Advanced Audio Settings"));
146  advancedSettings->setHelpText(tr("Enable extra audio settings. Under most "
147  "usage all options should be left alone"));
148  addChild(advancedSettings);
150  advancedSettings->addChild(m_passThroughOverride);
152  advancedSettings->addChild(m_passThroughDeviceOverride);
156 
157  StandardSetting *srcqualityoverride = SRCQualityOverride();
158  srcqualityoverride->addTargetedChild("1", SRCQuality());
159  addChild(srcqualityoverride);
160 
161  advancedSettings->addChild(Audio48kOverride());
162 #if USING_ALSA
163  advancedSettings->addChild(SPDIFRateOverride());
164 #endif
165 
166  advancedSettings->addChild(HBRPassthrough());
167 
168  advancedSettings->addChild(m_mpcm = MPCM());
169 
170  addChild(m_audioTest = new AudioTest());
171 
172  // Set slots
173  connect(m_maxAudioChannels, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
174  this, qOverload<StandardSetting *>(&AudioConfigSettings::UpdateVisibility));
175  connect(m_outputDevice, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
176  this, qOverload<StandardSetting *>(&AudioConfigSettings::UpdateCapabilities));
177  connect(m_ac3PassThrough, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
178  this, qOverload<StandardSetting *>(&AudioConfigSettings::UpdateCapabilitiesAC3));
179 
180  connect(m_dtsPassThrough, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
181  this, qOverload<StandardSetting *>(&AudioConfigSettings::UpdateCapabilities));
182  connect(m_eac3PassThrough, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
183  this, qOverload<StandardSetting *>(&AudioConfigSettings::UpdateCapabilities));
184  connect(m_trueHDPassThrough, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
185  this, qOverload<StandardSetting *>(&AudioConfigSettings::UpdateCapabilities));
186  connect(m_dtsHDPassThrough, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
187  this, qOverload<StandardSetting *>(&AudioConfigSettings::UpdateCapabilities));
188  //Slot for audio test
189  connect(m_outputDevice, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
191  connect(m_maxAudioChannels, qOverload<StandardSetting *>(&StandardSetting::valueChanged),
193 }
194 
196 {
197  QString name = m_outputDevice->getValue();
199  AudioOutput::GetAudioDeviceConfig(name, name, true);
200  if (adc)
201  {
202  if (adc->m_settings.IsInvalid())
203  {
204  QString msg = tr("%1 is invalid or not useable.").arg(name);
205 
206  ShowOkPopup(msg);
207 
208  LOG(VB_GENERAL, LOG_ERR, QString("Audio device %1 isn't usable")
209  .arg(name));
210  }
211  delete adc;
212  }
213 
214  if (!CheckPassthrough())
215  {
216  QString pt_name = m_passThroughDeviceOverride->getValue();
217  QString pt_msg = tr("Passthrough device is invalid or not useable. Check "
218  "configuration in Advanced Settings:") +
219  pt_name;
220 
221  ShowOkPopup(pt_msg);
222 
223  LOG(VB_GENERAL, LOG_ERR, QString("Audio device %1 isn't usable")
224  .arg(pt_name));
225  }
226 }
227 
229 {
231  AudioRescan();
232  // If this is the initial setup where there was nothing on the DB,
233  // set changed so that user can save.
234  if (gCoreContext->GetSetting(QString("AudioOutputDevice"),"").isEmpty())
235  setChanged(true);
236 }
237 
239 {
240  if (!m_slotLock.tryLock())
241  return;
242 
244 
245  m_audioDevs.clear();
246  for (const auto & dev : qAsConst(*list))
247  m_audioDevs.insert(dev.m_name, dev);
248 
249  m_devices = *list;
250  delete list;
251 
252  QString name = m_outputDevice->getValue();
253  if (!m_audioDevs.contains(name))
254  {
255  // Scan for possible custom entry that isn't in the list
257  AudioOutput::GetAudioDeviceConfig(name, name, true);
258  m_audioDevs.insert(name, *adc);
259  m_devices.append(*adc);
260  delete adc;
261  }
263  m_slotLock.unlock();
265 }
266 
268 {
270  return;
271 
272  int cur_speakers = m_maxAudioChannels->getValue().toInt();
273  m_audioUpmix->setEnabled(cur_speakers > 2);
274  m_audioUpmixType->setEnabled(cur_speakers > 2);
275 }
276 
278  bool restore, bool AC3)
279 {
280  int max_speakers = 8;
281  int realmax_speakers = 8;
282 
283  bool invalid = false;
284  QString out;
285 
286  if (m_outputDevice)
287  out = m_outputDevice->getValue();
288 
289  if (!out.isEmpty())
290  {
291  restore = out != m_lastAudioDevice;
292  m_lastAudioDevice = out;
293  }
294 
295  AudioOutputSettings settings;
296  AudioOutputSettings settingsdigital;
297 
298  // Test if everything is set yet
302  return settings;
303 
304  if (!m_slotLock.tryLock()) // Doing a rescan of channels
305  return settings;
306 
307  bool bAC3 = true;
308  //bool bDTS = true;
309  bool bLPCM = true;
310  bool bEAC3 = true;
311  bool bTRUEHD = true;
312  bool bDTSHD = true;
313 
314  if (!m_audioDevs.contains(out))
315  {
316  LOG(VB_AUDIO, LOG_ERR, QString("Update not found (%1)").arg(out));
317  invalid = true;
318  }
319  else
320  {
321  bool bForceDigital = m_passThroughOverride->boolValue();
322 
323  settings = m_audioDevs.value(out).m_settings;
324  settingsdigital = bForceDigital ?
326  .m_settings : settings;
327 
328  realmax_speakers = max_speakers = settings.BestSupportedChannels();
329 
330  bAC3 = settingsdigital.canFeature(FEATURE_AC3) &&
332  //bDTS = settingsdigital.canFeature(FEATURE_DTS) &&
333  // m_dtsPassThrough->boolValue();
334  bLPCM = settings.canFeature(FEATURE_LPCM) &&
335  !gCoreContext->GetBoolSetting("StereoPCM", false);
336  bEAC3 = settingsdigital.canFeature(FEATURE_EAC3) &&
337  !gCoreContext->GetBoolSetting("Audio48kOverride", false);
338  bTRUEHD = settingsdigital.canFeature(FEATURE_TRUEHD) &&
339  !gCoreContext->GetBoolSetting("Audio48kOverride", false) &&
340  gCoreContext->GetBoolSetting("HBRPassthru", true);
341  bDTSHD = settingsdigital.canFeature(FEATURE_DTSHD) &&
342  !gCoreContext->GetBoolSetting("Audio48kOverride", false);
343 
344  if (max_speakers > 2 && !bLPCM)
345  max_speakers = 2;
346  if (max_speakers == 2 && bAC3)
347  {
348  max_speakers = 6;
349  if (AC3)
350  {
351  restore = true;
352  }
353  }
354  }
355 
356  m_triggerDigital->setEnabled(invalid || settingsdigital.canFeature(
362 
363  int cur_speakers = m_maxAudioChannels->getValue().toInt();
364  if (cur_speakers > m_maxSpeakers)
365  {
367  }
368  if (restore)
369  {
370  cur_speakers = m_maxSpeakers;
371  }
372 
373  if (cur_speakers > max_speakers)
374  {
375  LOG(VB_AUDIO, LOG_INFO, QString("Reset device %1").arg(out));
376  cur_speakers = max_speakers;
377  }
378 
379  // Remove everything and re-add available channels
380  bool chansChanged = m_maxAudioChannels->haveChanged();
382  for (int i = 1; i <= max_speakers; i++)
383  {
384  if (invalid || settings.IsSupportedChannels(i) ||
385  settingsdigital.IsSupportedChannels(i))
386  {
387  QString txt;
388 
389  switch (i)
390  {
391  case 2:
392  txt = QCoreApplication::translate("(Common)", "Stereo");
393  break;
394  case 6:
395  txt = QCoreApplication::translate("(Common)", "5.1");
396  break;
397  case 8:
398  txt = QCoreApplication::translate("(Common)", "7.1");
399  break;
400  default:
401  continue;
402  }
403  m_maxAudioChannels->addSelection(txt, QString::number(i),
404  i == cur_speakers);
405  }
406  }
407  m_maxAudioChannels->setChanged(chansChanged);
408 
409  setMPCMEnabled(settings.canPassthrough() >= 0);
410 
411  // Return values is used by audio test
412  // where we mainly are interested by the number of channels
413  // if we support AC3 and/or LPCM
414  settings.SetBestSupportedChannels(cur_speakers);
415  settings.setFeature(bAC3, FEATURE_AC3);
416  settings.setFeature(bLPCM && realmax_speakers > 2, FEATURE_LPCM);
417 
418  m_slotLock.unlock();
419  return settings;
420 }
421 
423 {
425 }
426 
428 {
429  return UpdateCapabilities(false, true);
430 }
431 
433 {
435 }
436 
438 {
439  QString name = "MaxChannels";
440 
441  auto *gc = new HostComboBoxSetting(name, false);
442 
443  gc->setLabel(tr("Speaker configuration"));
444 
445  gc->addSelection(QCoreApplication::translate("(Common)", "Stereo"),
446  "2", true); // default
447 
448  gc->setHelpText(tr("Select the maximum number of audio "
449  "channels supported by your receiver "
450  "and speakers."));
451  return gc;
452 }
453 
455 {
456  auto *gc = new HostCheckBoxSetting("AudioDefaultUpmix");
457 
458  gc->setLabel(tr("Upconvert stereo to 5.1 surround"));
459 
460  gc->setValue(true);
461 
462  gc->setHelpText(tr("If enabled, MythTV will upconvert stereo "
463  "to 5.1 audio. You can enable or disable "
464  "the upconversion during playback at any time."));
465  return gc;
466 }
467 
469 {
470  auto *gc = new HostComboBoxSetting("AudioUpmixType", false);
471 
472  gc->setLabel(tr("Upmix Quality"));
473 
474  gc->addSelection(tr("Passive"), "0");
475  gc->addSelection(tr("Hall", "Upmix Quality"), "3");
476  gc->addSelection(tr("Good", "Upmix Quality"), "1");
477  gc->addSelection(tr("Best", "Upmix Quality"), "2", true); // default
478 
479  gc->setHelpText(tr("Set the audio surround-upconversion quality."));
480 
481  return gc;
482 }
483 
485 {
486  auto *gc = new HostCheckBoxSetting("AC3PassThru");
487 
488  gc->setLabel(tr("Dolby Digital"));
489 
490  gc->setValue(false);
491 
492  gc->setHelpText(tr("Enable if your amplifier or sound decoder "
493  "supports AC-3/Dolby Digital. You must use a digital "
494  "connection. Uncheck if using an analog connection."));
495  return gc;
496 }
497 
499 {
500  auto *gc = new HostCheckBoxSetting("DTSPassThru");
501 
502  gc->setLabel(tr("DTS"));
503 
504  gc->setValue(false);
505 
506  gc->setHelpText(tr("Enable if your amplifier or sound decoder supports "
507  "DTS. You must use a digital connection. Uncheck "
508  "if using an analog connection"));
509  return gc;
510 }
511 
513 {
514  auto *gc = new HostCheckBoxSetting("EAC3PassThru");
515 
516  gc->setLabel(tr("E-AC-3"));
517 
518  gc->setValue(false);
519 
520  gc->setHelpText(tr("Enable if your amplifier or sound decoder supports "
521  "E-AC-3 (DD+). You must use a HDMI connection."));
522  return gc;
523 }
524 
526 {
527  auto *gc = new HostCheckBoxSetting("TrueHDPassThru");
528 
529  gc->setLabel(tr("TrueHD"));
530 
531  gc->setValue(false);
532 
533  gc->setHelpText(tr("Enable if your amplifier or sound decoder supports "
534  "Dolby TrueHD. You must use a HDMI connection."));
535  return gc;
536 }
537 
539 {
540  auto *gc = new HostCheckBoxSetting("DTSHDPassThru");
541 
542  gc->setLabel(tr("DTS-HD"));
543 
544  gc->setValue(false);
545 
546  gc->setHelpText(tr("Enable if your amplifier or sound decoder supports "
547  "DTS-HD. You must use a HDMI connection."));
548  return gc;
549 }
550 
552 {
553  bool ok = true;
554 
556  {
557  QString name = m_passThroughDeviceOverride->getValue();
559  AudioOutput::GetAudioDeviceConfig(name, name, true);
560  if (adc->m_settings.IsInvalid())
561  {
562  LOG(VB_GENERAL, LOG_ERR,
563  QString("Passthru device %1 isn't usable "
564  "Check audio configuration").arg(name));
565  ok = false;
566  }
567  // add it to list of known devices
568  m_audioDevs.insert(name, *adc);
569  m_devices.append(*adc);
570  delete adc;
571  }
572  return ok;
573 }
574 
575 #ifdef USING_OSS
577  const QDir& dir, bool absPath = true)
578 
579 {
580  QFileInfoList entries = dir.entryInfoList();
581  for (const auto & fi : qAsConst(entries))
582  {
583  if (absPath)
584  comboBox->addSelection( fi.absoluteFilePath() );
585  else
586  comboBox->addSelection( fi.fileName() );
587  }
588 }
589 #endif
590 
592 {
593  AudioOutputSettings settings = UpdateCapabilities(false);
594  QString out = m_outputDevice->getValue();
595  QString passthrough =
598  int channels = m_maxAudioChannels->getValue().toInt();
599 
600  m_audioTest->UpdateCapabilities(out, passthrough, channels, settings);
601 }
602 
603 ChannelChangedEvent::ChannelChangedEvent(QString channame, bool fulltest)
604  : QEvent(kEventType),
605  m_channel(std::move(channame)),
606  m_fulltest(fulltest)
607 {
608 }
609 
611  QString main, QString passthrough,
612  int channels,
613  AudioOutputSettings &settings,
614  bool hd) :
615  MThread("AudioTest"),
616  m_parent(parent), m_channels(channels), m_device(std::move(main)),
617  m_passthrough(std::move(passthrough)), m_hd(hd)
618 {
619  m_format = hd ? settings.BestSupportedFormat() : FORMAT_S16;
620  m_samplerate = hd ? settings.BestSupportedRate() : 48000;
621 
624  AV_CODEC_ID_NONE, m_samplerate,
626  true, false, 0, &settings);
627  if (result().isEmpty())
628  {
629  m_audioOutput->Pause(true);
630  }
631 }
632 
633 QEvent::Type ChannelChangedEvent::kEventType =
634  static_cast<QEvent::Type>(QEvent::registerEventType());
635 
637 {
638  cancel();
639  wait();
640  delete m_audioOutput;
641 }
642 
644 {
645  m_interrupted = true;
646 }
647 
649 {
650  QString errMsg;
651  if (!m_audioOutput)
652  errMsg = tr("Unable to create AudioOutput.");
653  else
654  errMsg = m_audioOutput->GetError();
655  return errMsg;
656 }
657 
659 {
660  m_channel = channel;
661 }
662 
664 {
665  RunProlog();
666  m_interrupted = false;
667  std::array<std::array<int,8>,7> smptelayout {{
668  { 0, 1, 1 }, //stereo
669  { }, //not used
670  { }, //not used
671  { 0, 2, 1, 4, 3 }, //5.0
672  { 0, 2, 1, 5, 4, 3 }, //5.1
673  { 0, 2, 1, 6, 4, 5, 3 }, //6.1
674  { 0, 2, 1, 7, 5, 4, 6, 3 }, //7.1
675  }};
676 
677  if (m_audioOutput && (m_audioOutput->GetError().isEmpty()))
678  {
679  char *frames = new (std::align_val_t(16)) char[m_channels * 1024_UZ * sizeof(int32_t)];
680 
681  m_audioOutput->Pause(false);
682 
683  int begin = 0;
684  int end = m_channels;
685  if (m_channel >= 0)
686  {
687  begin = m_channel;
688  end = m_channel + 1;
689  }
690  while (!m_interrupted)
691  {
692  for (int i = begin; i < end && !m_interrupted; i++)
693  {
694  int current = smptelayout[m_channels - 2][i];
695 
696  if (m_parent)
697  {
698  QString channel;
699 
700  switch(current)
701  {
702  case 0:
703  channel = "frontleft";
704  break;
705  case 1:
706  channel = "frontright";
707  break;
708  case 2:
709  channel = "center";
710  break;
711  case 3:
712  channel = "lfe";
713  break;
714  case 4:
715  if (m_channels == 6)
716  channel = "surroundleft";
717  else if (m_channels == 7)
718  channel = "rearright";
719  else
720  channel = "rearleft";
721  break;
722  case 5:
723  if (m_channels == 6)
724  channel = "surroundright";
725  else if (m_channels == 7)
726  channel = "surroundleft";
727  else
728  channel = "rearright";
729  break;
730  case 6:
731  if (m_channels == 7)
732  channel = "surroundright";
733  else
734  channel = "surroundleft";
735  break;
736  case 7:
737  channel = "surroundright";
738  break;
739  }
740  QCoreApplication::postEvent(
741  m_parent, new ChannelChangedEvent(channel,
742  m_channel < 0));
743  LOG(VB_AUDIO, LOG_INFO, QString("AudioTest: %1 (%2->%3)")
744  .arg(channel).arg(i).arg(current));
745  }
746 
747  // play sample sound for about 3s
748  int top = m_samplerate / 1000 * 3;
749  for (int j = 0; j < top && !m_interrupted; j++)
750  {
752  current, 1000,
753  m_hd ? 32 : 16);
754  if (!m_audioOutput->AddFrames(frames, 1000 , -1ms))
755  {
756  LOG(VB_AUDIO, LOG_ERR, "AddData() Audio buffer "
757  "overflow, audio data lost!");
758  }
759  std::this_thread::sleep_for(m_audioOutput->LengthLastData());
760  }
761  m_audioOutput->Drain();
762  m_audioOutput->Pause(true);
763  std::this_thread::sleep_for(500ms); // .5s pause
764  m_audioOutput->Pause(false);
765  }
766  if (m_channel >= 0)
767  break;
768  }
769  m_audioOutput->Pause(true);
770 
771  delete[] frames;
772  }
773  RunEpilog();
774 }
775 
777 {
778  int channels = 2;
779 
780  m_channels = gCoreContext->GetNumSetting("TestingChannels", channels);
781  setLabel(tr("Audio Configuration Testing"));
782  setHelpText(tr("Will play a test pattern on all configured "
783  "speakers"));
784 
786  m_frontleft->setLabel(tr("Front Left"));
787  m_frontleft->setHelpText(tr("Start front left channel test"));
789  connect(m_frontleft,
791 
792  m_frontright = new ButtonStandardSetting(m_channels == 2 ? "1" : "2");
793  m_frontright->setLabel(tr("Front Right"));
794  m_frontright->setHelpText(tr("Start front right channel test"));
796  connect(m_frontright,
798 
800  m_rearleft->setLabel(tr("Rear Left"));
801  m_rearleft->setHelpText(tr("Start rear left channel test"));
803  connect(m_rearleft,
805 
807  m_rearright->setLabel(tr("Rear Right"));
808  m_rearright->setHelpText(tr("Start rear right channel test"));
810  connect(m_rearright,
812 
813  m_lfe = new ButtonStandardSetting(m_channels == 6 ? "5" :
814  m_channels == 7 ? "6" : "7");
815  m_lfe->setLabel(tr("LFE"));
816  m_lfe->setHelpText(tr("Start LFE channel test"));
817  addChild(m_lfe);
818  connect(m_lfe,
820 
822  m_channels == 7 ? "5" : "6");
823  m_surroundleft->setLabel(tr("Surround Left"));
824  m_surroundleft->setHelpText(tr("Start surround left channel test"));
826  connect(m_surroundleft,
828 
830  m_surroundright->setLabel(tr("Surround Right"));
831  m_surroundright->setHelpText(tr("Start surround right channel test"));
833  connect(m_surroundright,
835 
836  m_center = new ButtonStandardSetting("1");
837  m_center->setLabel(tr("Center"));
838  m_center->setHelpText(tr("Start center channel test"));
840  connect(m_center,
842 
843  m_startButton = new ButtonStandardSetting("start");
844  m_startButton->setLabel(tr("Test All"));
845  m_startButton->setHelpText(tr("Start all channels test"));
848 
850  m_hd->setLabel(tr("Use Highest Quality Mode"));
851  m_hd->setHelpText(tr("Use the highest audio quality settings "
852  "supported by your audio card. This will be "
853  "a good place to start troubleshooting "
854  "potential errors"));
855  addChild(m_hd);
856  connect(m_hd, qOverload<const QString&>(&StandardSetting::valueChanged),
857  this, &AudioTest::togglequality);
858 }
859 
861 {
862  if (m_at)
863  {
864  m_at->cancel();
865  m_at->wait();
866  delete m_at;
867  }
868 }
869 
870 
872  const QString &passthrough,
873  int channels,
874  const AudioOutputSettings &settings)
875 {
876  m_main = main;
877  m_passthrough = passthrough;
878  m_channels = channels;
879  m_settings = settings;
882  m_lfe->setEnabled(m_channels >= 6);
886 }
887 
889 {
890  if (this->sender() == m_startButton)
891  {
892  if (m_at && m_at->isRunning())
893  cancelTest();
894  else
895  {
896  prepareTest();
897  m_at->setChannel(-1);
898  m_at->start();
899  m_startButton->setLabel(QCoreApplication::translate("(Common)",
900  "Stop"));
901  }
902  return;
903  }
904  if (m_at && m_at->isRunning())
905  {
906  m_at->cancel();
907  m_at->wait();
908  }
909 
910  prepareTest();
911 
912  int channel = 1;
913 
914  if (this->sender() == m_frontleft)
915  channel = 0;
916  else if (this->sender() == m_frontright)
917  channel = (m_channels == 2) ? 1 : 2;
918  else if (this->sender() == m_rearleft)
919  channel = 5;
920  else if (this->sender() == m_rearright)
921  channel = 4;
922  else if (this->sender() == m_lfe)
923  channel = ((m_channels == 6) ? 5 :((m_channels == 7) ? 6 : 7));
924  else if (this->sender() == m_surroundleft)
925  channel = ((m_channels == 6) ? 4 : ((m_channels == 7) ? 5 : 6));
926  else if (this->sender() == m_surroundright)
927  channel = 3;
928  else if (this->sender() == m_center)
929  channel = 1;
930 
931  m_at->setChannel(channel);
932 
933  m_at->start();
934 }
935 
936 void AudioTest::togglequality(const QString &/*value*/)
937 {
938  cancelTest();
939  m_quality = m_hd->boolValue();
940 }
941 
943 {
944  if (m_at && m_at->isRunning())
945  {
946  m_at->cancel();
947  m_startButton->setLabel(tr("Test All"));
948  }
949 }
950 
952 {
953  cancelTest();
954  if (m_at)
955  {
956  m_at->cancel();
957  m_at->wait();
958  delete m_at;
959  }
960 
963  if (!m_at->result().isEmpty())
964  {
965  QString msg = tr("Audio device is invalid or not useable.");
967 
968  auto *mcd = new MythConfirmationDialog(mainStack,
969  msg, false);
970 
971  if (mcd->Create())
972  mainStack->AddScreen(mcd);
973  else
974  delete mcd;
975  }
976 }
977 
978 bool AudioTest::event(QEvent *event)
979 {
980  if (event->type() != ChannelChangedEvent::kEventType)
981  return QObject::event(event); //not handled
982 
983  auto *cce = dynamic_cast<ChannelChangedEvent*>(event);
984  if (cce == nullptr)
985  return GroupSetting::event(event);
986 
987  QString channel = cce->m_channel;
988 
989  if (!cce->m_fulltest)
990  return GroupSetting::event(event);
991 
992  bool fl = false;
993  bool fr = false;
994  bool c = false;
995  bool lfe = false;
996  bool sl = false;
997  bool sr = false;
998  bool rl = false;
999  bool rr = false;
1000 
1001  if (channel == "frontleft")
1002  {
1003  fl = true;
1004  }
1005  else if (channel == "frontright")
1006  {
1007  fr = true;
1008  }
1009  else if (channel == "center")
1010  {
1011  c = true;
1012  }
1013  else if (channel == "lfe")
1014  {
1015  lfe = true;
1016  }
1017  else if (channel == "surroundleft")
1018  {
1019  sl = true;
1020  }
1021  else if (channel == "surroundright")
1022  {
1023  sr = true;
1024  }
1025  else if (channel == "rearleft")
1026  {
1027  rl = true;
1028  }
1029  else if (channel == "rearright")
1030  {
1031  rr = true;
1032  }
1033  if (m_frontleft)
1034  m_frontleft->setEnabled(fl);
1035  if (m_frontright)
1036  m_frontright->setEnabled(fr);
1037  if (m_center)
1038  m_center->setEnabled(c);
1039  if (m_surroundleft)
1041  if (m_surroundright)
1043  if (m_rearleft)
1044  m_rearleft->setEnabled(rl);
1045  if (m_rearright)
1046  m_rearright->setEnabled(rr);
1047  if (m_lfe)
1048  m_lfe->setEnabled(lfe);
1049  return GroupSetting::event(event);
1050 }
1051 
1052 
1054 {
1055  auto *gc = new HostCheckBoxSetting("MythControlsVolume");
1056 
1057  gc->setLabel(tr("Use internal volume controls"));
1058 
1059  gc->setValue(true);
1060 
1061  gc->setHelpText(tr("If enabled, MythTV will control the PCM and "
1062  "master mixer volume. Disable this option if you "
1063  "prefer to control the volume externally (for "
1064  "example, using your amplifier) or if you use an "
1065  "external mixer program."));
1066 
1067  gc->addTargetedChild("1", MixerDevice());
1068  gc->addTargetedChild("1", MixerControl());
1069  gc->addTargetedChild("1", MixerVolume());
1070  gc->addTargetedChild("1", PCMVolume());
1071  return gc;
1072 }
1073 
1075 {
1076  auto *gc = new HostComboBoxSetting("MixerDevice", true);
1077  gc->setLabel(tr("Mixer device"));
1078 
1079 #ifdef USING_OSS
1080  QDir dev("/dev", "mixer*", QDir::Name, QDir::System);
1081  fillSelectionsFromDir(gc, dev);
1082 
1083  dev.setPath("/dev/sound");
1084  if (dev.exists())
1085  {
1086  fillSelectionsFromDir(gc, dev);
1087  }
1088 #endif
1089 #ifdef USING_ALSA
1090  gc->addSelection("ALSA:default", "ALSA:default");
1091 #endif
1092 #ifdef _WIN32
1093  gc->addSelection("DirectX:", "DirectX:");
1094  gc->addSelection("Windows:", "Windows:");
1095 #endif
1096 #ifdef Q_OS_ANDROID
1097  gc->addSelection("OpenSLES:", "OpenSLES:");
1098 #endif
1099 #if !defined(_WIN32)
1100  gc->addSelection(tr("software"), "software");
1101 #endif
1102 
1103  gc->setHelpText(tr("Setting the mixer device to \"%1\" lets MythTV control "
1104  "the volume of all audio at the expense of a slight "
1105  "quality loss.")
1106  .arg(tr("software")));
1107 
1108  return gc;
1109 }
1110 
1111 const std::array<const char *,2> AudioConfigSettings::kMixerControlControls
1112  {QT_TR_NOOP("PCM"),
1113  QT_TR_NOOP("Master")};
1114 
1116 {
1117  auto *gc = new HostComboBoxSetting("MixerControl", true);
1118 
1119  gc->setLabel(tr("Mixer controls"));
1120 
1121  for (const auto & control : kMixerControlControls)
1122  gc->addSelection(tr(control), control);
1123 
1124  gc->setHelpText(tr("Changing the volume adjusts the selected mixer."));
1125 
1126  return gc;
1127 }
1128 
1130 {
1131  auto *gs = new HostSpinBoxSetting("MasterMixerVolume", 0, 100, 1);
1132 
1133  gs->setLabel(tr("Master mixer volume"));
1134 
1135  gs->setValue(70);
1136 
1137  gs->setHelpText(tr("Initial volume for the Master mixer. This affects "
1138  "all sound created by the audio device. Note: Do not "
1139  "set this too low."));
1140  return gs;
1141 }
1142 
1144 {
1145  auto *gs = new HostSpinBoxSetting("PCMMixerVolume", 0, 100, 1);
1146 
1147  gs->setLabel(tr("PCM mixer volume"));
1148 
1149  gs->setValue(70);
1150 
1151  gs->setHelpText(tr("Initial volume for PCM output. Using the volume "
1152  "keys in MythTV will adjust this parameter."));
1153  return gs;
1154 }
1155 
1157 {
1158  auto *gc = new HostCheckBoxSetting("StereoPCM");
1159 
1160  gc->setLabel(tr("Stereo PCM Only"));
1161 
1162  gc->setValue(false);
1163 
1164  gc->setHelpText(tr("Enable if your amplifier or sound decoder only "
1165  "supports 2 channel PCM (typically an old HDMI 1.0 "
1166  "device). Multichannel audio will be re-encoded to "
1167  "AC-3 when required"));
1168  return gc;
1169 }
1170 
1172 {
1173  auto *gc = new HostCheckBoxSetting("SRCQualityOverride");
1174 
1175  gc->setLabel(tr("Override SRC quality"));
1176 
1177  gc->setValue(false);
1178 
1179  gc->setHelpText(tr("Enable to override audio sample rate "
1180  "conversion quality."));
1181  return gc;
1182 }
1183 
1185 {
1186  auto *gc = new HostComboBoxSetting("SRCQuality", false);
1187 
1188  gc->setLabel(tr("Sample rate conversion"));
1189 
1190  gc->addSelection(tr("Disabled", "Sample rate conversion"), "-1");
1191  gc->addSelection(tr("Fastest", "Sample rate conversion"), "0");
1192  gc->addSelection(tr("Good", "Sample rate conversion"), "1", true); // default
1193  gc->addSelection(tr("Best", "Sample rate conversion"), "2");
1194 
1195  gc->setHelpText(tr("Set the quality of audio sample-rate "
1196  "conversion. \"%1\" (default) provides the best "
1197  "compromise between CPU usage and quality. \"%2\" "
1198  "lets the audio device handle sample-rate conversion.")
1199  .arg(tr("Good", "Sample rate conversion"),
1200  tr("Disabled", "Sample rate conversion")));
1201 
1202  return gc;
1203 }
1204 
1206 {
1207  auto *gc = new HostCheckBoxSetting("Audio48kOverride");
1208 
1209  gc->setLabel(tr("Force audio device output to 48kHz"));
1210  gc->setValue(false);
1211 
1212  gc->setHelpText(tr("Force audio sample rate to 48kHz. Some audio devices "
1213  "will report various rates, but they ultimately "
1214  "crash."));
1215  return gc;
1216 }
1217 
1219 {
1220  auto *gc = new HostCheckBoxSetting("PassThruDeviceOverride");
1221 
1222  gc->setLabel(tr("Separate digital output device"));
1223 
1224  gc->setValue(false);
1225 
1226  gc->setHelpText(tr("Use a distinct digital output device from default. "
1227  "(default is not checked)"));
1228  return gc;
1229 }
1230 
1232 {
1233  auto *gc = new HostComboBoxSetting("PassThruOutputDevice",
1234  true);
1235 
1236  gc->setLabel(tr("Digital output device"));
1237  //TODO Is default not equivalent to PassThroughOverride off? if so
1238  //PassThruDeviceOverridedsetting could be removed
1239  gc->addSelection(QCoreApplication::translate("(Common)", "Default"),
1240  "Default");
1241 #ifdef _WIN32
1242  gc->addSelection("DirectX:Primary Sound Driver");
1243 #else
1244  gc->addSelection("ALSA:iec958:{ AES0 0x02 }",
1245  "ALSA:iec958:{ AES0 0x02 }");
1246  gc->addSelection("ALSA:hdmi", "ALSA:hdmi");
1247  gc->addSelection("ALSA:plughw:0,3", "ALSA:plughw:0,3");
1248 #endif
1249 
1250  gc->setHelpText(tr("Audio output device to use for digital audio. This "
1251  "value is currently only used with ALSA and DirectX "
1252  "sound output."));
1253  return gc;
1254 }
1255 
1257 {
1258  auto *gc = new HostCheckBoxSetting("SPDIFRateOverride");
1259 
1260  gc->setLabel(tr("SPDIF 48kHz rate override"));
1261 
1262  gc->setValue(false);
1263 
1264  gc->setHelpText(tr("ALSA only. By default, let ALSA determine the "
1265  "passthrough sampling rate. If checked set the sampling "
1266  "rate to 48kHz for passthrough. (default is not "
1267  "checked)"));
1268  return gc;
1269 }
1270 
1272 {
1273  auto *gc = new HostCheckBoxSetting("HBRPassthru");
1274 
1275  gc->setLabel(tr("HBR passthrough support"));
1276 
1277  gc->setValue(true);
1278 
1279  gc->setHelpText(tr("HBR support is required for TrueHD and DTS-HD "
1280  "passthrough. If unchecked, Myth will limit the "
1281  "passthrough bitrate to 6.144Mbit/s. This will "
1282  "disable True-HD passthrough, however will allow "
1283  "DTS-HD content to be sent as DTS-HD Hi-Res. (default "
1284  "is checked)"));
1285  return gc;
1286 }
1287 
1289 {
1290  m_mpcm->setEnabled(flag);
1291 }
1292 // vim:set sw=4 ts=4 expandtab:
AudioOutput::GetError
QString GetError(void) const
Definition: audiooutput.h:148
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:315
MythUIComboBoxSetting::clearSelections
void clearSelections()
Definition: standardsettings.cpp:514
AudioConfigSettings::m_lastAudioDevice
QString m_lastAudioDevice
Definition: audiogeneralsettings.h:115
bbciplayer.main
main
Definition: bbciplayer.py:259
AudioOutputSettings::IsSupportedChannels
bool IsSupportedChannels(int channels)
Definition: audiooutputsettings.cpp:244
AudioTest::togglequality
void togglequality(const QString &)
Definition: audiogeneralsettings.cpp:936
MThread::start
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
Definition: mthread.cpp:283
MythScreenType::SetBusyPopupMessage
void SetBusyPopupMessage(const QString &message)
Definition: mythscreentype.cpp:345
AudioTest::m_surroundleft
ButtonStandardSetting * m_surroundleft
Definition: audiogeneralsettings.h:192
AudioConfigSettings::Audio48kOverride
static HostCheckBoxSetting * Audio48kOverride()
Definition: audiogeneralsettings.cpp:1205
AudioConfigSettings::TrueHDPassThrough
static HostCheckBoxSetting * TrueHDPassThrough()
Definition: audiogeneralsettings.cpp:525
TransMythUICheckBoxSetting
Definition: standardsettings.h:411
AudioOutputSettings::BestSupportedRate
int BestSupportedRate()
Definition: audiooutputsettings.cpp:94
AudioConfigSettings::MixerControl
static HostComboBoxSetting * MixerControl()
Definition: audiogeneralsettings.cpp:1115
AudioConfigSettings::AudioRescan
void AudioRescan()
Definition: audiogeneralsettings.cpp:238
AudioConfigSettings::MaxAudioChannels
static HostComboBoxSetting * MaxAudioChannels()
Definition: audiogeneralsettings.cpp:437
AudioTestThread::AudioTestThread
AudioTestThread(QObject *parent, QString main, QString passthrough, int channels, AudioOutputSettings &settings, bool hd)
Definition: audiogeneralsettings.cpp:610
FORMAT_S16
@ FORMAT_S16
Definition: audiooutputsettings.h:27
AudioConfigSettings::kMixerControlControls
static const std::array< const char *, 2 > kMixerControlControls
Definition: audiogeneralsettings.h:116
audiooutpututil.h
AudioConfigSettings::AudioConfigSettings
AudioConfigSettings()
Definition: audiogeneralsettings.cpp:113
AudioTestThread::m_samplerate
int m_samplerate
Definition: audiogeneralsettings.h:173
AudioConfigSettings::m_slotLock
QMutex m_slotLock
Definition: audiogeneralsettings.h:112
AudioConfigSettings::m_audioDevs
ADCMap m_audioDevs
Definition: audiogeneralsettings.h:110
MThread::wait
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
Definition: mthread.cpp:300
AudioConfigSettings::SRCQualityOverride
static HostCheckBoxSetting * SRCQualityOverride()
Definition: audiogeneralsettings.cpp:1171
ButtonStandardSetting
Definition: standardsettings.h:450
AudioTestThread::m_device
QString m_device
Definition: audiogeneralsettings.h:168
AudioOutputUtil::GeneratePinkFrames
static char * GeneratePinkFrames(char *frames, int channels, int channel, int count, int bits=16)
Definition: audiooutpututil.cpp:193
AudioConfigSettings::UpdateVisibility
void UpdateVisibility(StandardSetting *)
Definition: audiogeneralsettings.cpp:267
AudioConfigSettings::MixerVolume
static HostSpinBoxSetting * MixerVolume()
Definition: audiogeneralsettings.cpp:1129
FEATURE_AC3
@ FEATURE_AC3
Definition: audiooutputsettings.h:36
AudioTest::m_quality
bool m_quality
Definition: audiogeneralsettings.h:203
AudioConfigSettings::m_passThroughDeviceOverride
HostComboBoxSetting * m_passThroughDeviceOverride
Definition: audiogeneralsettings.h:106
AudioTestThread::cancel
void cancel()
Definition: audiogeneralsettings.cpp:643
AudioTestThread::m_hd
bool m_hd
Definition: audiogeneralsettings.h:172
AudioConfigSettings::PassThroughOverride
static HostCheckBoxSetting * PassThroughOverride()
Definition: audiogeneralsettings.cpp:1218
AudioTest
Definition: audiogeneralsettings.h:177
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
StandardSettingDialog::GetGroupSettings
GroupSetting * GetGroupSettings(void) const
Definition: standardsettings.cpp:879
mythdbcon.h
AudioConfigSettings::m_trueHDPassThrough
HostCheckBoxSetting * m_trueHDPassThrough
Definition: audiogeneralsettings.h:101
FEATURE_TRUEHD
@ FEATURE_TRUEHD
Definition: audiooutputsettings.h:40
MythUIComboBoxSetting::edit
void edit(MythScreenType *screen) override
Definition: standardsettings.cpp:535
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MThread::RunProlog
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
Definition: mthread.cpp:196
AC3
@ AC3
Definition: element.h:84
StandardSetting::addTargetedChild
void addTargetedChild(const QString &value, StandardSetting *setting)
Definition: standardsettings.cpp:117
AudioDeviceComboBox
Definition: audiogeneralsettings.h:119
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
AudioConfigSettings::PCMVolume
static HostSpinBoxSetting * PCMVolume()
Definition: audiogeneralsettings.cpp:1143
AudioTest::m_frontleft
ButtonStandardSetting * m_frontleft
Definition: audiogeneralsettings.h:189
AudioTest::prepareTest
void prepareTest()
Definition: audiogeneralsettings.cpp:951
FEATURE_EAC3
@ FEATURE_EAC3
Definition: audiooutputsettings.h:39
GroupSetting::GroupSetting
GroupSetting()=default
AudioConfigSettings::UpdateAudioTest
void UpdateAudioTest()
Definition: audiogeneralsettings.cpp:591
AudioTest::m_passthrough
QString m_passthrough
Definition: audiogeneralsettings.h:201
AudioOutput::LengthLastData
virtual std::chrono::milliseconds LengthLastData(void) const
Definition: audiooutput.h:131
HostCheckBoxSetting
Definition: standardsettings.h:417
AudioConfigSettings::PassThroughOutputDevice
static HostComboBoxSetting * PassThroughOutputDevice()
Definition: audiogeneralsettings.cpp:1231
AudioTest::m_surroundright
ButtonStandardSetting * m_surroundright
Definition: audiogeneralsettings.h:193
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:14
StandardSetting::haveChanged
bool haveChanged()
Return true if the setting have changed or any of its children.
Definition: standardsettings.cpp:186
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95
AudioTest::m_hd
TransMythUICheckBoxSetting * m_hd
Definition: audiogeneralsettings.h:199
AudioOutput::OpenAudio
static AudioOutput * OpenAudio(const QString &main_device, const QString &passthru_device, AudioFormat format, int channels, AVCodecID codec, int samplerate, AudioOutputSource source, bool set_initial_vol, bool passthru, int upmixer_startup=0, AudioOutputSettings *custom=nullptr)
Definition: audiooutput.cpp:56
AudioConfigSettings::m_ac3PassThrough
HostCheckBoxSetting * m_ac3PassThrough
Definition: audiogeneralsettings.h:98
AudioOutput::Drain
virtual void Drain(void)=0
ButtonStandardSetting::clicked
void clicked()
AudioDeviceComboBox::AudioDeviceComboBox
AudioDeviceComboBox(AudioConfigSettings *parent)
Definition: audiogeneralsettings.cpp:35
AudioDeviceComboBox::edit
void edit(MythScreenType *screen) override
Definition: audiogeneralsettings.cpp:60
AudioConfigSettings::EAC3PassThrough
static HostCheckBoxSetting * EAC3PassThrough()
Definition: audiogeneralsettings.cpp:512
ChannelChangedEvent::ChannelChangedEvent
ChannelChangedEvent(QString channame, bool fulltest)
Definition: audiogeneralsettings.cpp:603
StandardSetting::setChanged
void setChanged(bool changed)
Definition: standardsettings.cpp:209
AudioConfigSettings::MPCM
static HostCheckBoxSetting * MPCM()
Definition: audiogeneralsettings.cpp:1156
AudioConfigSettings::HBRPassthrough
static HostCheckBoxSetting * HBRPassthrough()
Definition: audiogeneralsettings.cpp:1271
StandardSettingDialog
Definition: standardsettings.h:468
AudioTest::event
bool event(QEvent *event) override
Definition: audiogeneralsettings.cpp:978
StandardSetting::addChild
virtual void addChild(StandardSetting *child)
Definition: standardsettings.cpp:71
mythlogging.h
AudioTestThread::run
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: audiogeneralsettings.cpp:663
AudioConfigScreen::Load
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: audiogeneralsettings.cpp:97
AudioOutput::Pause
virtual void Pause(bool paused)=0
AudioConfigSettings::m_triggerDigital
GroupSetting * m_triggerDigital
Definition: audiogeneralsettings.h:97
AudioTestThread::setChannel
void setChannel(int channel)
Definition: audiogeneralsettings.cpp:658
AudioTestThread::m_channels
int m_channels
Definition: audiogeneralsettings.h:167
AudioConfigSettings::m_audioTest
AudioTest * m_audioTest
Definition: audiogeneralsettings.h:108
AudioTest::m_frontright
ButtonStandardSetting * m_frontright
Definition: audiogeneralsettings.h:190
AudioConfigSettings::MythControlsVolume
static HostCheckBoxSetting * MythControlsVolume()
Definition: audiogeneralsettings.cpp:1053
AudioOutputSettings::BestSupportedChannels
int BestSupportedChannels()
Definition: audiooutputsettings.cpp:254
AudioOutputSettings::canPassthrough
int canPassthrough() const
Definition: audiooutputsettings.h:77
FEATURE_DTS
@ FEATURE_DTS
Definition: audiooutputsettings.h:37
AudioTestThread::m_passthrough
QString m_passthrough
Definition: audiogeneralsettings.h:169
AudioConfigSettings::m_maxAudioChannels
HostComboBoxSetting * m_maxAudioChannels
Definition: audiogeneralsettings.h:92
StandardSetting::Load
virtual void Load(void)
Definition: standardsettings.cpp:214
MythUICheckBoxSetting::valueChanged
void valueChanged(bool)
AudioConfigSettings::m_mpcm
HostCheckBoxSetting * m_mpcm
Definition: audiogeneralsettings.h:104
AudioTestThread
Definition: audiogeneralsettings.h:147
AudioOutput::AudioDeviceConfig::m_settings
AudioOutputSettings m_settings
Definition: audiooutput.h:36
AudioConfigSettings::CheckConfiguration
void CheckConfiguration(void)
Definition: audiogeneralsettings.cpp:195
AudioTestThread::m_format
AudioFormat m_format
Definition: audiogeneralsettings.h:174
StandardSetting::setHelpText
virtual void setHelpText(const QString &str)
Definition: standardsettings.h:37
FEATURE_LPCM
@ FEATURE_LPCM
Definition: audiooutputsettings.h:38
AudioConfigSettings::m_devices
AudioOutput::ADCVect m_devices
Definition: audiogeneralsettings.h:111
AudioTest::~AudioTest
~AudioTest() override
Definition: audiogeneralsettings.cpp:860
MThread::RunEpilog
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
Definition: mthread.cpp:209
AudioOutput::GetAudioDeviceConfig
static AudioDeviceConfig * GetAudioDeviceConfig(QString &name, const QString &desc, bool willsuspendpa=false)
Definition: audiooutput.cpp:302
AudioConfigSettings::MixerDevice
static HostComboBoxSetting * MixerDevice()
Definition: audiogeneralsettings.cpp:1074
StandardSetting::getValue
virtual QString getValue(void) const
Definition: standardsettings.h:52
sizetliteral.h
AudioOutputSettings::canFeature
bool canFeature(DigitalFeature arg) const
return DigitalFeature mask.
Definition: audiooutputsettings.h:88
audiogeneralsettings.h
AudioConfigSettings::m_outputDevice
AudioDeviceComboBox * m_outputDevice
Definition: audiogeneralsettings.h:91
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:54
AudioConfigSettings::UpdateCapabilities
AudioOutputSettings UpdateCapabilities(bool restore=true, bool AC3=false)
Definition: audiogeneralsettings.cpp:277
AudioDeviceComboBox::m_parent
AudioConfigSettings * m_parent
Definition: audiogeneralsettings.h:132
AudioConfigSettings::setMPCMEnabled
void setMPCMEnabled(bool flag)
Definition: audiogeneralsettings.cpp:1288
AudioTestThread::m_interrupted
bool m_interrupted
Definition: audiogeneralsettings.h:170
AudioConfigSettings::AudioDeviceMap
ADCMap & AudioDeviceMap(void)
Definition: audiogeneralsettings.h:46
AudioOutputSettings::setFeature
void setFeature(DigitalFeature arg)
set the provided digital feature possible values are:
Definition: audiooutputsettings.h:125
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:910
AudioConfigSettings::AudioDeviceVect
AudioOutput::ADCVect & AudioDeviceVect(void)
Definition: audiogeneralsettings.h:47
AudioOutputSettings::IsInvalid
bool IsInvalid() const
return true if class instance is marked invalid.
Definition: audiooutputsettings.h:113
AudioConfigSettings::SRCQuality
static HostComboBoxSetting * SRCQuality()
Definition: audiogeneralsettings.cpp:1184
AudioConfigSettings::DTSPassThrough
static HostCheckBoxSetting * DTSPassThrough()
Definition: audiogeneralsettings.cpp:498
StandardSetting::setLabel
virtual void setLabel(QString str)
Definition: standardsettings.h:34
AudioConfigSettings::m_dtsPassThrough
HostCheckBoxSetting * m_dtsPassThrough
Definition: audiogeneralsettings.h:99
AudioTestThread::m_audioOutput
AudioOutput * m_audioOutput
Definition: audiogeneralsettings.h:166
AudioTestThread::~AudioTestThread
~AudioTestThread() override
Definition: audiogeneralsettings.cpp:636
AudioOutput::AudioDeviceConfig
Definition: audiooutput.h:31
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:904
AudioOutput::AddFrames
virtual bool AddFrames(void *buffer, int frames, std::chrono::milliseconds timecode)=0
Add frames to the audiobuffer for playback.
AudioConfigSettings::DTSHDPassThrough
static HostCheckBoxSetting * DTSHDPassThrough()
Definition: audiogeneralsettings.cpp:538
StandardSetting::valueChanged
void valueChanged(const QString &newValue)
AudioConfigScreen::AudioConfigScreen
AudioConfigScreen(MythScreenStack *parent, const char *name, GroupSetting *groupSetting)
Definition: audiogeneralsettings.cpp:91
AudioTest::toggle
void toggle()
Definition: audiogeneralsettings.cpp:888
StandardSetting::setEnabled
virtual void setEnabled(bool enabled)
Definition: standardsettings.cpp:48
HostSpinBoxSetting
Definition: standardsettings.h:364
MythUIComboBoxSetting::addSelection
void addSelection(const QString &label, QString value=QString(), bool select=false)
Definition: standardsettings.cpp:499
AudioTest::cancelTest
void cancelTest()
Definition: audiogeneralsettings.cpp:942
AudioTest::m_center
ButtonStandardSetting * m_center
Definition: audiogeneralsettings.h:191
AudioTest::UpdateCapabilities
void UpdateCapabilities(const QString &main, const QString &passthrough, int channels, const AudioOutputSettings &settings)
Definition: audiogeneralsettings.cpp:871
AudioConfigSettings::m_audioUpmixType
HostComboBoxSetting * m_audioUpmixType
Definition: audiogeneralsettings.h:94
AudioConfigSettings::UpdateCapabilitiesAC3
AudioOutputSettings UpdateCapabilitiesAC3(void)
Definition: audiogeneralsettings.cpp:427
AudioConfigSettings::AC3PassThrough
static HostCheckBoxSetting * AC3PassThrough()
Definition: audiogeneralsettings.cpp:484
ChannelChangedEvent
Definition: audiogeneralsettings.h:135
ChannelChangedEvent::kEventType
static Type kEventType
Definition: audiogeneralsettings.h:144
AUDIOOUTPUT_VIDEO
@ AUDIOOUTPUT_VIDEO
Definition: audiosettings.h:23
MythConfirmationDialog
Dialog asking for user confirmation. Ok and optional Cancel button.
Definition: mythdialogbox.h:272
mythcorecontext.h
AudioTestThread::m_parent
QObject * m_parent
Definition: audiogeneralsettings.h:165
StandardSettingDialog::Init
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
Definition: standardsettings.cpp:874
AudioTest::m_startButton
ButtonStandardSetting * m_startButton
Definition: audiogeneralsettings.h:198
AudioConfigSettings::AudioUpmix
static HostCheckBoxSetting * AudioUpmix()
Definition: audiogeneralsettings.cpp:454
AudioConfigSettings::m_passThroughOverride
HostCheckBoxSetting * m_passThroughOverride
Definition: audiogeneralsettings.h:105
AudioConfigSettings::m_eac3PassThrough
HostCheckBoxSetting * m_eac3PassThrough
Definition: audiogeneralsettings.h:100
std
Definition: mythchrono.h:23
AudioTest::m_at
AudioTestThread * m_at
Definition: audiogeneralsettings.h:197
AudioOutputSettings
Definition: audiooutputsettings.h:48
StandardSettingDialog::Load
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: standardsettings.cpp:865
AudioConfigSettings::m_maxSpeakers
int m_maxSpeakers
Definition: audiogeneralsettings.h:114
AudioConfigSettings
Definition: audiogeneralsettings.h:36
AudioTest::m_settings
AudioOutputSettings m_settings
Definition: audiogeneralsettings.h:202
HostComboBoxSetting
Definition: standardsettings.h:257
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
AudioTestThread::result
QString result()
Definition: audiogeneralsettings.cpp:648
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:102
MThread::isRunning
bool isRunning(void) const
Definition: mthread.cpp:263
AudioDeviceComboBox::AudioDescriptionHelp
void AudioDescriptionHelp(StandardSetting *setting)
Definition: audiogeneralsettings.cpp:85
AudioTest::m_main
QString m_main
Definition: audiogeneralsettings.h:200
AudioTest::m_rearleft
ButtonStandardSetting * m_rearleft
Definition: audiogeneralsettings.h:194
StandardSetting
Definition: standardsettings.h:29
AudioConfigScreen::Init
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
Definition: audiogeneralsettings.cpp:103
AudioConfigSettings::AudioUpmixType
static HostComboBoxSetting * AudioUpmixType()
Definition: audiogeneralsettings.cpp:468
AudioTest::m_lfe
ButtonStandardSetting * m_lfe
Definition: audiogeneralsettings.h:196
AudioOutputSettings::BestSupportedFormat
AudioFormat BestSupportedFormat()
Definition: audiooutputsettings.cpp:143
AudioTest::m_rearright
ButtonStandardSetting * m_rearright
Definition: audiogeneralsettings.h:195
AudioOutputSettings::SetBestSupportedChannels
void SetBestSupportedChannels(int channels)
Force set the greatest number of channels supported by the audio device.
Definition: audiooutputsettings.cpp:269
AudioTest::m_channels
int m_channels
Definition: audiogeneralsettings.h:188
AudioTest::AudioTest
AudioTest()
Definition: audiogeneralsettings.cpp:776
AudioConfigSettings::m_dtsHDPassThrough
HostCheckBoxSetting * m_dtsHDPassThrough
Definition: audiogeneralsettings.h:102
AudioOutput::ADCVect
QVector< AudioDeviceConfig > ADCVect
Definition: audiooutput.h:49
AudioTestThread::m_channel
int m_channel
Definition: audiogeneralsettings.h:171
mythmainwindow.h
AudioConfigSettings::Load
void Load() override
Definition: audiogeneralsettings.cpp:228
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
AudioConfigSettings::CheckPassthrough
bool CheckPassthrough()
Definition: audiogeneralsettings.cpp:551
FEATURE_DTSHD
@ FEATURE_DTSHD
Definition: audiooutputsettings.h:41
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:563
AudioConfigSettings::SPDIFRateOverride
static HostCheckBoxSetting * SPDIFRateOverride()
Definition: audiogeneralsettings.cpp:1256
AudioConfigSettings::m_audioUpmix
HostCheckBoxSetting * m_audioUpmix
Definition: audiogeneralsettings.h:93
fillSelectionsFromDir
static void fillSelectionsFromDir(HostComboBoxSetting *comboBox, const QDir &dir, bool absPath=true)
Definition: audiogeneralsettings.cpp:576
GroupSetting
Definition: standardsettings.h:435
AudioOutput::GetOutputList
static ADCVect * GetOutputList(void)
Definition: audiooutput.cpp:414
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:896
AudioDeviceComboBox::AudioRescan
void AudioRescan()
Definition: audiogeneralsettings.cpp:66
MythUICheckBoxSetting::boolValue
bool boolValue()
Definition: standardsettings.h:403