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 {
33 m_custom = nullptr;
34 }
35}
36
38 QString main_device,
39 QString passthru_device,
40 AudioFormat format,
41 int channels,
42 AVCodecID codec,
43 int samplerate,
44 AudioOutputSource source,
45 bool set_initial_vol,
46 bool use_passthru,
47 int upmixer_startup,
48 const AudioOutputSettings *custom) :
49 m_mainDevice(std::move(main_device)),
50 m_passthruDevice(std::move(passthru_device)),
51 m_format(format),
52 m_channels(channels),
53 m_codec(codec),
54 m_sampleRate(samplerate),
55 m_setInitialVol(set_initial_vol),
56 m_usePassthru(use_passthru),
57 m_source(source),
58 m_upmixer(upmixer_startup),
59 m_init(true)
60{
61 if (custom)
62 {
63 // make a copy of it
64 this->m_custom = new AudioOutputSettings;
65 *this->m_custom = *custom;
66 }
67 else
68 {
69 this->m_custom = nullptr;
70 }
71}
72
74 AudioFormat format,
75 int channels,
76 AVCodecID codec,
77 int samplerate,
78 bool use_passthru,
79 int upmixer_startup,
80 int codec_profile) :
81 m_format(format),
82 m_channels(channels),
83 m_codec(codec),
84 m_codecProfile(codec_profile),
85 m_sampleRate(samplerate),
86 m_usePassthru(use_passthru),
87 m_upmixer(upmixer_startup),
88 m_init(true)
89{
90}
91
93{
94 delete m_custom;
95}
96
98{
99 if (m_passthruDevice.isEmpty())
100 m_passthruDevice = "auto";
101}
102
104{
105 m_mainDevice.remove(0, 5);
106 if (m_passthruDevice != "auto" && m_passthruDevice.toLower() != "default")
107 m_passthruDevice.remove(0, 5);
108}
AudioOutputSource
Definition: audiosettings.h:21
QString m_mainDevice
Definition: audiosettings.h:70
void TrimDeviceType(void)
AudioSettings()=default
void FixPassThrough(void)
AudioOutputSettings * m_custom
custom contains a pointer to the audio device capabilities if defined, AudioOutput will not try to au...
Definition: audiosettings.h:92
QString m_passthruDevice
Definition: audiosettings.h:71
STL namespace.
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95