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