MythTV master
programtypes.h
Go to the documentation of this file.
1#ifndef PROGRAM_TYPES_H
2#define PROGRAM_TYPES_H
3
5//
6// WARNING
7//
8// The enums in this header are used for database values:
9// hence when removing something from these enums leave a gap,
10// and when adding a new value give it an explicit integer value.
11//
13
14// C++ headers
15#include <cstdint> // for [u]int[32,64]_t
16#include <deque>
17
18// Qt headers
19#include <QString>
20#include <QMap>
21#include <QHash>
22
23// MythTV headers
24#include "mythbaseexp.h" // for MBASE_PUBLIC
25#include "recordingtypes.h" // for RecordingType
26
27class QDateTime;
28class QMutex;
29
30MBASE_PUBLIC extern const QString kPlayerInUseID;
31MBASE_PUBLIC extern const QString kPIPPlayerInUseID;
32MBASE_PUBLIC extern const QString kPBPPlayerInUseID;
33MBASE_PUBLIC extern const QString kImportRecorderInUseID;
34MBASE_PUBLIC extern const QString kRecorderInUseID;
35MBASE_PUBLIC extern const QString kFileTransferInUseID;
36MBASE_PUBLIC extern const QString kTruncatingDeleteInUseID;
37MBASE_PUBLIC extern const QString kFlaggerInUseID;
38MBASE_PUBLIC extern const QString kTranscoderInUseID;
39MBASE_PUBLIC extern const QString kPreviewGeneratorInUseID;
40MBASE_PUBLIC extern const QString kJobQueueInUseID;
41MBASE_PUBLIC extern const QString kCCExtractorInUseID;
42
44using frm_pos_map_t = QMap<long long, long long>;
45
46enum MarkTypes : std::int16_t {
47 MARK_INVALID = -9999,
48 MARK_ALL = -100,
77};
78
80
81using stringMarkMap = std::map<QString, MarkTypes>;
83{
84 { "ALL", MARK_ALL },
85 { "UNSET", MARK_UNSET },
86 { "TMP_CUT_END", MARK_TMP_CUT_END },
87 { "TMP_CUT_START", MARK_TMP_CUT_START },
88 { "UPDATED_CUT", MARK_UPDATED_CUT },
89 { "PLACEHOLDER", MARK_PLACEHOLDER },
90 { "CUT_END", MARK_CUT_END },
91 { "CUT_START", MARK_CUT_START },
92 { "BOOKMARK", MARK_BOOKMARK },
93 { "BLANK_FRAME", MARK_BLANK_FRAME },
94 { "COMM_START", MARK_COMM_START },
95 { "COMM_END", MARK_COMM_END },
96 { "GOP_START", MARK_GOP_START },
97 { "KEYFRAME", MARK_KEYFRAME },
98 { "SCENE_CHANGE", MARK_SCENE_CHANGE },
99 { "GOP_BYFRAME", MARK_GOP_BYFRAME },
100 { "ASPECT_4_3", MARK_ASPECT_4_3 },
101 { "ASPECT_16_9", MARK_ASPECT_16_9 },
102 { "ASPECT_2_21_1", MARK_ASPECT_2_21_1 },
103 { "ASPECT_CUSTOM", MARK_ASPECT_CUSTOM },
104 { "PROGRESSIVE", MARK_SCAN_PROGRESSIVE },
105 { "VIDEO_WIDTH", MARK_VIDEO_WIDTH },
106 { "VIDEO_HEIGHT", MARK_VIDEO_HEIGHT },
107 { "VIDEO_RATE", MARK_VIDEO_RATE },
108 { "DURATION_MS", MARK_DURATION_MS },
109 { "TOTAL_FRAMES", MARK_TOTAL_FRAMES },
110 { "UTIL_PROGSTART", MARK_UTIL_PROGSTART },
111 { "UTIL_LASTPLAYPOS", MARK_UTIL_LASTPLAYPOS }
112};
113
114MBASE_PUBLIC MarkTypes markTypeFromString(const QString & str);
115
117using frm_dir_map_t = QMap<uint64_t, MarkTypes>;
118
119enum CommFlagStatus : std::uint8_t {
125
127enum SkipType : std::int16_t {
130 COMM_DETECT_OFF = 0x00000000,
131 COMM_DETECT_BLANK = 0x00000001,
133 COMM_DETECT_SCENE = 0x00000002,
134 COMM_DETECT_LOGO = 0x00000004,
139 COMM_DETECT_2 = 0x00000100,
143 /* Scene detection doesn't seem to be too useful (in the USA); there *
144 * are just too many false positives from non-commercial cut scenes. */
146
152
153MBASE_PUBLIC QString SkipTypeToString(int flags);
155
156enum TranscodingStatus : std::uint8_t {
161
162#define DEFINE_FLAGS_ENUM
163#include "programtypeflags.h"
164#undef DEFINE_FLAGS_ENUM
165
166enum ProgramInfoType : std::uint8_t {
173};
174
175enum AvailableStatusType : std::uint8_t {
182}; // note stored in uint8_t in ProgramInfo
184
185enum WatchListStatus : std::int8_t {
189 wlExpireOff = -1
191
196 kLiveTVAutoExpire = 10000
198
199#endif // PROGRAM_TYPES_H
unsigned short uint16_t
Definition: iso6937tables.h:3
#define MBASE_PUBLIC
Definition: mythbaseexp.h:15
MBASE_PUBLIC QString SkipTypeToString(int flags)
AvailableStatusType
Definition: programtypes.h:175
@ asAvailable
Definition: programtypes.h:176
@ asNotYetAvailable
Definition: programtypes.h:177
@ asZeroByte
Definition: programtypes.h:180
@ asPendingDelete
Definition: programtypes.h:178
@ asFileNotFound
Definition: programtypes.h:179
@ asDeleted
Definition: programtypes.h:181
MarkTypes
Definition: programtypes.h:46
@ MARK_ASPECT_4_3
Definition: programtypes.h:65
@ MARK_CUT_START
Definition: programtypes.h:55
@ MARK_INVALID
Definition: programtypes.h:47
@ MARK_SCAN_PROGRESSIVE
Definition: programtypes.h:69
@ MARK_KEYFRAME
Definition: programtypes.h:61
@ MARK_BOOKMARK
Definition: programtypes.h:56
@ MARK_UTIL_PROGSTART
Definition: programtypes.h:75
@ MARK_ASPECT_1_1
deprecated, it is only 1:1 sample aspect ratio
Definition: programtypes.h:64
@ MARK_TOTAL_FRAMES
Definition: programtypes.h:74
@ MARK_GOP_BYFRAME
Definition: programtypes.h:63
@ MARK_SCENE_CHANGE
Definition: programtypes.h:62
@ MARK_CUT_END
Definition: programtypes.h:54
@ MARK_ASPECT_2_21_1
Definition: programtypes.h:67
@ MARK_BLANK_FRAME
Definition: programtypes.h:57
@ MARK_UNSET
Definition: programtypes.h:49
@ MARK_VIDEO_RATE
Definition: programtypes.h:72
@ MARK_VIDEO_HEIGHT
Definition: programtypes.h:71
@ MARK_TMP_CUT_END
Definition: programtypes.h:50
@ MARK_UPDATED_CUT
Definition: programtypes.h:52
@ MARK_UTIL_LASTPLAYPOS
Definition: programtypes.h:76
@ MARK_ASPECT_16_9
Definition: programtypes.h:66
@ MARK_TMP_CUT_START
Definition: programtypes.h:51
@ MARK_PLACEHOLDER
Definition: programtypes.h:53
@ MARK_ALL
Definition: programtypes.h:48
@ MARK_VIDEO_WIDTH
Definition: programtypes.h:70
@ MARK_COMM_END
Definition: programtypes.h:59
@ MARK_COMM_START
Definition: programtypes.h:58
@ MARK_DURATION_MS
Definition: programtypes.h:73
@ MARK_ASPECT_CUSTOM
Definition: programtypes.h:68
@ MARK_GOP_START
Definition: programtypes.h:60
SkipType
This is used as a bitmask.
Definition: programtypes.h:127
@ COMM_DETECT_COMMFREE
Definition: programtypes.h:128
@ COMM_DETECT_BLANKS
Definition: programtypes.h:132
@ COMM_DETECT_SCENE
Definition: programtypes.h:133
@ COMM_DETECT_2_SCENE
Definition: programtypes.h:142
@ COMM_DETECT_2_LOGO
Definition: programtypes.h:140
@ COMM_DETECT_BLANK_SCENE
Definition: programtypes.h:135
@ COMM_DETECT_PREPOSTROLL
Definition: programtypes.h:147
@ COMM_DETECT_BLANK
Definition: programtypes.h:131
@ COMM_DETECT_PREPOSTROLL_ALL
Definition: programtypes.h:148
@ COMM_DETECT_2_ALL
Definition: programtypes.h:145
@ COMM_DETECT_ALL
Definition: programtypes.h:136
@ COMM_DETECT_2_BLANK
Definition: programtypes.h:141
@ COMM_DETECT_2
Definition: programtypes.h:139
@ COMM_DETECT_UNINIT
Definition: programtypes.h:129
@ COMM_DETECT_LOGO
Definition: programtypes.h:134
@ COMM_DETECT_OFF
Definition: programtypes.h:130
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:117
std::map< QString, MarkTypes > stringMarkMap
Definition: programtypes.h:81
MBASE_PUBLIC const QString kPlayerInUseID
MBASE_PUBLIC const QString kCCExtractorInUseID
ProgramInfoType
Definition: programtypes.h:166
@ kProgramInfoTypeVideoStreamingRTSP
Definition: programtypes.h:171
@ kProgramInfoTypeVideoDVD
Definition: programtypes.h:169
@ kProgramInfoTypeRecording
Definition: programtypes.h:167
@ kProgramInfoTypeVideoStreamingHTML
Definition: programtypes.h:170
@ kProgramInfoTypeVideoFile
Definition: programtypes.h:168
@ kProgramInfoTypeVideoBD
Definition: programtypes.h:172
MBASE_PUBLIC const QString kImportRecorderInUseID
MBASE_PUBLIC const QString kRecorderInUseID
MBASE_PUBLIC const QString kTruncatingDeleteInUseID
MBASE_PUBLIC MarkTypes markTypeFromString(const QString &str)
MBASE_PUBLIC const QString kJobQueueInUseID
AutoExpireType
Definition: programtypes.h:192
@ kLiveTVAutoExpire
Definition: programtypes.h:196
@ kDeletedAutoExpire
Definition: programtypes.h:195
@ kDisableAutoExpire
Definition: programtypes.h:193
@ kNormalAutoExpire
Definition: programtypes.h:194
MBASE_PUBLIC QString toString(MarkTypes type)
MBASE_PUBLIC const QString kTranscoderInUseID
MBASE_PUBLIC const QString kFlaggerInUseID
MBASE_PUBLIC const QString kPIPPlayerInUseID
static stringMarkMap MarkTypeStrings
Definition: programtypes.h:82
MBASE_PUBLIC std::deque< int > GetPreferredSkipTypeCombinations(void)
MBASE_PUBLIC const QString kPreviewGeneratorInUseID
CommFlagStatus
Definition: programtypes.h:119
@ COMM_FLAG_DONE
Definition: programtypes.h:121
@ COMM_FLAG_COMMFREE
Definition: programtypes.h:123
@ COMM_FLAG_NOT_FLAGGED
Definition: programtypes.h:120
@ COMM_FLAG_PROCESSING
Definition: programtypes.h:122
MBASE_PUBLIC const QString kFileTransferInUseID
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:44
TranscodingStatus
Definition: programtypes.h:156
@ TRANSCODING_COMPLETE
Definition: programtypes.h:158
@ TRANSCODING_RUNNING
Definition: programtypes.h:159
@ TRANSCODING_NOT_TRANSCODED
Definition: programtypes.h:157
MBASE_PUBLIC const QString kPBPPlayerInUseID
WatchListStatus
Definition: programtypes.h:185
@ wlDeleted
Definition: programtypes.h:186
@ wlEarlier
Definition: programtypes.h:187
@ wlWatched
Definition: programtypes.h:188
@ wlExpireOff
Definition: programtypes.h:189