MythTV  0.28pre
programtypes.h
Go to the documentation of this file.
1 #ifndef _PROGRAM_INFO_TYPES_H_
2 #define _PROGRAM_INFO_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 // ANSI C
16 #include <stdint.h> // for [u]int[32,64]_t
17 
18 // C++ headers
19 #include <deque>
20 
21 // Qt headers
22 #include <QString>
23 #include <QMap>
24 #include <QHash>
25 #include <QtCore>
26 
27 // MythTV headers
28 #include "mythexp.h" // for MPUBLIC
29 #include "recordingtypes.h" // for RecordingType
30 
31 class QDateTime;
32 class QMutex;
33 
34 MPUBLIC extern const char *kPlayerInUseID;
35 MPUBLIC extern const char *kPIPPlayerInUseID;
36 MPUBLIC extern const char *kPBPPlayerInUseID;
37 MPUBLIC extern const char *kImportRecorderInUseID;
38 MPUBLIC extern const char *kRecorderInUseID;
39 MPUBLIC extern const char *kFileTransferInUseID;
40 MPUBLIC extern const char *kTruncatingDeleteInUseID;
41 MPUBLIC extern const char *kFlaggerInUseID;
42 MPUBLIC extern const char *kTranscoderInUseID;
43 MPUBLIC extern const char *kPreviewGeneratorInUseID;
44 MPUBLIC extern const char *kJobQueueInUseID;
45 MPUBLIC extern const char *kCCExtractorInUseID;
46 
48 typedef QMap<long long, long long> frm_pos_map_t;
49 
50 typedef enum {
51  MARK_ALL = -100,
52  MARK_UNSET = -10,
79 } MarkTypes;
80 MPUBLIC QString toString(MarkTypes type);
81 
83 typedef QMap<uint64_t, MarkTypes> frm_dir_map_t;
84 
85 typedef enum CommFlagStatuses {
91 
93 typedef enum SkipTypes {
96  COMM_DETECT_OFF = 0x00000000,
97  COMM_DETECT_BLANK = 0x00000001,
99  COMM_DETECT_SCENE = 0x00000002,
100  COMM_DETECT_LOGO = 0x00000004,
105  COMM_DETECT_2 = 0x00000100,
109  /* Scene detection doesn't seem to be too useful (in the USA); there *
110  * are just too many false positives from non-commercial cut scenes. */
112 
117 } SkipType;
118 
119 MPUBLIC QString SkipTypeToString(int);
120 MPUBLIC std::deque<int> GetPreferredSkipTypeCombinations(void);
121 
122 typedef enum TranscodingStatuses {
127 
132 typedef enum FlagMask {
133  FL_NONE = 0x00000000,
134  FL_COMMFLAG = 0x00000001,
135  FL_CUTLIST = 0x00000002,
136  FL_AUTOEXP = 0x00000004,
137  FL_EDITING = 0x00000008,
138  FL_BOOKMARK = 0x00000010,
139  FL_REALLYEDITING = 0x00000020,
140  FL_COMMPROCESSING = 0x00000040,
141  FL_DELETEPENDING = 0x00000080,
142  FL_TRANSCODED = 0x00000100,
143  FL_WATCHED = 0x00000200,
144  FL_PRESERVED = 0x00000400,
145  FL_CHANCOMMFREE = 0x00000800,
146  FL_REPEAT = 0x00001000,
147  FL_DUPLICATE = 0x00002000,
148  FL_REACTIVATE = 0x00004000,
149  FL_IGNOREBOOKMARK = 0x00008000,
150  FL_IGNOREPROGSTART = 0x00010000,
151  FL_ALLOWLASTPLAYPOS = 0x00020000,
152  // if you move the type mask please edit {Set,Get}ProgramInfoType()
153  FL_TYPEMASK = 0x00F00000,
154  FL_INUSERECORDING = 0x01000000,
155  FL_INUSEPLAYING = 0x02000000,
156  FL_INUSEOTHER = 0x04000000,
157 } ProgramFlag;
158 
159 typedef enum ProgramInfoType {
167 
170 typedef enum AudioProps {
171  AUD_UNKNOWN = 0x00, // For backwards compatibility do not change 0 or 1
172  AUD_STEREO = 0x01,
173  AUD_MONO = 0x02,
174  AUD_SURROUND = 0x04,
175  AUD_DOLBY = 0x08,
176  AUD_HARDHEAR = 0x10,
178 } AudioProperty; // has 6 bits in ProgramInfo::properties
179 #define kAudioPropertyBits 6
180 #define kAudioPropertyOffset 0
181 #define kAudioPropertyMask (0x3f<<kAudioPropertyOffset)
182 
185 typedef enum VideoProps {
186  // For backwards compatibility do not change 0 or 1
187  VID_UNKNOWN = 0x00,
188  VID_HDTV = 0x01,
190  VID_AVC = 0x04,
191  VID_720 = 0x08,
192  VID_1080 = 0x10,
193  VID_DAMAGED = 0x20,
194  VID_3DTV = 0x40,
195 } VideoProperty; // has 7 bits in ProgramInfo::properties
196 #define kVideoPropertyBits 7
197 #define kVideoPropertyOffset kAudioPropertyBits
198 #define kVideoPropertyMask (0x7f<<kVideoPropertyOffset)
199 
202 typedef enum SubtitleTypes {
203  // For backwards compatibility do not change 0 or 1
204  SUB_UNKNOWN = 0x00,
205  SUB_HARDHEAR = 0x01,
206  SUB_NORMAL = 0x02,
207  SUB_ONSCREEN = 0x04,
208  SUB_SIGNED = 0x08
209 } SubtitleType; // has 4 bits in ProgramInfo::properties
210 #define kSubtitlePropertyBits 4
211 #define kSubtitlePropertyOffset (kAudioPropertyBits+kVideoPropertyBits)
212 #define kSubtitlePropertyMask (0x0f<<kSubtitlePropertyOffset)
213 
214 class MPUBLIC RecStatus
215 {
216  Q_GADGET
217 
218  public:
219  Q_ENUMS(Type)
220 
221  enum Type {
222  Failing = -14,
223  //OtherRecording = -13, (obsolete)
224  //OtherTuning = -12, (obsolete)
225  MissedFuture = -11,
226  Tuning = -10,
227  Failed = -9,
228  TunerBusy = -8,
229  LowDiskSpace = -7,
230  Cancelled = -6,
231  Missed = -5,
232  Aborted = -4,
233  Recorded = -3,
234  Recording = -2,
235  WillRecord = -1,
236  Unknown = 0,
237  DontRecord = 1,
238  PreviousRecording = 2,
239  CurrentRecording = 3,
240  EarlierShowing = 4,
241  TooManyRecordings = 5,
242  NotListed = 6,
243  Conflict = 7,
244  LaterShowing = 8,
245  Repeat = 9,
246  Inactive = 10,
247  NeverRecord = 11,
248  Offline = 12
249  //OtherShowing = 13 (obsolete)
250  }; // note stored in int8_t in ProgramInfo
251 
252  static QString toUIState(Type);
253  static QString toString(Type, uint id);
254  static QString toString(Type, RecordingType type = kNotRecording);
255  static QString toDescription(Type, RecordingType,
256  const QDateTime &recstartts);
257 };
258 
259 typedef enum AvailableStatusTypes {
266 } AvailableStatusType; // note stored in uint8_t in ProgramInfo
267 MPUBLIC QString toString(AvailableStatusType);
268 
270  wlDeleted = -4,
271  wlEarlier = -3,
272  wlWatched = -2,
274 };
275 
276 typedef enum AutoExpireTypes {
282 
283 #endif // _PROGRAM_INFO_TYPES_H_
SkipTypes
This is used as a bitmask.
Definition: programtypes.h:93
AudioProps
if AudioProps changes, the audioprop column in program and recordedprogram has to changed accordingly...
Definition: programtypes.h:170
QString toDescription(RecordingType rectype)
Converts "rectype" into a human readable description.
SubtitleTypes
if SubtitleTypes changes, the subtitletypes column in program and recordedprogram has to changed acco...
Definition: programtypes.h:202
MPUBLIC const char * kTranscoderInUseID
ProgramInfoType
Definition: programtypes.h:159
MPUBLIC const char * kRecorderInUseID
Q_ENUMS(Type) enum Type
Definition: programtypes.h:219
MPUBLIC const char * kJobQueueInUseID
static bool Recording(const RecordingInfo *p)
Definition: scheduler.cpp:234
MPUBLIC const char * kFileTransferInUseID
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:83
unsigned int uint
Definition: compat.h:136
GLint GLenum GLsizei GLint GLenum GLenum type
MPUBLIC const char * kTruncatingDeleteInUseID
MPUBLIC const char * kCCExtractorInUseID
MPUBLIC const char * kPIPPlayerInUseID
MarkTypes
Definition: programtypes.h:50
MPUBLIC QString SkipTypeToString(int)
CommFlagStatuses
Definition: programtypes.h:85
enum SubtitleTypes SubtitleType
if SubtitleTypes changes, the subtitletypes column in program and recordedprogram has to changed acco...
TranscodingStatuses
Definition: programtypes.h:122
MPUBLIC std::deque< int > GetPreferredSkipTypeCombinations(void)
MPUBLIC const char * kFlaggerInUseID
MPUBLIC QString toString(MarkTypes type)
MPUBLIC const char * kPBPPlayerInUseID
enum TranscodingStatuses TranscodingStatus
VideoProps
if VideoProps changes, the videoprop column in program and recordedprogram has to changed accordingly...
Definition: programtypes.h:185
WatchListStatus
Definition: programtypes.h:269
enum CommFlagStatuses CommFlagStatus
enum VideoProps VideoProperty
if VideoProps changes, the videoprop column in program and recordedprogram has to changed accordingly...
enum AudioProps AudioProperty
if AudioProps changes, the audioprop column in program and recordedprogram has to changed accordingly...
MPUBLIC const char * kPreviewGeneratorInUseID
enum AvailableStatusTypes AvailableStatusType
enum FlagMask ProgramFlag
If you change these please update: mythplugins/mythweb/modules/tv/classes/Program.php mythtv/bindings/perl/MythTV/Program.pm (search for "Assign the program flags" in both)
enum AutoExpireTypes AutoExpireType
MPUBLIC const char * kPlayerInUseID
enum SkipTypes SkipType
This is used as a bitmask.
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:48
AutoExpireTypes
Definition: programtypes.h:276
AvailableStatusTypes
Definition: programtypes.h:259
deprecated, it is only 1:1 sample aspect ratio
Definition: programtypes.h:67
MPUBLIC const char * kImportRecorderInUseID
FlagMask
If you change these please update: mythplugins/mythweb/modules/tv/classes/Program.php mythtv/bindings/perl/MythTV/Program.pm (search for "Assign the program flags" in both)
Definition: programtypes.h:132