MythTV master
recordingstatus.h
Go to the documentation of this file.
1#ifndef RECORDING_STATUS_H_
2#define RECORDING_STATUS_H_
3
4#include <QString>
5#include <QDateTime>
6
7#include "mythbaseexp.h"
8#include "programtypes.h"
9
10class MBASE_PUBLIC RecStatus : public QObject
11{
12 Q_OBJECT
13
14 public:
15 // NOLINTNEXTLINE(performance-enum-size)
16 enum Type {
17 Pending = -15,
18 Failing = -14,
19 //OtherRecording = -13, (obsolete)
20 //OtherTuning = -12, (obsolete)
21 MissedFuture = -11,
22 Tuning = -10,
23 Failed = -9,
24 TunerBusy = -8,
25 LowDiskSpace = -7,
26 Cancelled = -6,
27 Missed = -5,
28 Aborted = -4,
29 Recorded = -3,
31 WillRecord = -1,
32 Unknown = 0,
33 DontRecord = 1,
34 PreviousRecording = 2,
35 CurrentRecording = 3,
36 EarlierShowing = 4,
37 TooManyRecordings = 5,
38 NotListed = 6,
39 Conflict = 7,
40 LaterShowing = 8,
41 Repeat = 9,
42 Inactive = 10,
43 NeverRecord = 11,
44 Offline = 12
45 //OtherShowing = 13 (obsolete)
46 }; // note stored in int8_t in ProgramInfo
47 Q_ENUM(Type)
48
49 static QString toUIState(RecStatus::Type recstatus);
50 static QString toString(RecStatus::Type recstatus, uint id);
51 static QString toString(RecStatus::Type recstatus, const QString &name);
52 static QString toString(RecStatus::Type recstatus, RecordingType type = kNotRecording);
53 static QString toDescription(Type recstatus, RecordingType rectype,
54 const QDateTime &recstartts);
55 public:
56
57 static inline void InitializeCustomTypes();
58
59 Q_INVOKABLE explicit RecStatus(QObject *parent = nullptr) : QObject(parent) {}
60
61 private:
62 Q_DISABLE_COPY(RecStatus)
63};
64
66{
67 qRegisterMetaType< RecStatus* >();
68}
69
70#endif // RECORDING_STATUS_H_
Q_INVOKABLE RecStatus(QObject *parent=nullptr)
static void InitializeCustomTypes()
unsigned int uint
Definition: freesurround.h:24
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:93
QString toDescription(RecordingType rectype)
Converts "rectype" into a human readable description.
RecordingType
@ kNotRecording
static bool Recording(const RecordingInfo *p)
Definition: scheduler.cpp:222