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