MythTV master
programrecpriority.h
Go to the documentation of this file.
1#ifndef PROGRAMRECPROIRITY_H_
2#define PROGRAMRECPROIRITY_H_
3
4// C++
5#include <vector>
6
7// MythTV headers
10
11// MythFrontend
12#include "schedulecommon.h"
13
14class QDateTime;
15
18class MythUIText;
19class MythUIStateType;
21
22class RecordingRule;
23
24// overloaded version of RecordingInfo with additional recording priority
25// values so we can keep everything together and don't
26// have to hit the db mulitiple times
28{
29 friend class ProgramRecPriority;
30
31 public:
35 { if (this != &other) clone(other); return *this; }
37 { if (this != &other) clone(other); return *this; }
39 { if (this != &other) clone(other); return *this; }
40 virtual void clone(const ProgramRecPriorityInfo &other,
41 bool ignore_non_serialized_data = false);
42 void clone(const RecordingInfo &other,
43 bool ignore_non_serialized_data = false) override; // RecordingInfo
44 void clone(const ProgramInfo &other,
45 bool ignore_non_serialized_data = false) override; // RecordingInfo
46
47 void clear(void) override; // RecordingInfo
48
49 void ToMap(InfoMap &progMap,
50 bool showrerecord = false,
51 uint star_range = 10,
52 uint date_format = 0) const override; // ProgramInfo
53
55 int m_matchCount {0};
56 int m_recCount {0};
57 QDateTime m_last_record;
58 int m_avg_delay {0};
59 QString m_profile;
62};
63
65{
66 Q_OBJECT
67 public:
68 ProgramRecPriority(MythScreenStack *parent, const QString &name);
69 ~ProgramRecPriority() override = default;
70
71 bool Create(void) override; // MythScreenType
72 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
73 void customEvent(QEvent *event) override; // ScheduleCommon
74
75 enum SortType : std::uint8_t
76 {
84 };
85
86 protected slots:
88 void edit(MythUIButtonListItem *item) const;
89 void scheduleChanged(int recid);
90
91 private:
92 void Load(void) override; // MythScreenType
93 void Init(void) override; // MythScreenType
94
95 void FillList(void);
96 void SortList(ProgramRecPriorityInfo *newCurrentItem = nullptr);
97 void UpdateList();
99
100 void changeRecPriority(int howMuch);
101 void saveRecPriority(void);
102 void newTemplate(QString category);
103 void remove();
104 void deactivate();
105
106 void showMenu(void);
107 void showSortMenu(void);
108
109 ProgramInfo *GetCurrentProgram(void) const override; // ScheduleCommon
110
111 QMap<int, ProgramRecPriorityInfo> m_programData;
112 std::vector<ProgramRecPriorityInfo*> m_sortedProgram;
113 QMap<int, int> m_origRecPriorityData;
114
115 void countMatches(void);
116 QMap<int, int> m_conMatch;
117 QMap<int, int> m_nowMatch;
118 QMap<int, int> m_recMatch;
119 QMap<int, int> m_listMatch;
120
122
134
136
137 bool m_reverseSort {false};
138
140};
141
143
144#endif
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
This widget is used for grouping other widgets for display when a particular named state is called.
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
Holds information on recordings and videos.
Definition: programinfo.h:68
void clear(void) override
ProgramRecPriorityInfo(const ProgramRecPriorityInfo &)=default
ProgramRecPriorityInfo & operator=(const RecordingInfo &other)
ProgramRecPriorityInfo()=default
virtual void clone(const ProgramRecPriorityInfo &other, bool ignore_non_serialized_data=false)
void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10, uint date_format=0) const override
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
ProgramRecPriorityInfo & operator=(const ProgramRecPriorityInfo &other)
ProgramRecPriorityInfo & operator=(const ProgramInfo &other)
MythUIText * m_schedInfoText
ProgramInfo * GetCurrentProgram(void) const override
MythUIText * m_chanNameText
QMap< int, int > m_origRecPriorityData
void updateInfo(MythUIButtonListItem *item)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void edit(MythUIButtonListItem *item) const
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
MythUIText * m_lastRecordedTimeText
std::vector< ProgramRecPriorityInfo * > m_sortedProgram
void changeRecPriority(int howMuch)
~ProgramRecPriority() override=default
ProgramRecPriority(MythScreenStack *parent, const QString &name)
QMap< int, int > m_nowMatch
MythUIText * m_callSignText
MythUIText * m_recPriorityBText
MythUIButtonList * m_programList
QMap< int, int > m_conMatch
QMap< int, int > m_listMatch
MythUIText * m_finalPriorityText
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
void newTemplate(QString category)
void customEvent(QEvent *event) override
MythUIText * m_lastRecordedDateText
MythUIText * m_chanNumText
MythUIText * m_lastRecordedText
void scheduleChanged(int recid)
MythUIText * m_recPriorityText
QMap< int, ProgramRecPriorityInfo > m_programData
bool Create(void) override
QMap< int, int > m_recMatch
ProgramRecPriorityInfo * m_currentItem
void RemoveItemFromList(MythUIButtonListItem *item)
void SortList(ProgramRecPriorityInfo *newCurrentItem=nullptr)
MythUIText * m_recProfileText
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:36
Internal representation of a recording rule, mirrors the record table.
Definition: recordingrule.h:30
unsigned int uint
Definition: freesurround.h:24
Q_DECLARE_METATYPE(std::chrono::seconds)
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
RecordingType
@ kNotRecording