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  void swap(int indexA, int indexB);
282 
283  private slots:
284  void AddNewEntry(void);
285 
286  private:
287  void InitUI(StandardSetting *parent);
289 
290  private:
291  void ReloadSettings(void);
292  std::vector<MythVideoProfileItem> m_items;
293  std::vector<MythVideoProfileItem> m_delItems;
294  QString m_profileName;
296 
299  std::vector<PlaybackProfileItemConfig*> m_profiles;
300  std::vector<TransMythUISpinBoxSetting*> m_priority;
301 };
302 
304 {
305  Q_OBJECT
306 
307  public:
308  ChannelGroupSetting(const QString &groupName, int groupId);
309  void Load() override; // StandardSetting
310  void Save() override; // StandardSetting
311  bool canDelete(void) override; // GroupSetting
312  void deleteEntry(void) override; // GroupSetting
313 
314  public slots:
315  void LoadChannelGroup(void);
316  void LoadChannelGroupChannels(void);
317 
318  private:
319  int m_groupId {-1};
322  std::map<std::pair<int,uint>, TransMythUICheckBoxSetting *> m_boxMap;
323 };
324 
326 {
327  Q_OBJECT
328 
329  public:
331  void Load() override; // StandardSetting
332 
333  public slots:
334  void ShowNewGroupDialog(void) const;
335  void CreateNewGroup(const QString& name);
336 
337  private:
339 };
340 
341 #endif
PlaybackProfileConfig::InitUI
void InitUI(StandardSetting *parent)
Definition: globalsettings.cpp:1233
OSDSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(OSDSettings)
PlaybackProfileConfig::m_groupId
uint m_groupId
Definition: globalsettings.h:295
PlaybackProfileConfig::DeleteProfileItem
void DeleteProfileItem(PlaybackProfileItemConfig *profile)
Definition: globalsettings.cpp:1292
PlaybackProfileItemConfig::Load
void Load(void) override
Definition: globalsettings.cpp:896
TransMythUICheckBoxSetting
Definition: standardsettings.h:411
PlaybackProfileItemConfig::GetIndex
uint GetIndex(void) const
Definition: globalsettings.cpp:891
AppearanceSettings::m_display
MythDisplay * m_display
Definition: globalsettings.h:166
PlaybackSettings::NewPlaybackProfileSlot
void NewPlaybackProfileSlot(void) const
Definition: globalsettings.cpp:1375
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:55
PlaybackProfileConfig::m_addNewEntry
ButtonStandardSetting * m_addNewEntry
Definition: globalsettings.h:298
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:1070
HostRefreshRateComboBoxSetting::~HostRefreshRateComboBoxSetting
~HostRefreshRateComboBoxSetting() override=default
ChannelGroupsSetting
Definition: globalsettings.h:325
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:292
MythScreenStack
Definition: mythscreenstack.h:16
MainGeneralSettings::applyChange
void applyChange() override
Definition: globalsettings.cpp:4188
AppearanceSettings::m_screenAspect
HostComboBoxSetting * m_screenAspect
Definition: globalsettings.h:165
AppearanceSettings::applyChange
void applyChange() override
Definition: globalsettings.cpp:4641
HostRefreshRateComboBoxSetting::HostRefreshRateComboBoxSetting
HostRefreshRateComboBoxSetting(const QString &name)
Definition: globalsettings.h:174
VideoModeSettings
Definition: globalsettings.h:50
PlaybackSettingsDialog::ShowPlaybackProfileMenu
void ShowPlaybackProfileMenu(MythUIButtonListItem *item)
Definition: globalsettings.cpp:4274
PlaybackProfileItemConfig::m_vidRend
TransMythUIComboBoxSetting * m_vidRend
Definition: globalsettings.h:257
PlaybackProfileConfig::AddNewEntry
void AddNewEntry(void)
Definition: globalsettings.cpp:1305
PlaybackProfileItemConfig::heightChanged
void heightChanged(const QString &val)
Definition: globalsettings.cpp:1017
PlaybackProfileConfig::ReloadSettings
void ReloadSettings(void)
Definition: globalsettings.cpp:1313
PlaybackProfileConfig::InitProfileItem
StandardSetting * InitProfileItem(uint i, StandardSetting *parent)
Definition: globalsettings.cpp:1249
ChannelGroupSetting::m_groupName
TransTextEditSetting * m_groupName
Definition: globalsettings.h:320
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:1083
AppearanceSettings::~AppearanceSettings
~AppearanceSettings() override=default
MainGeneralSettings::MainGeneralSettings
MainGeneralSettings()
Definition: globalsettings.cpp:4095
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:4770
PlaybackSettingsDialog::ShowMenu
void ShowMenu(void) override
Definition: globalsettings.cpp:4262
PlaybackProfileConfig::m_profileName
QString m_profileName
Definition: globalsettings.h:294
MythUIButtonListItem
Definition: mythuibuttonlist.h:41
PlaybackSettingsDialog::DeleteProfileItem
void DeleteProfileItem(void)
Definition: globalsettings.cpp:4330
EPGSettings::EPGSettings
EPGSettings()
Definition: globalsettings.cpp:4548
ChannelGroupSetting
Definition: globalsettings.h:303
HostRefreshRateComboBoxSetting::GetRefreshRates
static std::vector< double > GetRefreshRates(const QString &resolution)
Definition: globalsettings.cpp:2446
StandardSettingDialog
Definition: standardsettings.h:468
ChannelGroupSetting::LoadChannelGroup
void LoadChannelGroup(void)
Definition: globalsettings.cpp:4851
VideoModeSettings::VideoModeSettings
VideoModeSettings(const char *c)
Definition: globalsettings.cpp:2545
PlaybackProfileConfig::m_priority
std::vector< TransMythUISpinBoxSetting * > m_priority
Definition: globalsettings.h:300
ChannelGroupsSetting::Load
void Load() override
Definition: globalsettings.cpp:4988
hardwareprofile.scan.profile
profile
Definition: scan.py:99
MythUIComboBoxSetting
Definition: standardsettings.h:218
GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings
GeneralRecPrioritiesSettings()
Definition: globalsettings.cpp:4556
ChannelGroupsSetting::ChannelGroupsSetting
ChannelGroupsSetting()
Definition: globalsettings.cpp:4983
ChannelGroupSetting::m_boxMap
std::map< std::pair< int, uint >, TransMythUICheckBoxSetting * > m_boxMap
Definition: globalsettings.h:322
PlaybackSettingsDialog::MoveProfileItemUp
void MoveProfileItemUp(void)
Definition: globalsettings.cpp:4313
ChannelGroupSetting::LoadChannelGroupChannels
void LoadChannelGroupChannels(void)
Definition: globalsettings.cpp:4875
HostRefreshRateComboBoxSetting
Definition: globalsettings.h:169
PlaybackProfileItemConfig::DecreasePriority
void DecreasePriority(void)
Definition: globalsettings.cpp:1187
PlaybackSettings::PlaybackSettings
PlaybackSettings()
Definition: globalsettings.cpp:4337
PlaybackProfileItemConfig::decoderChanged
void decoderChanged(const QString &dec)
Definition: globalsettings.cpp:1045
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:4296
PlaybackProfileItemConfig::m_framerate
TransTextEditSetting * m_framerate
Definition: globalsettings.h:253
PlaybackSettings::Load
void Load(void) override
Definition: globalsettings.cpp:4342
PlaybackProfileItemConfig::SingleQualityChanged
void SingleQualityChanged(const QString &Quality)
Definition: globalsettings.cpp:1076
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:299
AppearanceSettings::PopulateScreens
void PopulateScreens(int Screens)
Definition: globalsettings.cpp:4647
GeneralRecPrioritiesSettings
Definition: globalsettings.h:204
PlaybackProfileConfig::swap
void swap(int indexA, int indexB)
Definition: globalsettings.cpp:1329
PlaybackProfileConfig::m_markForDeletion
TransMythUICheckBoxSetting * m_markForDeletion
Definition: globalsettings.h:297
GeneralSettings
Definition: globalsettings.h:134
PlaybackSettingsDialog::PlaybackSettingsDialog
PlaybackSettingsDialog(MythScreenStack *stack)
Definition: globalsettings.cpp:4257
uint
unsigned int uint
Definition: compat.h:79
ChannelGroupsSetting::ShowNewGroupDialog
void ShowNewGroupDialog(void) const
Definition: globalsettings.cpp:5010
PlaybackSettings::m_newPlaybackProfileButton
ButtonStandardSetting * m_newPlaybackProfileButton
Definition: globalsettings.h:46
MythDisplay
Definition: mythdisplay.h:22
AppearanceSettings::AppearanceSettings
AppearanceSettings()
Definition: globalsettings.cpp:4660
PlaybackProfileItemConfig::m_doubleDeint
TransMythUIComboBoxSetting * m_doubleDeint
Definition: globalsettings.h:262
GeneralSettings::GeneralSettings
GeneralSettings()
Definition: globalsettings.cpp:4485
PlaybackProfileItemConfig::framerateChanged
void framerateChanged(const QString &val)
Definition: globalsettings.cpp:1031
ChannelGroupsSetting::m_addGroupButton
ButtonStandardSetting * m_addGroupButton
Definition: globalsettings.h:338
PlaybackProfileConfig
Definition: globalsettings.h:269
EPGSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(EPGSettings)
ChannelGroupSetting::m_groupSelection
HostComboBoxSetting * m_groupSelection
Definition: globalsettings.h:321
PlaybackProfileItemConfig::m_doubleDriver
TransMythUICheckBoxSetting * m_doubleDriver
Definition: globalsettings.h:264
HostRefreshRateComboBoxSetting::ChangeResolution
virtual void ChangeResolution(StandardSetting *setting)
Definition: globalsettings.cpp:2411
standardsettings.h
OSDSettings::OSDSettings
OSDSettings()
Definition: globalsettings.cpp:4463
PlaybackProfileItemConfig::m_singleDriver
TransMythUICheckBoxSetting * m_singleDriver
Definition: globalsettings.h:261
PlaybackProfileItemConfig::ShowDeleteDialog
void ShowDeleteDialog(void) const
Definition: globalsettings.cpp:1165
PlaybackProfileItemConfig::Save
void Save(void) override
Definition: globalsettings.cpp:986
ChannelGroupSetting::canDelete
bool canDelete(void) override
Definition: globalsettings.cpp:4960
PlaybackProfileItemConfig::DoDeleteSlot
void DoDeleteSlot(bool doDelete)
Definition: globalsettings.cpp:1181
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:1003
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:1128
LcdSettings
Definition: globalsettings.h:59
ChannelGroupSetting::m_groupId
int m_groupId
Definition: globalsettings.h:319
PlaybackProfileConfig::Save
void Save(void) override
Definition: globalsettings.cpp:1261
PlaybackProfileConfig::PlaybackProfileConfig
PlaybackProfileConfig(QString profilename, StandardSetting *parent)
Definition: globalsettings.cpp:1197
PlaybackSettings::CreateNewPlaybackProfileSlot
void CreateNewPlaybackProfileSlot(const QString &name)
Definition: globalsettings.cpp:1394
PlaybackProfileItemConfig::LoadQuality
static void LoadQuality(TransMythUIComboBoxSetting *Deint, TransMythUICheckBoxSetting *Shader, TransMythUICheckBoxSetting *Driver, QString &Value)
Parse the required deinterlacing quality and preferences.
Definition: globalsettings.cpp:1097
StandardSetting
Definition: standardsettings.h:29
PlaybackProfileItemConfig::InitLabel
void InitLabel(void)
Definition: globalsettings.cpp:1208
PlaybackProfileConfig::m_delItems
std::vector< MythVideoProfileItem > m_delItems
Definition: globalsettings.h:293
PlaybackProfileItemConfig::IncreasePriority
void IncreasePriority(void)
Definition: globalsettings.cpp:1192
ChannelGroupSetting::Load
void Load() override
Definition: globalsettings.cpp:4938
ChannelGroupSetting::deleteEntry
void deleteEntry(void) override
Definition: globalsettings.cpp:4966
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:2527
PlaybackProfileItemConfig::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Definition: globalsettings.cpp:1148
ChannelGroupSetting::ChannelGroupSetting
ChannelGroupSetting(const QString &groupName, int groupId)
Definition: globalsettings.cpp:4760
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:5028
PlaybackProfileItemConfig::m_item
MythVideoProfileItem & m_item
Definition: globalsettings.h:249
PlaybackProfileItemConfig::m_index
uint m_index
Definition: globalsettings.h:266