MythTV  master
audiosettings.cpp
Go to the documentation of this file.
1 /* -*- Mode: c++ -*-
2  *
3  * Copyright (C) Daniel Kristjansson 2008
4  *
5  * Licensed under the GPL v2 or a later version at your choosing.
6  */
7 
8 #include "audiosettings.h"
9 
10 // startup_upmixer
12  m_mainDevice(other.m_mainDevice),
13  m_passthruDevice(other.m_passthruDevice),
14  m_format(other.m_format),
15  m_channels(other.m_channels),
16  m_codec(other.m_codec),
17  m_codecProfile(other.m_codecProfile),
18  m_sampleRate(other.m_sampleRate),
19  m_setInitialVol(other.m_setInitialVol),
20  m_usePassthru(other.m_usePassthru),
21  m_source(other.m_source),
22  m_upmixer(other.m_upmixer),
23  m_init(true)
24 {
25  if (other.m_custom)
26  {
27  // make a copy of it
29  *m_custom = *other.m_custom;
30  }
31  else
32  m_custom = nullptr;
33 }
34 
36  QString main_device,
37  QString passthru_device,
38  AudioFormat format,
39  int channels,
40  AVCodecID codec,
41  int samplerate,
42  AudioOutputSource source,
43  bool set_initial_vol,
44  bool use_passthru,
45  int upmixer_startup,
46  AudioOutputSettings *custom) :
47  m_mainDevice(std::move(main_device)),
48  m_passthruDevice(std::move(passthru_device)),
49  m_format(format),
50  m_channels(channels),
51  m_codec(codec),
52  m_sampleRate(samplerate),
53  m_setInitialVol(set_initial_vol),
54  m_usePassthru(use_passthru),
55  m_source(source),
56  m_upmixer(upmixer_startup),
57  m_init(true)
58 {
59  if (custom)
60  {
61  // make a copy of it
62  this->m_custom = new AudioOutputSettings;
63  *this->m_custom = *custom;
64  }
65  else
66  this->m_custom = nullptr;
67 }
68 
70  AudioFormat format,
71  int channels,
72  AVCodecID codec,
73  int samplerate,
74  bool use_passthru,
75  int upmixer_startup,
76  int codec_profile) :
77  m_format(format),
78  m_channels(channels),
79  m_codec(codec),
80  m_codecProfile(codec_profile),
81  m_sampleRate(samplerate),
82  m_usePassthru(use_passthru),
83  m_upmixer(upmixer_startup),
84  m_init(true)
85 {
86 }
87 
89 {
90  delete m_custom;
91 }
92 
94 {
95  if (m_passthruDevice.isEmpty())
96  m_passthruDevice = "auto";
97 }
98 
100 {
101  m_mainDevice.remove(0, 5);
102  if (m_passthruDevice != "auto" && m_passthruDevice.toLower() != "default")
103  m_passthruDevice.remove(0, 5);
104 }
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
AudioSettings::FixPassThrough
void FixPassThrough(void)
Definition: audiosettings.cpp:93
AudioSettings::AudioSettings
AudioSettings()=default
AudioSettings
Definition: audiosettings.h:28
audiosettings.h
AudioSettings::m_mainDevice
QString m_mainDevice
Definition: audiosettings.h:70
AudioSettings::m_custom
AudioOutputSettings * m_custom
custom contains a pointer to the audio device capabilities if defined, AudioOutput will not try to au...
Definition: audiosettings.h:92
AudioSettings::m_passthruDevice
QString m_passthruDevice
Definition: audiosettings.h:71
std
Definition: mythchrono.h:23
AudioOutputSettings
Definition: audiooutputsettings.h:49
AudioOutputSource
AudioOutputSource
Definition: audiosettings.h:21
AudioSettings::TrimDeviceType
void TrimDeviceType(void)
Definition: audiosettings.cpp:99
AudioFormat
AudioFormat
Definition: audiooutputsettings.h:25
AudioSettings::~AudioSettings
~AudioSettings()
Definition: audiosettings.cpp:88