MythTV  master
globalsettings.h
Go to the documentation of this file.
1 #ifndef MYTHSETTINGS_H
2 #define MYTHSETTINGS_H
3 
4 // Qt
5 #include <QtGlobal>
6 #include <QCoreApplication>
7 #include <QMutex>
8 #include <QObject>
9 #include <QStringList>
10 
11 // MythTV
12 #include "libmyth/mythcontext.h"
15 
16 class QFileInfo;
17 
19 {
20  Q_OBJECT
21 
22  public:
23  explicit PlaybackSettingsDialog(MythScreenStack *stack);
24  void ShowMenu(void) override; // StandardSettingDialog
25 
26  protected slots:
28  void DeleteProfileItem(void);
29  void MoveProfileItemDown(void);
30  void MoveProfileItemUp(void);
31 };
32 
34 {
35  Q_OBJECT
36 
37  public:
39  void Load(void) override; // StandardSetting
40 
41  private slots:
42  void NewPlaybackProfileSlot(void) const;
43  void CreateNewPlaybackProfileSlot(const QString &name);
44 
45  private:
48 };
49 
51 {
52  Q_OBJECT
53 
54  public:
55  explicit VideoModeSettings(const char *c);
56  void updateButton(MythUIButtonListItem *item) override;
57 };
58 
60 {
61  Q_DECLARE_TR_FUNCTIONS(LcdSettings)
62 };
63 
64 
66 {
67  Q_DECLARE_TR_FUNCTIONS(WatchListSettings)
68 };
69 
71 {
72  Q_DECLARE_TR_FUNCTIONS(ChannelGroupSettings)
73 };
74 
75 #ifdef Q_OS_DARWIN
76 class MacMainSettings : public GroupSetting
77 {
78 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
79  Q_OBJECT
80 #else
81  Q_DECLARE_TR_FUNCTIONS(MacMainSettings);
82 #endif
83  public:
84  MacMainSettings();
85 };
86 
87 class MacFloatSettings : public GroupSetting
88 {
89 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
90  Q_OBJECT
91 #else
92  Q_DECLARE_TR_FUNCTIONS(MacFloatSettings);
93 #endif
94 
95  public:
96  MacFloatSettings();
97 };
98 
99 
100 class MacDockSettings : public GroupSetting
101 {
102 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
103  Q_OBJECT
104 #else
105  Q_DECLARE_TR_FUNCTIONS(MacDockSettings);
106 #endif
107 
108  public:
109  MacDockSettings();
110 };
111 
112 
113 class MacDesktopSettings : public GroupSetting
114 {
115 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
116  Q_OBJECT
117 #else
118  Q_DECLARE_TR_FUNCTIONS(MacDesktopSettings);
119 #endif
120 
121  public:
122  MacDesktopSettings();
123 };
124 #endif // Q_OS_DARWIN
125 
127 {
129 
130  public:
131  OSDSettings();
132 };
133 
135 {
137 
138  public:
139  GeneralSettings();
140 };
141 
142 class EPGSettings : public GroupSetting
143 {
145 
146  public:
147  EPGSettings();
148 };
149 
150 class MythDisplay;
152 {
153  Q_OBJECT
154 
155  public:
157  ~AppearanceSettings() override = default;
158  void applyChange() override; // GroupSetting
159 
160  public slots:
161  void PopulateScreens(int Screens);
162 
163  private:
166  MythDisplay *m_display { nullptr };
167 };
168 
170 {
171  Q_OBJECT
172 
173  public:
174  explicit HostRefreshRateComboBoxSetting(const QString &name) :
175  HostComboBoxSetting(name) { }
176  ~HostRefreshRateComboBoxSetting() override = default;
177 
178  public slots:
179  virtual void ChangeResolution(StandardSetting *setting);
180 
181  private:
182  static std::vector<double> GetRefreshRates(const QString &resolution);
183 };
184 
186 {
187  Q_OBJECT
188 
189  public:
191  void applyChange() override; // GroupSetting
192 
193 #ifdef USING_LIBCEC
194  public slots:
195  void cecChanged(bool setting);
196  protected:
197  HostCheckBoxSetting *m_cecPowerOnTVAllowed {nullptr};
198  HostCheckBoxSetting *m_cecPowerOffTVAllowed {nullptr};
199  HostCheckBoxSetting *m_cecPowerOnTVOnStart {nullptr};
200  HostCheckBoxSetting *m_cecPowerOffTVOnExit {nullptr};
201 #endif // USING_LIBCEC
202 };
203 
205 {
207 
208  public:
210 };
211 
214 {
215  Q_OBJECT
216 
217  public:
219  MythVideoProfileItem &_item);
220 
221  void Load(void) override; // StandardSetting
222  void Save(void) override; // StandardSetting
223 
224  bool keyPressEvent(QKeyEvent *e) override; // StandardSetting
225  uint GetIndex(void) const;
226  void ShowDeleteDialog(void) const;
227  void DecreasePriority(void);
228  void IncreasePriority(void);
229 
230  private slots:
231  void widthChanged(const QString &val);
232  void heightChanged(const QString &val);
233  void framerateChanged(const QString &val);
234  void decoderChanged(const QString &dec);
235  void vrenderChanged(const QString &renderer);
236  void SingleQualityChanged(const QString &Quality);
237  void DoubleQualityChanged(const QString &Quality);
238  static void LoadQuality(TransMythUIComboBoxSetting *Deint,
241  QString &Value);
242  static QString GetQuality(TransMythUIComboBoxSetting *Deint,
245  void InitLabel(void);
246  void DoDeleteSlot(bool doDelete);
247 
248  private:
267 };
268 
270 {
271  Q_OBJECT
272 
273  public:
274  PlaybackProfileConfig(QString profilename, StandardSetting *parent);
275  ~PlaybackProfileConfig() override = default;
276 
277  void Save(void) override; // StandardSetting
278 
280 
281  // This function doesn't guarantee that no exceptions will be thrown.
282  void swap(int indexA, int indexB); // NOLINT(performance-noexcept-swap)
283 
284  private slots:
285  void AddNewEntry(void);
286 
287  private:
288  void InitUI(StandardSetting *parent);
290 
291  private:
292  void ReloadSettings(void);
293  std::vector<MythVideoProfileItem> m_items;
294  std::vector<MythVideoProfileItem> m_delItems;
295  QString m_profileName;
297 
300  std::vector<PlaybackProfileItemConfig*> m_profiles;
301  std::vector<TransMythUISpinBoxSetting*> m_priority;
302 };
303 
305 {
306  Q_OBJECT
307 
308  public:
309  ChannelGroupSetting(const QString &groupName, int groupId);
310  void Load() override; // StandardSetting
311  void Save() override; // StandardSetting
312  bool canDelete(void) override; // GroupSetting
313  void deleteEntry(void) override; // GroupSetting
314 
315  public slots:
316  void LoadChannelGroup(void);
317  void LoadChannelGroupChannels(void);
318 
319  private:
320  int m_groupId {-1};
323  std::map<std::pair<int,uint>, TransMythUICheckBoxSetting *> m_boxMap;
324 };
325 
327 {
328  Q_OBJECT
329 
330  public:
332  void Load() override; // StandardSetting
333 
334  public slots:
335  void ShowNewGroupDialog(void) const;
336  void CreateNewGroup(const QString& name);
337 
338  private:
340 };
341 
342 #endif
PlaybackProfileConfig::InitUI
void InitUI(StandardSetting *parent)
Definition: globalsettings.cpp:1237
OSDSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(OSDSettings)
PlaybackProfileConfig::m_groupId
uint m_groupId
Definition: globalsettings.h:296
PlaybackProfileConfig::DeleteProfileItem
void DeleteProfileItem(PlaybackProfileItemConfig *profile)
Definition: globalsettings.cpp:1296
PlaybackProfileItemConfig::Load
void Load(void) override
Definition: globalsettings.cpp:898
TransMythUICheckBoxSetting
Definition: standardsettings.h:411
PlaybackProfileItemConfig::GetIndex
uint GetIndex(void) const
Definition: globalsettings.cpp:893
AppearanceSettings::m_display
MythDisplay * m_display
Definition: globalsettings.h:166
PlaybackSettings::NewPlaybackProfileSlot
void NewPlaybackProfileSlot(void) const
Definition: globalsettings.cpp:1381
PlaybackSettings::m_playbackProfiles
MythUIComboBoxSetting * m_playbackProfiles
Definition: globalsettings.h:47
PlaybackProfileItemConfig::m_heightRange
TransTextEditSetting * m_heightRange
Definition: globalsettings.h:251
PlaybackSettingsDialog
Definition: globalsettings.h:18
PlaybackProfileItemConfig::m_upscaler
TransMythUIComboBoxSetting * m_upscaler
Definition: globalsettings.h:258
MythVideoProfileItem
Definition: mythvideoprofile.h:51
PlaybackProfileConfig::m_addNewEntry
ButtonStandardSetting * m_addNewEntry
Definition: globalsettings.h:299
PlaybackProfileConfig::~PlaybackProfileConfig
~PlaybackProfileConfig() override=default
ChannelGroupSettings
Definition: globalsettings.h:70
TransMythUIComboBoxSetting
Definition: standardsettings.h:272
TransTextEditSetting
Definition: standardsettings.h:161
ButtonStandardSetting
Definition: standardsettings.h:450
PlaybackProfileItemConfig::vrenderChanged
void vrenderChanged(const QString &renderer)
Definition: globalsettings.cpp:1072
HostRefreshRateComboBoxSetting::~HostRefreshRateComboBoxSetting
~HostRefreshRateComboBoxSetting() override=default
ChannelGroupsSetting
Definition: globalsettings.h:326
PlaybackSettings
Definition: globalsettings.h:33
TransMythUISpinBoxSetting
Definition: standardsettings.h:353
PlaybackProfileItemConfig
Definition: globalsettings.h:213
PlaybackProfileConfig::m_items
std::vector< MythVideoProfileItem > m_items
Definition: globalsettings.h:293
MythScreenStack
Definition: mythscreenstack.h:16
MainGeneralSettings::applyChange
void applyChange() override
Definition: globalsettings.cpp:4298
AppearanceSettings::m_screenAspect
HostComboBoxSetting * m_screenAspect
Definition: globalsettings.h:165
AppearanceSettings::applyChange
void applyChange() override
Definition: globalsettings.cpp:4752
HostRefreshRateComboBoxSetting::HostRefreshRateComboBoxSetting
HostRefreshRateComboBoxSetting(const QString &name)
Definition: globalsettings.h:174
VideoModeSettings
Definition: globalsettings.h:50
PlaybackSettingsDialog::ShowPlaybackProfileMenu
void ShowPlaybackProfileMenu(MythUIButtonListItem *item)
Definition: globalsettings.cpp:4384
PlaybackProfileItemConfig::m_vidRend
TransMythUIComboBoxSetting * m_vidRend
Definition: globalsettings.h:257
PlaybackProfileConfig::AddNewEntry
void AddNewEntry(void)
Definition: globalsettings.cpp:1309
PlaybackProfileItemConfig::heightChanged
void heightChanged(const QString &val)
Definition: globalsettings.cpp:1019
PlaybackProfileConfig::ReloadSettings
void ReloadSettings(void)
Definition: globalsettings.cpp:1317
PlaybackProfileConfig::InitProfileItem
StandardSetting * InitProfileItem(uint i, StandardSetting *parent)
Definition: globalsettings.cpp:1253
ChannelGroupSetting::m_groupName
TransTextEditSetting * m_groupName
Definition: globalsettings.h:321
PlaybackProfileItemConfig::m_singleDeint
TransMythUIComboBoxSetting * m_singleDeint
Definition: globalsettings.h:259
GeneralSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(GeneralSettings)
PlaybackProfileItemConfig::m_doubleShader
TransMythUICheckBoxSetting * m_doubleShader
Definition: globalsettings.h:263
PlaybackProfileItemConfig::m_decoder
TransMythUIComboBoxSetting * m_decoder
Definition: globalsettings.h:254
PlaybackProfileItemConfig::DoubleQualityChanged
void DoubleQualityChanged(const QString &Quality)
Definition: globalsettings.cpp:1085
AppearanceSettings::~AppearanceSettings
~AppearanceSettings() override=default
MainGeneralSettings::MainGeneralSettings
MainGeneralSettings()
Definition: globalsettings.cpp:4204
HostCheckBoxSetting
Definition: standardsettings.h:417
WatchListSettings
Definition: globalsettings.h:65
PlaybackProfileItemConfig::m_skipLoop
TransMythUICheckBoxSetting * m_skipLoop
Definition: globalsettings.h:256
OSDSettings
Definition: globalsettings.h:126
PlaybackProfileItemConfig::m_parentConfig
PlaybackProfileConfig * m_parentConfig
Definition: globalsettings.h:265
ChannelGroupSetting::Save
void Save() override
Definition: globalsettings.cpp:4884
PlaybackSettingsDialog::ShowMenu
void ShowMenu(void) override
Definition: globalsettings.cpp:4372
PlaybackProfileConfig::m_profileName
QString m_profileName
Definition: globalsettings.h:295
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
PlaybackSettingsDialog::DeleteProfileItem
void DeleteProfileItem(void)
Definition: globalsettings.cpp:4440
EPGSettings::EPGSettings
EPGSettings()
Definition: globalsettings.cpp:4659
ChannelGroupSetting
Definition: globalsettings.h:304
HostRefreshRateComboBoxSetting::GetRefreshRates
static std::vector< double > GetRefreshRates(const QString &resolution)
Definition: globalsettings.cpp:2498
StandardSettingDialog
Definition: standardsettings.h:468
ChannelGroupSetting::LoadChannelGroup
void LoadChannelGroup(void)
Definition: globalsettings.cpp:4935
VideoModeSettings::VideoModeSettings
VideoModeSettings(const char *c)
Definition: globalsettings.cpp:2597
PlaybackProfileConfig::m_priority
std::vector< TransMythUISpinBoxSetting * > m_priority
Definition: globalsettings.h:301
ChannelGroupsSetting::Load
void Load() override
Definition: globalsettings.cpp:5072
hardwareprofile.scan.profile
profile
Definition: scan.py:97
MythUIComboBoxSetting
Definition: standardsettings.h:218
GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings
GeneralRecPrioritiesSettings()
Definition: globalsettings.cpp:4667
ChannelGroupsSetting::ChannelGroupsSetting
ChannelGroupsSetting()
Definition: globalsettings.cpp:5067
ChannelGroupSetting::m_boxMap
std::map< std::pair< int, uint >, TransMythUICheckBoxSetting * > m_boxMap
Definition: globalsettings.h:323
PlaybackSettingsDialog::MoveProfileItemUp
void MoveProfileItemUp(void)
Definition: globalsettings.cpp:4423
ChannelGroupSetting::LoadChannelGroupChannels
void LoadChannelGroupChannels(void)
Definition: globalsettings.cpp:4959
HostRefreshRateComboBoxSetting
Definition: globalsettings.h:169
PlaybackProfileItemConfig::DecreasePriority
void DecreasePriority(void)
Definition: globalsettings.cpp:1191
PlaybackSettings::PlaybackSettings
PlaybackSettings()
Definition: globalsettings.cpp:4447
PlaybackProfileItemConfig::decoderChanged
void decoderChanged(const QString &dec)
Definition: globalsettings.cpp:1047
PlaybackProfileItemConfig::m_codecs
MythUIComboBoxSetting * m_codecs
Definition: globalsettings.h:252
PlaybackProfileItemConfig::m_singleShader
TransMythUICheckBoxSetting * m_singleShader
Definition: globalsettings.h:260
PlaybackSettingsDialog::MoveProfileItemDown
void MoveProfileItemDown(void)
Definition: globalsettings.cpp:4406
PlaybackProfileItemConfig::m_framerate
TransTextEditSetting * m_framerate
Definition: globalsettings.h:253
PlaybackSettings::Load
void Load(void) override
Definition: globalsettings.cpp:4452
PlaybackProfileItemConfig::SingleQualityChanged
void SingleQualityChanged(const QString &Quality)
Definition: globalsettings.cpp:1078
PlaybackProfileItemConfig::m_maxCpus
TransMythUISpinBoxSetting * m_maxCpus
Definition: globalsettings.h:255
GeneralRecPrioritiesSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(GeneralRecPrioritiesSettings)
mythvideoprofile.h
PlaybackProfileConfig::m_profiles
std::vector< PlaybackProfileItemConfig * > m_profiles
Definition: globalsettings.h:300
AppearanceSettings::PopulateScreens
void PopulateScreens(int Screens)
Definition: globalsettings.cpp:4758
GeneralRecPrioritiesSettings
Definition: globalsettings.h:204
PlaybackProfileConfig::swap
void swap(int indexA, int indexB)
Definition: globalsettings.cpp:1335
PlaybackProfileConfig::m_markForDeletion
TransMythUICheckBoxSetting * m_markForDeletion
Definition: globalsettings.h:298
GeneralSettings
Definition: globalsettings.h:134
PlaybackSettingsDialog::PlaybackSettingsDialog
PlaybackSettingsDialog(MythScreenStack *stack)
Definition: globalsettings.cpp:4367
uint
unsigned int uint
Definition: compat.h:81
ChannelGroupsSetting::ShowNewGroupDialog
void ShowNewGroupDialog(void) const
Definition: globalsettings.cpp:5094
PlaybackSettings::m_newPlaybackProfileButton
ButtonStandardSetting * m_newPlaybackProfileButton
Definition: globalsettings.h:46
MythDisplay
Definition: mythdisplay.h:22
AppearanceSettings::AppearanceSettings
AppearanceSettings()
Definition: globalsettings.cpp:4771
PlaybackProfileItemConfig::m_doubleDeint
TransMythUIComboBoxSetting * m_doubleDeint
Definition: globalsettings.h:262
GeneralSettings::GeneralSettings
GeneralSettings()
Definition: globalsettings.cpp:4596
PlaybackProfileItemConfig::framerateChanged
void framerateChanged(const QString &val)
Definition: globalsettings.cpp:1033
ChannelGroupsSetting::m_addGroupButton
ButtonStandardSetting * m_addGroupButton
Definition: globalsettings.h:339
PlaybackProfileConfig
Definition: globalsettings.h:269
EPGSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(EPGSettings)
ChannelGroupSetting::m_groupSelection
HostComboBoxSetting * m_groupSelection
Definition: globalsettings.h:322
PlaybackProfileItemConfig::m_doubleDriver
TransMythUICheckBoxSetting * m_doubleDriver
Definition: globalsettings.h:264
HostRefreshRateComboBoxSetting::ChangeResolution
virtual void ChangeResolution(StandardSetting *setting)
Definition: globalsettings.cpp:2463
standardsettings.h
OSDSettings::OSDSettings
OSDSettings()
Definition: globalsettings.cpp:4574
PlaybackProfileItemConfig::m_singleDriver
TransMythUICheckBoxSetting * m_singleDriver
Definition: globalsettings.h:261
PlaybackProfileItemConfig::ShowDeleteDialog
void ShowDeleteDialog(void) const
Definition: globalsettings.cpp:1167
PlaybackProfileItemConfig::Save
void Save(void) override
Definition: globalsettings.cpp:988
ChannelGroupSetting::canDelete
bool canDelete(void) override
Definition: globalsettings.cpp:5044
PlaybackProfileItemConfig::DoDeleteSlot
void DoDeleteSlot(bool doDelete)
Definition: globalsettings.cpp:1185
EPGSettings
Definition: globalsettings.h:142
MainGeneralSettings
Definition: globalsettings.h:185
PlaybackProfileItemConfig::PlaybackProfileItemConfig
PlaybackProfileItemConfig(PlaybackProfileConfig *parent, uint idx, MythVideoProfileItem &_item)
Definition: globalsettings.cpp:736
PlaybackProfileItemConfig::widthChanged
void widthChanged(const QString &val)
Definition: globalsettings.cpp:1005
PlaybackProfileItemConfig::m_widthRange
TransTextEditSetting * m_widthRange
Definition: globalsettings.h:250
AppearanceSettings
Definition: globalsettings.h:151
HostComboBoxSetting
Definition: standardsettings.h:257
mythcontext.h
PlaybackProfileItemConfig::GetQuality
static QString GetQuality(TransMythUIComboBoxSetting *Deint, TransMythUICheckBoxSetting *Shader, TransMythUICheckBoxSetting *Driver)
Definition: globalsettings.cpp:1130
LcdSettings
Definition: globalsettings.h:59
ChannelGroupSetting::m_groupId
int m_groupId
Definition: globalsettings.h:320
PlaybackProfileConfig::Save
void Save(void) override
Definition: globalsettings.cpp:1265
PlaybackProfileConfig::PlaybackProfileConfig
PlaybackProfileConfig(QString profilename, StandardSetting *parent)
Definition: globalsettings.cpp:1201
PlaybackSettings::CreateNewPlaybackProfileSlot
void CreateNewPlaybackProfileSlot(const QString &name)
Definition: globalsettings.cpp:1402
PlaybackProfileItemConfig::LoadQuality
static void LoadQuality(TransMythUIComboBoxSetting *Deint, TransMythUICheckBoxSetting *Shader, TransMythUICheckBoxSetting *Driver, QString &Value)
Parse the required deinterlacing quality and preferences.
Definition: globalsettings.cpp:1099
StandardSetting
Definition: standardsettings.h:29
PlaybackProfileItemConfig::InitLabel
void InitLabel(void)
Definition: globalsettings.cpp:1212
PlaybackProfileConfig::m_delItems
std::vector< MythVideoProfileItem > m_delItems
Definition: globalsettings.h:294
PlaybackProfileItemConfig::IncreasePriority
void IncreasePriority(void)
Definition: globalsettings.cpp:1196
ChannelGroupSetting::Load
void Load() override
Definition: globalsettings.cpp:5022
ChannelGroupSetting::deleteEntry
void deleteEntry(void) override
Definition: globalsettings.cpp:5050
VideoModeSettings::updateButton
void updateButton(MythUIButtonListItem *item) override
This method is called whenever the UI need to reflect a change Reimplement this If you widget need a ...
Definition: globalsettings.cpp:2579
PlaybackProfileItemConfig::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Definition: globalsettings.cpp:1150
ChannelGroupSetting::ChannelGroupSetting
ChannelGroupSetting(const QString &groupName, int groupId)
Definition: globalsettings.cpp:4874
GroupSetting
Definition: standardsettings.h:435
AppearanceSettings::m_screen
HostComboBoxSetting * m_screen
Definition: globalsettings.h:164
ChannelGroupsSetting::CreateNewGroup
void CreateNewGroup(const QString &name)
Definition: globalsettings.cpp:5112
PlaybackProfileItemConfig::m_item
MythVideoProfileItem & m_item
Definition: globalsettings.h:249
PlaybackProfileItemConfig::m_index
uint m_index
Definition: globalsettings.h:266