MythTV  master
programtypes.cpp
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 #include <QDateTime>
4 #include <QMutex>
5 #include <QObject>
6 
7 #include "programtypes.h"
8 #include "mythdate.h"
9 
10 #include <deque>
11 using std::deque;
12 
13 const char *kPlayerInUseID = "player";
14 const char *kPIPPlayerInUseID = "pipplayer";
15 const char *kPBPPlayerInUseID = "pbpplayer";
16 const char *kImportRecorderInUseID = "import_recorder";
17 const char *kRecorderInUseID = "recorder";
18 const char *kFileTransferInUseID = "filetransfer";
19 const char *kTruncatingDeleteInUseID = "truncatingdelete";
20 const char *kFlaggerInUseID = "flagger";
21 const char *kTranscoderInUseID = "transcoder";
22 const char *kPreviewGeneratorInUseID = "preview_generator";
23 const char *kJobQueueInUseID = "jobqueue";
24 const char *kCCExtractorInUseID = "ccextractor";
25 
27 {
28  switch (type)
29  {
30  case MARK_ALL: return "ALL";
31  case MARK_UNSET: return "UNSET";
32  case MARK_TMP_CUT_END: return "TMP_CUT_END";
33  case MARK_TMP_CUT_START:return "TMP_CUT_START";
34  case MARK_UPDATED_CUT: return "UPDATED_CUT";
35  case MARK_PLACEHOLDER: return "PLACEHOLDER";
36  case MARK_CUT_END: return "CUT_END";
37  case MARK_CUT_START: return "CUT_START";
38  case MARK_BOOKMARK: return "BOOKMARK";
39  case MARK_BLANK_FRAME: return "BLANK_FRAME";
40  case MARK_COMM_START: return "COMM_START";
41  case MARK_COMM_END: return "COMM_END";
42  case MARK_GOP_START: return "GOP_START";
43  case MARK_KEYFRAME: return "KEYFRAME";
44  case MARK_SCENE_CHANGE: return "SCENE_CHANGE";
45  case MARK_GOP_BYFRAME: return "GOP_BYFRAME";
46  case MARK_ASPECT_1_1: return "ASPECT_1_1 (depreciated)";
47  case MARK_ASPECT_4_3: return "ASPECT_4_3";
48  case MARK_ASPECT_16_9: return "ASPECT_16_9";
49  case MARK_ASPECT_2_21_1:return "ASPECT_2_21_1";
50  case MARK_ASPECT_CUSTOM:return "ASPECT_CUSTOM";
51  case MARK_VIDEO_WIDTH: return "VIDEO_WIDTH";
52  case MARK_VIDEO_HEIGHT: return "VIDEO_HEIGHT";
53  case MARK_VIDEO_RATE: return "VIDEO_RATE";
54  case MARK_DURATION_MS: return "DURATION_MS";
55  case MARK_TOTAL_FRAMES: return "TOTAL_FRAMES";
56  case MARK_UTIL_PROGSTART: return "UTIL_PROGSTART";
57  case MARK_UTIL_LASTPLAYPOS: return "UTIL_LASTPLAYPOS";
58  }
59 
60  return "unknown";
61 }
62 
64 {
65  switch (status)
66  {
67  case asAvailable: return "Available";
68  case asNotYetAvailable: return "NotYetAvailable";
69  case asPendingDelete: return "PendingDelete";
70  case asFileNotFound: return "FileNotFound";
71  case asZeroByte: return "ZeroByte";
72  case asDeleted: return "Deleted";
73  }
74  return QString("Unknown(%1)").arg((int)status);
75 }
76 
77 
78 QString SkipTypeToString(int flags)
79 {
80  if (COMM_DETECT_COMMFREE == flags)
81  return QObject::tr("Commercial Free");
82  if (COMM_DETECT_UNINIT == flags)
83  return QObject::tr("Use Global Setting");
84 
85  QChar chr = '0';
86  QString ret = QString("0x%1").arg(flags,3,16,chr);
87  bool blank = (COMM_DETECT_BLANK & flags) != 0;
88  bool scene = (COMM_DETECT_SCENE & flags) != 0;
89  bool logo = (COMM_DETECT_LOGO & flags) != 0;
90  bool exp = (COMM_DETECT_2 & flags) != 0;
91  bool prePst= (COMM_DETECT_PREPOSTROLL & flags) != 0;
92 
93  if (blank && scene && logo)
94  ret = QObject::tr("All Available Methods");
95  else if (blank && scene && !logo)
96  ret = QObject::tr("Blank Frame + Scene Change");
97  else if (blank && !scene && logo)
98  ret = QObject::tr("Blank Frame + Logo Detection");
99  else if (!blank && scene && logo)
100  ret = QObject::tr("Scene Change + Logo Detection");
101  else if (blank && !scene && !logo)
102  ret = QObject::tr("Blank Frame Detection");
103  else if (!blank && scene && !logo)
104  ret = QObject::tr("Scene Change Detection");
105  else if (!blank && !scene && logo)
106  ret = QObject::tr("Logo Detection");
107 
108  if (exp)
109  ret = QObject::tr("Experimental") + ": " + ret;
110  else if(prePst)
111  ret = QObject::tr("Pre & Post Roll") + ": " + ret;
112 
113  return ret;
114 }
115 
117 {
118  deque<int> tmp;
120  tmp.push_back(COMM_DETECT_BLANK);
122  tmp.push_back(COMM_DETECT_SCENE);
123  tmp.push_back(COMM_DETECT_LOGO);
127  return tmp;
128 }
129 
130 /* vim: set expandtab tabstop=4 shiftwidth=4: */
const char * kImportRecorderInUseID
const char * kCCExtractorInUseID
const char * kTruncatingDeleteInUseID
QString toString(MarkTypes type)
const char * kRecorderInUseID
const char * kPlayerInUseID
const char * kFlaggerInUseID
QString SkipTypeToString(int flags)
const char * kPreviewGeneratorInUseID
static guint32 * tmp
Definition: goom_core.c:35
MarkTypes
Definition: programtypes.h:48
const char * kPBPPlayerInUseID
const char * kJobQueueInUseID
const char * kPIPPlayerInUseID
const char * kTranscoderInUseID
deque< int > GetPreferredSkipTypeCombinations(void)
enum AvailableStatusTypes AvailableStatusType
const char * kFileTransferInUseID
deprecated, it is only 1:1 sample aspect ratio
Definition: programtypes.h:65