MythTV  master
globalsettings.h
Go to the documentation of this file.
1 #ifndef MYTHSETTINGS_H
2 #define MYTHSETTINGS_H
3 
4 #include <QStringList>
5 #include <QObject>
6 #include <QCoreApplication>
7 
8 #include "mythconfig.h"
9 #include "standardsettings.h"
10 #include "mythcontext.h"
11 #include "mythvideoprofile.h"
12 
13 #include <QMutex>
14 
15 class QFileInfo;
16 
18 {
19  Q_OBJECT
20 
21  public:
22  explicit PlaybackSettingsDialog(MythScreenStack *stack);
23  void ShowMenu(void) override; // StandardSettingDialog
24 
25  protected slots:
27  void DeleteProfileItem(void);
28  void MoveProfileItemDown(void);
29  void MoveProfileItemUp(void);
30 };
31 
33 {
34  Q_OBJECT
35 
36  public:
38  void Load(void) override; // StandardSetting
39 
40  private slots:
41  void NewPlaybackProfileSlot(void) const;
42  void CreateNewPlaybackProfileSlot(const QString &name);
43 
44  private:
47 };
48 
50 {
51  Q_OBJECT
52 
53  public:
54  explicit VideoModeSettings(const char *c);
55  void updateButton(MythUIButtonListItem *item) override;
56 };
57 
59 {
60  Q_DECLARE_TR_FUNCTIONS(LcdSettings)
61 };
62 
63 
65 {
66  Q_DECLARE_TR_FUNCTIONS(WatchListSettings)
67 };
68 
70 {
71  Q_DECLARE_TR_FUNCTIONS(ChannelGroupSettings)
72 };
73 
74 #if CONFIG_DARWIN
75 class MacMainSettings : public GroupSetting
76 {
77  Q_OBJECT
78 
79  public:
80  MacMainSettings();
81 };
82 
83 class MacFloatSettings : public GroupSetting
84 {
85  Q_OBJECT
86 
87  public:
88  MacFloatSettings();
89 };
90 
91 
92 class MacDockSettings : public GroupSetting
93 {
94  Q_OBJECT
95 
96  public:
97  MacDockSettings();
98 };
99 
100 
101 class MacDesktopSettings : public GroupSetting
102 {
103  Q_OBJECT
104 
105  public:
106  MacDesktopSettings();
107 };
108 #endif
109 
111 {
113 
114  public:
115  OSDSettings();
116 };
117 
119 {
121 
122  public:
123  GeneralSettings();
124 };
125 
126 class EPGSettings : public GroupSetting
127 {
129 
130  public:
131  EPGSettings();
132 };
133 
134 class MythDisplay;
136 {
137  Q_OBJECT
138 
139  public:
141  ~AppearanceSettings() override = default;
142  void applyChange() override; // GroupSetting
143 
144  public slots:
145  void PopulateScreens(int Screens);
146 
147  private:
150  MythDisplay *m_display { nullptr };
151 };
152 
154 {
155  Q_OBJECT
156 
157  public:
158  explicit HostRefreshRateComboBoxSetting(const QString &name) :
159  HostComboBoxSetting(name) { }
160  ~HostRefreshRateComboBoxSetting() override = default;
161 
162  public slots:
163  virtual void ChangeResolution(StandardSetting *setting);
164 
165  private:
166  static std::vector<double> GetRefreshRates(const QString &resolution);
167 };
168 
170 {
171  Q_OBJECT
172 
173  public:
175  void applyChange() override; // GroupSetting
176 
177 #ifdef USING_LIBCEC
178  public slots:
179  void cecChanged(bool setting);
180  protected:
181  HostCheckBoxSetting *m_cecPowerOnTVAllowed {nullptr};
182  HostCheckBoxSetting *m_cecPowerOffTVAllowed {nullptr};
183  HostCheckBoxSetting *m_cecPowerOnTVOnStart {nullptr};
184  HostCheckBoxSetting *m_cecPowerOffTVOnExit {nullptr};
185 #endif // USING_LIBCEC
186 };
187 
189 {
191 
192  public:
194 };
195 
198 {
199  Q_OBJECT
200 
201  public:
203  MythVideoProfileItem &_item);
204 
205  void Load(void) override; // StandardSetting
206  void Save(void) override; // StandardSetting
207 
208  bool keyPressEvent(QKeyEvent *e) override; // StandardSetting
209  uint GetIndex(void) const;
210  void ShowDeleteDialog(void) const;
211  void DecreasePriority(void);
212  void IncreasePriority(void);
213 
214  private slots:
215  void widthChanged(const QString &val);
216  void heightChanged(const QString &val);
217  void framerateChanged(const QString &val);
218  void decoderChanged(const QString &dec);
219  void vrenderChanged(const QString &renderer);
220  void SingleQualityChanged(const QString &Quality);
221  void DoubleQualityChanged(const QString &Quality);
222  static void LoadQuality(TransMythUIComboBoxSetting *Deint,
225  QString &Value);
226  static QString GetQuality(TransMythUIComboBoxSetting *Deint,
229  void InitLabel(void);
230  void DoDeleteSlot(bool doDelete);
231 
232  private:
251 };
252 
254 {
255  Q_OBJECT
256 
257  public:
258  PlaybackProfileConfig(QString profilename, StandardSetting *parent);
259  ~PlaybackProfileConfig() override = default;
260 
261  void Save(void) override; // StandardSetting
262 
264 
265  void swap(int indexA, int indexB);
266 
267  private slots:
268  void AddNewEntry(void);
269 
270  private:
271  void InitUI(StandardSetting *parent);
273 
274  private:
275  void ReloadSettings(void);
276  std::vector<MythVideoProfileItem> m_items;
277  std::vector<MythVideoProfileItem> m_delItems;
278  QString m_profileName;
280 
283  std::vector<PlaybackProfileItemConfig*> m_profiles;
284  std::vector<TransMythUISpinBoxSetting*> m_priority;
285 };
286 
288 {
289  Q_OBJECT
290 
291  public:
292  ChannelGroupSetting(const QString &groupName, int groupId);
293  void Load() override; // StandardSetting
294  void Save() override; // StandardSetting
295  bool canDelete(void) override; // GroupSetting
296  void deleteEntry(void) override; // GroupSetting
297 
298  private:
299  int m_groupId {-1};
301 };
302 
304 {
305  Q_OBJECT
306 
307  public:
309  void Load() override; // StandardSetting
310 
311  public slots:
312  void ShowNewGroupDialog(void) const;
313  void CreateNewGroup(const QString& name);
314 
315  private:
317 };
318 
319 #endif
PlaybackProfileConfig::InitUI
void InitUI(StandardSetting *parent)
Definition: globalsettings.cpp:1186
OSDSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(OSDSettings)
PlaybackProfileConfig::m_groupId
uint m_groupId
Definition: globalsettings.h:279
PlaybackProfileConfig::DeleteProfileItem
void DeleteProfileItem(PlaybackProfileItemConfig *profile)
Definition: globalsettings.cpp:1245
PlaybackProfileItemConfig::Load
void Load(void) override
Definition: globalsettings.cpp:849
TransMythUICheckBoxSetting
Definition: standardsettings.h:411
PlaybackProfileItemConfig::GetIndex
uint GetIndex(void) const
Definition: globalsettings.cpp:844
AppearanceSettings::m_display
MythDisplay * m_display
Definition: globalsettings.h:150
PlaybackSettings::NewPlaybackProfileSlot
void NewPlaybackProfileSlot(void) const
Definition: globalsettings.cpp:1328
PlaybackSettings::m_playbackProfiles
MythUIComboBoxSetting * m_playbackProfiles
Definition: globalsettings.h:46
PlaybackProfileItemConfig::m_heightRange
TransTextEditSetting * m_heightRange
Definition: globalsettings.h:235
PlaybackSettingsDialog
Definition: globalsettings.h:17
PlaybackProfileItemConfig::m_upscaler
TransMythUIComboBoxSetting * m_upscaler
Definition: globalsettings.h:242
MythVideoProfileItem
Definition: mythvideoprofile.h:55
PlaybackProfileConfig::m_addNewEntry
ButtonStandardSetting * m_addNewEntry
Definition: globalsettings.h:282
PlaybackProfileConfig::~PlaybackProfileConfig
~PlaybackProfileConfig() override=default
ChannelGroupSettings
Definition: globalsettings.h:69
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:1023
HostRefreshRateComboBoxSetting::~HostRefreshRateComboBoxSetting
~HostRefreshRateComboBoxSetting() override=default
ChannelGroupsSetting
Definition: globalsettings.h:303
PlaybackSettings
Definition: globalsettings.h:32
TransMythUISpinBoxSetting
Definition: standardsettings.h:353
PlaybackProfileItemConfig
Definition: globalsettings.h:197
PlaybackProfileConfig::m_items
std::vector< MythVideoProfileItem > m_items
Definition: globalsettings.h:276
MythScreenStack
Definition: mythscreenstack.h:16
MainGeneralSettings::applyChange
void applyChange() override
Definition: globalsettings.cpp:4159
AppearanceSettings::m_screenAspect
HostComboBoxSetting * m_screenAspect
Definition: globalsettings.h:149
AppearanceSettings::applyChange
void applyChange() override
Definition: globalsettings.cpp:4608
HostRefreshRateComboBoxSetting::HostRefreshRateComboBoxSetting
HostRefreshRateComboBoxSetting(const QString &name)
Definition: globalsettings.h:158
VideoModeSettings
Definition: globalsettings.h:49
PlaybackSettingsDialog::ShowPlaybackProfileMenu
void ShowPlaybackProfileMenu(MythUIButtonListItem *item)
Definition: globalsettings.cpp:4244
PlaybackProfileItemConfig::m_vidRend
TransMythUIComboBoxSetting * m_vidRend
Definition: globalsettings.h:241
PlaybackProfileConfig::AddNewEntry
void AddNewEntry(void)
Definition: globalsettings.cpp:1258
PlaybackProfileItemConfig::heightChanged
void heightChanged(const QString &val)
Definition: globalsettings.cpp:970
PlaybackProfileConfig::ReloadSettings
void ReloadSettings(void)
Definition: globalsettings.cpp:1266
PlaybackProfileConfig::InitProfileItem
StandardSetting * InitProfileItem(uint i, StandardSetting *parent)
Definition: globalsettings.cpp:1202
ChannelGroupSetting::m_groupName
TransTextEditSetting * m_groupName
Definition: globalsettings.h:300
PlaybackProfileItemConfig::m_singleDeint
TransMythUIComboBoxSetting * m_singleDeint
Definition: globalsettings.h:243
GeneralSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(GeneralSettings)
PlaybackProfileItemConfig::m_doubleShader
TransMythUICheckBoxSetting * m_doubleShader
Definition: globalsettings.h:247
PlaybackProfileItemConfig::m_decoder
TransMythUIComboBoxSetting * m_decoder
Definition: globalsettings.h:238
PlaybackProfileItemConfig::DoubleQualityChanged
void DoubleQualityChanged(const QString &Quality)
Definition: globalsettings.cpp:1036
AppearanceSettings::~AppearanceSettings
~AppearanceSettings() override=default
MainGeneralSettings::MainGeneralSettings
MainGeneralSettings()
Definition: globalsettings.cpp:4066
HostCheckBoxSetting
Definition: standardsettings.h:417
WatchListSettings
Definition: globalsettings.h:64
PlaybackProfileItemConfig::m_skipLoop
TransMythUICheckBoxSetting * m_skipLoop
Definition: globalsettings.h:240
OSDSettings
Definition: globalsettings.h:110
PlaybackProfileItemConfig::m_parentConfig
PlaybackProfileConfig * m_parentConfig
Definition: globalsettings.h:249
ChannelGroupSetting::Save
void Save() override
Definition: globalsettings.cpp:4717
PlaybackSettingsDialog::ShowMenu
void ShowMenu(void) override
Definition: globalsettings.cpp:4232
PlaybackProfileConfig::m_profileName
QString m_profileName
Definition: globalsettings.h:278
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
PlaybackSettingsDialog::DeleteProfileItem
void DeleteProfileItem(void)
Definition: globalsettings.cpp:4300
EPGSettings::EPGSettings
EPGSettings()
Definition: globalsettings.cpp:4516
ChannelGroupSetting
Definition: globalsettings.h:287
HostRefreshRateComboBoxSetting::GetRefreshRates
static std::vector< double > GetRefreshRates(const QString &resolution)
Definition: globalsettings.cpp:2417
StandardSettingDialog
Definition: standardsettings.h:468
VideoModeSettings::VideoModeSettings
VideoModeSettings(const char *c)
Definition: globalsettings.cpp:2516
PlaybackProfileConfig::m_priority
std::vector< TransMythUISpinBoxSetting * > m_priority
Definition: globalsettings.h:284
ChannelGroupsSetting::Load
void Load() override
Definition: globalsettings.cpp:4871
hardwareprofile.scan.profile
profile
Definition: scan.py:99
MythUIComboBoxSetting
Definition: standardsettings.h:218
GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings
GeneralRecPrioritiesSettings()
Definition: globalsettings.cpp:4524
ChannelGroupsSetting::ChannelGroupsSetting
ChannelGroupsSetting()
Definition: globalsettings.cpp:4866
PlaybackSettingsDialog::MoveProfileItemUp
void MoveProfileItemUp(void)
Definition: globalsettings.cpp:4283
HostRefreshRateComboBoxSetting
Definition: globalsettings.h:153
PlaybackProfileItemConfig::DecreasePriority
void DecreasePriority(void)
Definition: globalsettings.cpp:1140
PlaybackSettings::PlaybackSettings
PlaybackSettings()
Definition: globalsettings.cpp:4307
PlaybackProfileItemConfig::decoderChanged
void decoderChanged(const QString &dec)
Definition: globalsettings.cpp:998
PlaybackProfileItemConfig::m_codecs
MythUIComboBoxSetting * m_codecs
Definition: globalsettings.h:236
PlaybackProfileItemConfig::m_singleShader
TransMythUICheckBoxSetting * m_singleShader
Definition: globalsettings.h:244
PlaybackSettingsDialog::MoveProfileItemDown
void MoveProfileItemDown(void)
Definition: globalsettings.cpp:4266
PlaybackProfileItemConfig::m_framerate
TransTextEditSetting * m_framerate
Definition: globalsettings.h:237
PlaybackSettings::Load
void Load(void) override
Definition: globalsettings.cpp:4312
PlaybackProfileItemConfig::SingleQualityChanged
void SingleQualityChanged(const QString &Quality)
Definition: globalsettings.cpp:1029
PlaybackProfileItemConfig::m_maxCpus
TransMythUISpinBoxSetting * m_maxCpus
Definition: globalsettings.h:239
GeneralRecPrioritiesSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(GeneralRecPrioritiesSettings)
mythvideoprofile.h
PlaybackProfileConfig::m_profiles
std::vector< PlaybackProfileItemConfig * > m_profiles
Definition: globalsettings.h:283
AppearanceSettings::PopulateScreens
void PopulateScreens(int Screens)
Definition: globalsettings.cpp:4614
GeneralRecPrioritiesSettings
Definition: globalsettings.h:188
PlaybackProfileConfig::swap
void swap(int indexA, int indexB)
Definition: globalsettings.cpp:1282
PlaybackProfileConfig::m_markForDeletion
TransMythUICheckBoxSetting * m_markForDeletion
Definition: globalsettings.h:281
GeneralSettings
Definition: globalsettings.h:118
PlaybackSettingsDialog::PlaybackSettingsDialog
PlaybackSettingsDialog(MythScreenStack *stack)
Definition: globalsettings.cpp:4227
uint
unsigned int uint
Definition: compat.h:140
ChannelGroupsSetting::ShowNewGroupDialog
void ShowNewGroupDialog(void) const
Definition: globalsettings.cpp:4907
PlaybackSettings::m_newPlaybackProfileButton
ButtonStandardSetting * m_newPlaybackProfileButton
Definition: globalsettings.h:45
MythDisplay
Definition: mythdisplay.h:22
AppearanceSettings::AppearanceSettings
AppearanceSettings()
Definition: globalsettings.cpp:4627
PlaybackProfileItemConfig::m_doubleDeint
TransMythUIComboBoxSetting * m_doubleDeint
Definition: globalsettings.h:246
GeneralSettings::GeneralSettings
GeneralSettings()
Definition: globalsettings.cpp:4456
PlaybackProfileItemConfig::framerateChanged
void framerateChanged(const QString &val)
Definition: globalsettings.cpp:984
ChannelGroupsSetting::m_addGroupButton
ButtonStandardSetting * m_addGroupButton
Definition: globalsettings.h:316
PlaybackProfileConfig
Definition: globalsettings.h:253
EPGSettings::Q_DECLARE_TR_FUNCTIONS
Q_DECLARE_TR_FUNCTIONS(EPGSettings)
PlaybackProfileItemConfig::m_doubleDriver
TransMythUICheckBoxSetting * m_doubleDriver
Definition: globalsettings.h:248
HostRefreshRateComboBoxSetting::ChangeResolution
virtual void ChangeResolution(StandardSetting *setting)
Definition: globalsettings.cpp:2382
standardsettings.h
OSDSettings::OSDSettings
OSDSettings()
Definition: globalsettings.cpp:4434
PlaybackProfileItemConfig::m_singleDriver
TransMythUICheckBoxSetting * m_singleDriver
Definition: globalsettings.h:245
PlaybackProfileItemConfig::ShowDeleteDialog
void ShowDeleteDialog(void) const
Definition: globalsettings.cpp:1118
PlaybackProfileItemConfig::Save
void Save(void) override
Definition: globalsettings.cpp:939
ChannelGroupSetting::canDelete
bool canDelete(void) override
Definition: globalsettings.cpp:4843
PlaybackProfileItemConfig::DoDeleteSlot
void DoDeleteSlot(bool doDelete)
Definition: globalsettings.cpp:1134
EPGSettings
Definition: globalsettings.h:126
MainGeneralSettings
Definition: globalsettings.h:169
PlaybackProfileItemConfig::PlaybackProfileItemConfig
PlaybackProfileItemConfig(PlaybackProfileConfig *parent, uint idx, MythVideoProfileItem &_item)
Definition: globalsettings.cpp:689
PlaybackProfileItemConfig::widthChanged
void widthChanged(const QString &val)
Definition: globalsettings.cpp:956
PlaybackProfileItemConfig::m_widthRange
TransTextEditSetting * m_widthRange
Definition: globalsettings.h:234
AppearanceSettings
Definition: globalsettings.h:135
HostComboBoxSetting
Definition: standardsettings.h:257
mythcontext.h
PlaybackProfileItemConfig::GetQuality
static QString GetQuality(TransMythUIComboBoxSetting *Deint, TransMythUICheckBoxSetting *Shader, TransMythUICheckBoxSetting *Driver)
Definition: globalsettings.cpp:1081
LcdSettings
Definition: globalsettings.h:58
ChannelGroupSetting::m_groupId
int m_groupId
Definition: globalsettings.h:299
PlaybackProfileConfig::Save
void Save(void) override
Definition: globalsettings.cpp:1214
PlaybackProfileConfig::PlaybackProfileConfig
PlaybackProfileConfig(QString profilename, StandardSetting *parent)
Definition: globalsettings.cpp:1150
PlaybackSettings::CreateNewPlaybackProfileSlot
void CreateNewPlaybackProfileSlot(const QString &name)
Definition: globalsettings.cpp:1347
PlaybackProfileItemConfig::LoadQuality
static void LoadQuality(TransMythUIComboBoxSetting *Deint, TransMythUICheckBoxSetting *Shader, TransMythUICheckBoxSetting *Driver, QString &Value)
Parse the required deinterlacing quality and preferences.
Definition: globalsettings.cpp:1050
StandardSetting
Definition: standardsettings.h:29
PlaybackProfileItemConfig::InitLabel
void InitLabel(void)
Definition: globalsettings.cpp:1161
PlaybackProfileConfig::m_delItems
std::vector< MythVideoProfileItem > m_delItems
Definition: globalsettings.h:277
PlaybackProfileItemConfig::IncreasePriority
void IncreasePriority(void)
Definition: globalsettings.cpp:1145
ChannelGroupSetting::Load
void Load() override
Definition: globalsettings.cpp:4798
ChannelGroupSetting::deleteEntry
void deleteEntry(void) override
Definition: globalsettings.cpp:4849
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:2498
PlaybackProfileItemConfig::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Definition: globalsettings.cpp:1101
ChannelGroupSetting::ChannelGroupSetting
ChannelGroupSetting(const QString &groupName, int groupId)
Definition: globalsettings.cpp:4707
GroupSetting
Definition: standardsettings.h:435
AppearanceSettings::m_screen
HostComboBoxSetting * m_screen
Definition: globalsettings.h:148
ChannelGroupsSetting::CreateNewGroup
void CreateNewGroup(const QString &name)
Definition: globalsettings.cpp:4925
PlaybackProfileItemConfig::m_item
MythVideoProfileItem & m_item
Definition: globalsettings.h:233
PlaybackProfileItemConfig::m_index
uint m_index
Definition: globalsettings.h:250