MythTV  master
scheduleeditor.h
Go to the documentation of this file.
1 #ifndef SCHEDULERECORDING_H_
2 #define SCHEDULERECORDING_H_
3 
4 #include "mythscreentype.h"
5 #include "schedulecommon.h"
6 
7 // libmythbase
8 #include "mythdb.h"
9 
10 // libmyth
11 #include "mythcontext.h"
12 
13 // libmythtv
14 #include "recordingrule.h"
15 #include "recordinginfo.h"
16 
17 // libmythmetadata
18 #include "metadatafactory.h"
19 
20 class ProgramInfo;
21 class MythUIText;
22 class MythUIButton;
23 class MythUIButtonList;
25 class MythUIStateType;
26 class MythUISpinBox;
27 class TV;
28 
29 class ScheduleEditor;
30 class SchedEditChild;
31 
33 {
34  protected:
36  SchedOptMixin *other = nullptr);
37  void SetRule(RecordingRule *rule) { m_rule = rule; };
38  void Create(bool *err);
39  void Load(void);
40  void Save(void);
41  void RuleChanged(void);
43 
52 
53  private:
55  RecordingRule *m_rule {nullptr};
56  SchedOptMixin *m_other {nullptr};
57  bool m_loaded {false};
58  bool m_haveRepeats {false};
59 };
60 
62 {
63  protected:
65  StoreOptMixin *other = nullptr)
66  : m_screen(&screen), m_rule(rule), m_other(other) {}
67  void SetRule(RecordingRule *rule) { m_rule = rule; };
68  void Create(bool *err);
69  void Load(void);
70  void Save(void);
71  void RuleChanged(void);
73  void PromptForRecGroup(void);
74  void SetRecGroup(int recgroupID, QString recgroup);
75 
76  static int CreateRecordingGroup(const QString &groupName);
77 
85 
86  private:
88  RecordingRule *m_rule {nullptr};
89  StoreOptMixin *m_other {nullptr};
90  bool m_loaded {false};
91 };
92 
94 {
95  protected:
97  PostProcMixin *other= nullptr)
98  : m_screen(&screen), m_rule(rule), m_other(other) {}
99  void SetRule(RecordingRule *rule) { m_rule = rule; };
100  void Create(bool *err);
101  void Load(void);
102  void Save(void);
103  void RuleChanged(void);
104  void TranscodeChanged(bool enable);
105 
114 
115  private:
117  RecordingRule *m_rule {nullptr};
118  PostProcMixin *m_other {nullptr};
119  bool m_loaded {false};
120 };
121 
123 {
124  protected:
126  FilterOptMixin *other = nullptr)
127  : m_screen(&screen), m_rule(rule), m_other(other) {}
128  void SetRule(RecordingRule *rule) { m_rule = rule; };
129  void Create(bool *err);
130  void Load(void);
131  void Save(void);
132  void RuleChanged(void);
133  static void ToggleSelected(MythUIButtonListItem *item);
134 
137 
138  private:
140  RecordingRule *m_rule {nullptr};
142  bool m_loaded {false};
143 
144  QStringList m_descriptions;
145 };
146 
148  public SchedOptMixin, public FilterOptMixin,
149  public StoreOptMixin, public PostProcMixin
150 {
151  Q_OBJECT
152  public:
153  ScheduleEditor(MythScreenStack *parent, RecordingInfo* recinfo,
154  TV *player = nullptr);
155  ScheduleEditor(MythScreenStack *parent, RecordingRule* recrule,
156  TV *player = nullptr);
157  ~ScheduleEditor();
158 
159  bool Create(void) override; // MythScreenType
160  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
161  void customEvent(QEvent *event) override; // ScheduleCommon
162 
163  void showMenu(void);
164  void showUpcomingByRule(void);
165  void showUpcomingByTitle(void);
166 
168  static void *RunScheduleEditor(ProgramInfo *proginfo, void *player = nullptr);
169 
170  signals:
171  void ruleSaved(int ruleId);
172  void ruleDeleted(int ruleId);
173  void templateLoaded(void);
174 
175  public slots:
176  void ShowSchedOpt(void);
177  void ShowFilters(void);
178  void ShowStoreOpt(void);
179  void ShowPostProc(void);
180  void ShowMetadataOptions(void);
181  void ShowPreviousView(void);
182  void ShowNextView(void);
183  void ShowPreview(void);
184  void Save(void);
185 
186  protected slots:
187  void RuleChanged(MythUIButtonListItem *item);
189  static void FilterChanged(MythUIButtonListItem *);
191  void PromptForRecGroup(void);
192  void TranscodeChanged(bool enable);
193  void ShowSchedInfo(void);
194  void ChildClosing(void);
195  void Close(void) override; // MythScreenType
196 
197  private:
199  void Load(void) override; // MythScreenType
200  void LoadTemplate(const QString& name);
201  void DeleteRule(void);
202 
203  void showTemplateMenu(void);
204 
205  ProgramInfo *GetCurrentProgram(void) const override // ScheduleCommon
206  { return m_recInfo; };
207 
210 
211  bool m_sendSig {false};
212 
215 
217 
225 
226  TV *m_player {nullptr};
227 
228  bool m_loaded {false};
229 
230  enum View
231  {
238  };
239 
242 };
243 
245 {
246  Q_OBJECT
247  protected:
248  SchedEditChild(MythScreenStack *parent, const QString &name,
249  ScheduleEditor &editor, RecordingRule &rule,
250  RecordingInfo *recinfo);
251  ~SchedEditChild() = default;
252 
253  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
254  virtual bool CreateEditChild(
255  const QString &xmlfile, const QString &winname, bool isTemplate);
256 
257  signals:
258  void Closing(void);
259 
260  public slots:
261  void Close(void) override; // MythScreenType
262  void Load(void) override = 0; // MythScreenType
263  virtual void Save(void) = 0;
264 
265  protected:
266  void SetTextFromMaps(void);
267 
271 
275 };
276 
278 {
279  Q_OBJECT
280  public:
282  RecordingRule &rule, RecordingInfo *recinfo);
283  ~SchedOptEditor() = default;
284 
285  bool Create(void) override; // MythScreenType
286 
287  protected slots:
289 
290  private:
291  void Load(void) override; // SchedEditChild
292  void Save(void) override; // SchedEditChild
293 
295 };
296 
298 {
299  Q_OBJECT
300  public:
302  RecordingRule &rule, RecordingInfo *recinfo);
303  ~SchedFilterEditor() = default;
304 
305  bool Create(void) override; // MythScreenType
306 
307  protected slots:
308  static void ToggleSelected(MythUIButtonListItem *item);
309 
310  private:
311  void Load(void) override; // SchedEditChild
312  void Save(void) override; // SchedEditChild
313 };
314 
316 {
317  Q_OBJECT
318  public:
320  RecordingRule &rule, RecordingInfo *recinfo);
321  ~StoreOptEditor() = default;
322 
323  bool Create(void) override; // MythScreenType
324  void customEvent(QEvent *event) override; // MythUIType
325 
326  protected slots:
328  void PromptForRecGroup(void);
329 
330  private:
331  void Load(void) override; // SchedEditChild
332  void Save(void) override; // SchedEditChild
333 };
334 
336 {
337  Q_OBJECT
338  public:
340  RecordingRule &rule, RecordingInfo *recinfo);
341  ~PostProcEditor() = default;
342 
343  bool Create(void) override; // MythScreenType
344 
345  protected slots:
346  void TranscodeChanged(bool enable);
347 
348  private:
349  void Load(void) override; // SchedEditChild
350  void Save(void) override; // SchedEditChild
351 };
352 
354 {
355  Q_OBJECT
356  public:
358  RecordingRule &rule, RecordingInfo *recinfo);
360 
361  bool Create(void) override; // MythScreenType
362 
363  protected slots:
364  void ClearInetref();
365  void PerformQuery();
366  void SelectLocalFanart();
367  void SelectLocalCoverart();
368  void SelectLocalBanner();
369  void SelectOnlineFanart();
370  void SelectOnlineCoverart();
371  void SelectOnlineBanner();
372  void QueryComplete(MetadataLookup *lookup);
374  void OnImageSearchListSelection(const ArtworkInfo& info,
376  void OnArtworkSearchDone(MetadataLookup *lookup);
378 
379  void ValuesChanged();
380 
381  private:
382  void Load(void) override; // SchedEditChild
383  void Save(void) override; // SchedEditChild
384 
385  void CreateBusyDialog(const QString& title);
386  static void FindImagePopup(const QString &prefix,
387  const QString &prefixAlt,
388  QObject &inst,
389  const QString &returnEvent);
390  static QStringList GetSupportedImageExtensionFilter();
391 
394 
395  bool CanSetArtwork(void);
396 
397  void customEvent(QEvent *event) override; // MythUIType
398 
399  // For all metadata downloads
401 
402  // For image picking
405 
408 
409  MythUIImage *m_fanart {nullptr};
411  MythUIImage *m_banner {nullptr};
412 
414 
417 
426 
428 };
429 
430 #endif
MetadataFactory * m_metadataFactory
This widget is used for grouping other widgets for display when a particular named state is called.
MythScreenType * m_screen
void Create(bool *err)
~SchedOptEditor()=default
void Save(void) override
MythUICheckBox * m_commflagCheck
void MaxEpisodesChanged(MythUIButtonListItem *)
ScheduleEditor(MythScreenStack *parent, RecordingInfo *recinfo, TV *player=nullptr)
Select post-processing options.
void ruleDeleted(int ruleId)
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
void showUpcomingByTitle(void)
void Save(void) override
MythUICheckBox * m_ruleactiveCheck
unsigned int slots[4]
Definition: element.c:38
void RuleChanged(void)
void DupMethodChanged(MythUIButtonListItem *)
MythUISpinBox * m_endoffsetSpin
MythUIButton * m_localFanartButton
Select schedule filters.
static void ToggleSelected(MythUIButtonListItem *item)
bool Create(void) override
Select artwork and inetref for recordings.
A widget for offering a range of numerical values where only the the bounding values and interval are...
Definition: mythuispinbox.h:16
void TranscodeChanged(bool enable)
RecordingRule * m_recordingRule
MythScreenType * m_screen
MythUIButtonList * m_filtersList
void showUpcomingByRule(void)
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
StoreOptMixin(MythScreenType &screen, RecordingRule *rule, StoreOptMixin *other=nullptr)
MetadataType
void Load(void) override
ArtworkMap m_artworkMap
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
MythUISpinBox * m_prioritySpin
PostProcEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
void templateLoaded(void)
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
static void FindImagePopup(const QString &prefix, const QString &prefixAlt, QObject &inst, const QString &returnEvent)
void MaxEpisodesChanged(MythUIButtonListItem *)
MythUIButtonList * m_playgroupList
void TranscodeChanged(bool enable)
void SetRule(RecordingRule *rule)
void Create(bool *err)
VideoArtworkType
MythUICheckBox * m_userjob4Check
MythUIButton * m_filtersButton
void customEvent(QEvent *event) override
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:34
static void ToggleSelected(MythUIButtonListItem *item)
RecordingInfo * m_recInfo
MythUIButton * m_schedOptButton
void showTemplateMenu(void)
SchedEditChild * m_child
void ShowSchedInfo(void)
Select schedule options.
void OnImageSearchListSelection(const ArtworkInfo &info, VideoArtworkType type)
void SetRule(RecordingRule *rule)
SchedEditChild(MythScreenStack *parent, const QString &name, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
MythUITextEdit * m_inetrefEdit
void DeleteRule(void)
bool Create(void) override
Mixin for schedule options.
void Load(void) override
RecordingRule * m_recordingRule
MetadataLookup * CreateLookup(MetadataType mtype)
MythUICheckBox * m_metadataLookupCheck
MythUIImage * m_fanart
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void MaxEpisodesChanged(MythUIButtonListItem *)
MythUIButton * m_cancelButton
MythScreenType * m_screen
MythUIButton * m_onlineFanartButton
ProgramInfo * GetCurrentProgram(void) const override
Holds information on recordings and videos.
Definition: programinfo.h:66
RecordingRule * m_rule
void OnArtworkSearchDone(MetadataLookup *lookup)
~SchedEditChild()=default
Select storage options.
MythUIButton * m_metadataButton
MythUIButton * m_inetrefClear
void Load(void) override
MythUICheckBox * m_transcodeCheck
void DupMethodChanged(MythUIButtonListItem *)
MythUIButton * m_saveButton
RecordingRule * m_rule
MythUIButtonList * m_storagegroupList
static void FilterChanged(MythUIButtonListItem *)
void ruleSaved(int ruleId)
Mixin for Filters.
MythUIButton * m_filtersButton
MythUIImage * m_coverart
bool Create(void) override
Construct a recording schedule.
void RuleChanged(void)
MythUICheckBox * m_autoexpireCheck
A text entry and edit widget.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void Create(bool *err)
PostProcMixin(MythScreenType &screen, RecordingRule *rule, PostProcMixin *other=nullptr)
MythUIButtonList * m_inputList
MythUIButton * m_backButton
void ShowPostProc(void)
void customEvent(QEvent *event) override
StoreOptEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
MythUIButton * m_schedInfoButton
Control TV playback.
Definition: tv_play.h:284
RecordingRule * m_rule
MythUIButton * m_saveButton
FilterOptMixin(MythScreenType &screen, RecordingRule *rule, FilterOptMixin *other=nullptr)
virtual bool CreateEditChild(const QString &xmlfile, const QString &winname, bool isTemplate)
Mixin for storage options.
void SetRule(RecordingRule *rule)
bool Create(void) override
void Closing(void)
void FindNetArt(VideoArtworkType type)
void Save(void) override
void CreateBusyDialog(const QString &title)
MythUIBusyDialog * m_busyPopup
Internal representation of a recording rule, mirrors the record table.
Definition: recordingrule.h:32
~SchedFilterEditor()=default
void SetRecGroup(int recgroupID, QString recgroup)
bool Create(void) override
const char * name
Definition: ParseText.cpp:328
void ShowSchedOpt(void)
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void ShowFilters(void)
FilterOptMixin * m_other
void ShowMetadataOptions(void)
void Save(void) override
MythUIButton * m_localBannerButton
MythUIButton * m_previewButton
RecordingRule * m_rule
MythUIButtonList * m_newrepeatList
RecordingInfo * m_recInfo
Q_DISABLE_COPY(ScheduleEditor)
void PromptForRecGroup(void)
MythUIButton * m_postProcButton
void ChildClosing(void)
~StoreOptEditor()=default
~PostProcEditor()=default
A single button widget.
Definition: mythuibutton.h:21
void Create(bool *err)
static QStringList GetSupportedImageExtensionFilter()
MythScreenType * m_screen
MythUIImage * m_banner
MetadataDownload * m_imageLookup
void PromptForRecGroup(void)
MythUISpinBox * m_startoffsetSpin
void Load(void) override
MythUISpinBox * m_seasonSpin
MythUIButton * m_onlineBannerButton
MythUIButtonList * m_transcodeprofileList
void TranscodeChanged(bool enable)
void DupMethodChanged(MythUIButtonListItem *item)
MythUICheckBox * m_userjob3Check
void QueryComplete(MetadataLookup *lookup)
void RuleChanged(void)
void ShowStoreOpt(void)
MythUIButton * m_onlineCoverartButton
SchedOptMixin(MythScreenType &screen, RecordingRule *rule, SchedOptMixin *other=nullptr)
void showMenu(void)
MythUICheckBox * m_userjob2Check
MythUIButtonList * m_maxbehaviourList
void SetRule(RecordingRule *rule)
MythUIButton * m_previewButton
QStringList m_descriptions
MythScreenStack * m_popupStack
bool CanSetArtwork(void)
SchedFilterEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
MythUIButtonList * m_dupscopeList
void Close(void) override
MythUICheckBox * m_userjob1Check
void Load(void) override=0
MythUIButton * m_queryButton
void Load(void) override
MetadataImageDownload * m_imageDownload
MythUIButton * m_localCoverartButton
void PromptForRecGroup(void)
MythUIButtonList * m_dupmethodList
Screen in which all other widgets are contained and rendered.
void Save(void) override
MythUISpinBox * m_maxepSpin
ScheduleEditor * m_editor
MythUIButtonList * m_activeFiltersList
MythUISpinBox * m_episodeSpin
QMultiMap< VideoArtworkType, ArtworkInfo > ArtworkMap
virtual void Save(void)=0
void ShowNextView(void)
MythUIButton * m_storeOptButton
static void * RunScheduleEditor(ProgramInfo *proginfo, void *player=nullptr)
Callback.
StoreOptMixin * m_other
void ShowPreviousView(void)
void OnSearchListSelection(const RefCountHandler< MetadataLookup > &lookup)
MythUIButtonList * m_recprofileList
MetadataOptions(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
PostProcMixin * m_other
static int CreateRecordingGroup(const QString &groupName)
SchedOptMixin * m_other
MythUIButtonList * m_recgroupList
void ShowPreview(void)
Mixin for post processing.
void LoadTemplate(const QString &name)
MythUIButtonList * m_rulesList
void Close(void) override
SchedOptEditor(MythScreenStack *parent, ScheduleEditor &editor, RecordingRule &rule, RecordingInfo *recinfo)
void SetTextFromMaps(void)
bool Create(void) override
void RuleChanged(void)
void customEvent(QEvent *event) override
void HandleDownloadedImages(MetadataLookup *lookup)