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