MythTV  master
videoouttypes.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 #ifndef _VIDEOOUT_TYPES_H_
4 #define _VIDEOOUT_TYPES_H_
5 
6 #include <QString>
7 #include <QObject>
8 #include <QSize>
9 
10 typedef enum PIPState
11 {
12  kPIPOff = 0,
17 } PIPState;
18 
19 typedef enum PIPLocation
20 {
26 } PIPLocation;
27 
28 typedef enum ZoomDirection
29 {
30  kZoomHome = 0,
45 
46 typedef enum AspectOverrideMode
47 {
52  kAspect_14_9, // added after 16:9 so as not to upset existing setups.
56 
57 typedef enum AdjustFillMode
58 {
71 
72 typedef enum LetterBoxColour
73 {
79 
80 typedef enum FrameScanType
81 {
88 
89 typedef enum PictureAttribute
90 {
101 
103 {
112 
113 typedef enum StereoscopicMode
114 {
121 
123 {
124  switch (mode)
125  {
127  return QObject::tr("No 3D");
129  return QObject::tr("3D Side by Side");
131  return QObject::tr("Discard 3D Side by Side");
133  return QObject::tr("3D Top and Bottom");
135  return QObject::tr("Discard 3D Top and Bottom");
136  }
137  return QObject::tr("Unknown");
138 }
139 
140 typedef enum VideoErrorState
141 {
142  kError_None = 0x00,
144  kError_Decode = 0x02, // VDPAU decoder error
145  kError_Switch_Renderer = 0x04, // Current renderer is not preferred choice
147 
149 {
150  return (kScan_Interlaced == scan) || (kScan_Intr2ndField == scan);
151 }
152 
154 {
155  return (kScan_Progressive == scan);
156 }
157 
158 inline QString toString(FrameScanType scan, bool brief = false)
159 {
160  QString ret = QObject::tr("Unknown");
161  switch (scan)
162  {
163  case kScan_Ignore:
164  ret = QObject::tr("Ignore"); break;
165  case kScan_Detect:
166  ret = QObject::tr("Detect"); break;
167  case kScan_Interlaced:
168  if (brief)
169  ret = QObject::tr("Interlaced");
170  else
171  ret = QObject::tr("Interlaced (Normal)");
172  break;
173  case kScan_Intr2ndField:
174  if (brief)
175  ret = QObject::tr("Interlaced");
176  else
177  ret = QObject::tr("Interlaced (Reversed)");
178  break;
179  case kScan_Progressive:
180  ret = QObject::tr("Progressive"); break;
181  default:
182  break;
183  }
184 
185  return ret;
186 }
187 
188 inline QString toString(PIPLocation location)
189 {
190  QString ret;
191  switch (location)
192  {
193  case kPIPTopLeft: ret = QObject::tr("Top Left"); break;
194  case kPIPBottomLeft: ret = QObject::tr("Bottom Left"); break;
195  case kPIPTopRight: ret = QObject::tr("Top Right"); break;
196  case kPIPBottomRight: ret = QObject::tr("Bottom Right"); break;
197  case kPIP_END: break;
198  }
199 
200  return ret;
201 }
202 
203 inline QString toString(AspectOverrideMode aspectmode)
204 {
205  QString ret = QObject::tr("Off");
206  switch (aspectmode)
207  {
208  case kAspect_4_3: ret = QObject::tr("4:3"); break;
209  case kAspect_14_9: ret = QObject::tr("14:9"); break;
210  case kAspect_16_9: ret = QObject::tr("16:9"); break;
211  case kAspect_2_35_1: ret = QObject::tr("2.35:1"); break;
212  case kAspect_Toggle:
213  case kAspect_Off:
214  case kAspect_END: break;
215  }
216 
217  return ret;
218 }
219 
220 inline QString toString(LetterBoxColour letterboxcolour)
221 {
222  QString ret = QObject::tr("Black");
223  switch (letterboxcolour)
224  {
225  case kLetterBoxColour_Gray25: ret = QObject::tr("Gray"); break;
228  case kLetterBoxColour_END: break;
229  }
230 
231  return ret;
232 }
233 
234 inline QString toXString(LetterBoxColour letterboxcolour)
235 {
236  QString ret = "gray0";
237  switch (letterboxcolour)
238  {
239  case kLetterBoxColour_Gray25: ret = "gray25"; break;
242  case kLetterBoxColour_END: break;
243  }
244 
245  return ret;
246 }
247 
248 inline float get_aspect_override(AspectOverrideMode aspectmode, float orig)
249 {
250  float ret = orig;
251  switch (aspectmode)
252  {
253  case kAspect_4_3: ret = 4.0F / 3.0F; break;
254  case kAspect_14_9: ret = 14.0F / 9.0F; break;
255  case kAspect_16_9: ret = 16.0F / 9.0F; break;
256  case kAspect_2_35_1: ret = 2.35F ; break;
257  case kAspect_Toggle:
258  case kAspect_Off:
259  case kAspect_END: break;
260  }
261  return ret;
262 }
263 
264 inline QString toString(AdjustFillMode aspectmode)
265 {
266  QString ret = QObject::tr("Off");
267  switch (aspectmode)
268  {
269  case kAdjustFill_Half: ret = QObject::tr("Half"); break;
270  case kAdjustFill_Full: ret = QObject::tr("Full"); break;
272  ret = QObject::tr("H.Stretch"); break;
274  ret = QObject::tr("V.Stretch"); break;
276  ret = QObject::tr("V.Fill"); break;
278  ret = QObject::tr("H.Fill"); break;
279  case kAdjustFill_Toggle:
280  case kAdjustFill_Off:
281  case kAdjustFill_END: break;
283  ret = QObject::tr("Auto Detect (Default Off)");
284  break;
286  ret = QObject::tr("Auto Detect (Default Half)");
287  break;
288  }
289 
290  return ret;
291 }
292 
293 inline QString toString(PictureAttribute pictureattribute)
294 {
295  QString ret = QObject::tr("None");
296  switch (pictureattribute)
297  {
298  case kPictureAttribute_None: break;
300  ret = QObject::tr("Brightness"); break;
302  ret = QObject::tr("Contrast"); break;
304  ret = QObject::tr("Color"); break;
306  ret = QObject::tr("Hue"); break;
308  ret = QObject::tr("Studio Levels"); break;
310  ret = QObject::tr("Volume"); break;
312  ret = "MAX"; break;
313  }
314 
315  return ret;
316 }
317 
318 inline QString toDBString(PictureAttribute pictureattribute)
319 {
320  QString ret;
321  switch (pictureattribute)
322  {
323  case kPictureAttribute_None: break;
325  ret = "brightness"; break;
327  ret = "contrast"; break;
329  ret = "colour"; break;
331  ret = "hue"; break;
333  ret = "studiolevels"; break;
335  case kPictureAttribute_MAX: break;
336  }
337 
338  return ret;
339 }
340 
341 inline QString toXVString(PictureAttribute pictureattribute)
342 {
343  QString ret;
344  switch (pictureattribute)
345  {
346  case kPictureAttribute_None: break;
348  ret = "XV_BRIGHTNESS"; break;
350  ret = "XV_CONTRAST"; break;
352  ret = "XV_SATURATION"; break;
354  ret = "XV_HUE"; break;
358  default:
359  break;
360  }
361 
362  return ret;
363 }
364 
365 inline QString toString(PictureAttributeSupported supported)
366 {
367  QString ret = "";
368 
370  ret += "Brightness, ";
371  if (kPictureAttributeSupported_Contrast & supported)
372  ret += "Contrast, ";
373  if (kPictureAttributeSupported_Colour & supported)
374  ret += "Colour, ";
375  if (kPictureAttributeSupported_Hue & supported)
376  ret += "Hue, ";
378  ret += "Studio Levels, ";
379  if (kPictureAttributeSupported_Volume & supported)
380  ret += "Volume, ";
381  return ret;
382 }
383 
385 {
387  switch (pictureattribute)
388  {
389  case kPictureAttribute_None: break;
397  ret = kPictureAttributeSupported_Hue; break;
402  case kPictureAttribute_MAX: break;
403  }
404  return ret;
405 }
406 
408  PictureAttribute attribute)
409 {
410  int i = ((int) attribute + 1) % (int) kPictureAttribute_MAX;
411  for (int j = 0; j < kPictureAttribute_MAX;
412  (i = (i+1) % kPictureAttribute_MAX), j++)
413  {
414  if (toMask((PictureAttribute) i) & supported)
415  return (PictureAttribute) i;
416  }
417  return kPictureAttribute_None;
418 }
419 
420 #endif // _VIDEOOUT_TYPES_H_
def scan(profile, smoonURL, gate)
Definition: scan.py:43
QString toString(FrameScanType scan, bool brief=false)
PictureAttributeSupported
QString toXString(LetterBoxColour letterboxcolour)
FrameScanType
Definition: videoouttypes.h:80
VideoErrorState
QString StereoscopictoString(StereoscopicMode mode)
AspectOverrideMode
Definition: videoouttypes.h:46
bool is_interlaced(FrameScanType scan)
QString toXVString(PictureAttribute pictureattribute)
PictureAttribute
Definition: videoouttypes.h:89
float get_aspect_override(AspectOverrideMode aspectmode, float orig)
PIPLocation
Definition: videoouttypes.h:19
AdjustFillMode
Definition: videoouttypes.h:57
PictureAttribute next(PictureAttributeSupported supported, PictureAttribute attribute)
bool is_progressive(FrameScanType scan)
PictureAttributeSupported toMask(PictureAttribute pictureattribute)
StereoscopicMode
PIPState
Definition: videoouttypes.h:10
LetterBoxColour
Definition: videoouttypes.h:72
ZoomDirection
Definition: videoouttypes.h:28
QString toDBString(PictureAttribute pictureattribute)