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 
11 {
12  kPIPOff = 0,
17 };
18 
20 {
26 };
27 
29 {
30  kZoomHome = 0,
44 };
45 
47 {
52  kAspect_14_9, // added after 16:9 so as not to upset existing setups.
55 };
56 
58 {
70 };
71 
73 {
78 };
79 
81 {
87 };
88 
90 {
100 };
101 
103 {
111 };
112 
113 #define ALL_PICTURE_ATTRIBUTES static_cast<PictureAttributeSupported> \
114  (kPictureAttributeSupported_Brightness | \
115  kPictureAttributeSupported_Contrast | \
116  kPictureAttributeSupported_Colour | \
117  kPictureAttributeSupported_Hue | \
118  kPictureAttributeSupported_Range)
119 
121 {
127 };
128 
130 {
134 };
135 
137 {
138  switch (mode)
139  {
141  return QObject::tr("No 3D");
143  return QObject::tr("3D Side by Side");
145  return QObject::tr("Discard 3D Side by Side");
147  return QObject::tr("3D Top and Bottom");
149  return QObject::tr("Discard 3D Top and Bottom");
150  }
151  return QObject::tr("Unknown");
152 }
153 
155 {
156  kError_None = 0x00,
158 };
159 
161 {
162  return (kScan_Interlaced == scan) || (kScan_Intr2ndField == scan);
163 }
164 
166 {
167  return (kScan_Progressive == scan);
168 }
169 
170 inline QString toString(FrameScanType scan, bool brief = false)
171 {
172  QString ret = QObject::tr("Unknown");
173  switch (scan)
174  {
175  case kScan_Ignore:
176  ret = QObject::tr("Ignore"); break;
177  case kScan_Detect:
178  ret = QObject::tr("Detect"); break;
179  case kScan_Interlaced:
180  if (brief)
181  ret = QObject::tr("Interlaced");
182  else
183  ret = QObject::tr("Interlaced (Normal)");
184  break;
185  case kScan_Intr2ndField:
186  if (brief)
187  ret = QObject::tr("Interlaced");
188  else
189  ret = QObject::tr("Interlaced (Reversed)");
190  break;
191  case kScan_Progressive:
192  ret = QObject::tr("Progressive"); break;
193  default:
194  break;
195  }
196 
197  return ret;
198 }
199 
200 inline QString toString(PIPState State)
201 {
202  switch (State)
203  {
204  case kPIPOff: return QString("Pip Off");
205  case kPIPonTV: return QString("Pip on TV");
206  case kPIPStandAlone: return QString("Pip Standalone");
207  case kPBPLeft: return QString("PBP Left");
208  case kPBPRight: return QString("PBP Right");
209  }
210  return QString("Unknown");
211 }
212 
213 inline QString toString(PIPLocation location)
214 {
215  QString ret;
216  switch (location)
217  {
218  case kPIPTopLeft: ret = QObject::tr("Top Left"); break;
219  case kPIPBottomLeft: ret = QObject::tr("Bottom Left"); break;
220  case kPIPTopRight: ret = QObject::tr("Top Right"); break;
221  case kPIPBottomRight: ret = QObject::tr("Bottom Right"); break;
222  case kPIP_END: break;
223  }
224 
225  return ret;
226 }
227 
228 inline QString toString(AspectOverrideMode aspectmode)
229 {
230  QString ret = QObject::tr("Off");
231  switch (aspectmode)
232  {
233  case kAspect_4_3: ret = QObject::tr("4:3"); break;
234  case kAspect_14_9: ret = QObject::tr("14:9"); break;
235  case kAspect_16_9: ret = QObject::tr("16:9"); break;
236  case kAspect_2_35_1: ret = QObject::tr("2.35:1"); break;
237  case kAspect_Toggle:
238  case kAspect_Off:
239  case kAspect_END: break;
240  }
241 
242  return ret;
243 }
244 
245 inline QString toString(LetterBoxColour letterboxcolour)
246 {
247  QString ret = QObject::tr("Black");
248  switch (letterboxcolour)
249  {
250  case kLetterBoxColour_Gray25: ret = QObject::tr("Gray"); break;
253  case kLetterBoxColour_END: break;
254  }
255 
256  return ret;
257 }
258 
259 inline float get_aspect_override(AspectOverrideMode aspectmode, float orig)
260 {
261  float ret = orig;
262  switch (aspectmode)
263  {
264  case kAspect_4_3: ret = 4.0F / 3.0F; break;
265  case kAspect_14_9: ret = 14.0F / 9.0F; break;
266  case kAspect_16_9: ret = 16.0F / 9.0F; break;
267  case kAspect_2_35_1: ret = 2.35F ; break;
268  case kAspect_Toggle:
269  case kAspect_Off:
270  case kAspect_END: break;
271  }
272  return ret;
273 }
274 
275 inline QString toString(AdjustFillMode aspectmode)
276 {
277  QString ret = QObject::tr("Off");
278  switch (aspectmode)
279  {
280  case kAdjustFill_Half: ret = QObject::tr("Half"); break;
281  case kAdjustFill_Full: ret = QObject::tr("Full"); break;
283  ret = QObject::tr("H.Stretch"); break;
285  ret = QObject::tr("V.Stretch"); break;
287  ret = QObject::tr("V.Fill"); break;
289  ret = QObject::tr("H.Fill"); break;
290  case kAdjustFill_Toggle:
291  case kAdjustFill_Off:
292  case kAdjustFill_END: break;
294  ret = QObject::tr("Auto Detect (Default Off)");
295  break;
297  ret = QObject::tr("Auto Detect (Default Half)");
298  break;
299  }
300 
301  return ret;
302 }
303 
304 inline QString toString(PictureAttribute pictureattribute)
305 {
306  QString ret = QObject::tr("None");
307  switch (pictureattribute)
308  {
309  case kPictureAttribute_None: break;
311  ret = QObject::tr("Brightness"); break;
313  ret = QObject::tr("Contrast"); break;
315  ret = QObject::tr("Color"); break;
317  ret = QObject::tr("Hue"); break;
319  ret = QObject::tr("Range"); break;
321  ret = QObject::tr("Volume"); break;
323  ret = "MAX"; break;
324  }
325 
326  return ret;
327 }
328 
329 inline QString toDBString(PictureAttribute pictureattribute)
330 {
331  QString ret;
332  switch (pictureattribute)
333  {
334  case kPictureAttribute_None: break;
336  ret = "brightness"; break;
338  ret = "contrast"; break;
340  ret = "colour"; break;
342  ret = "hue"; break;
345  case kPictureAttribute_MAX: break;
346  }
347 
348  return ret;
349 }
350 
351 inline QString toString(PictureAttributeSupported supported)
352 {
353  QStringList list;
354 
356  list += "Brightness";
357  if (kPictureAttributeSupported_Contrast & supported)
358  list += "Contrast";
359  if (kPictureAttributeSupported_Colour & supported)
360  list += "Colour";
361  if (kPictureAttributeSupported_Hue & supported)
362  list += "Hue";
363  if (kPictureAttributeSupported_Range & supported)
364  list += "Range";
365  if (kPictureAttributeSupported_Volume & supported)
366  list += "Volume";
367  return list.join(",");
368 }
369 
371 {
373  switch (pictureattribute)
374  {
375  case kPictureAttribute_None: break;
383  ret = kPictureAttributeSupported_Hue; break;
388  case kPictureAttribute_MAX: break;
389  }
390  return ret;
391 }
392 
394  PictureAttribute attribute)
395 {
396  int i = ((int) attribute + 1) % (int) kPictureAttribute_MAX;
397  for (int j = 0; j < kPictureAttribute_MAX;
398  (i = (i+1) % kPictureAttribute_MAX), j++)
399  {
400  if (toMask((PictureAttribute) i) & supported)
401  return (PictureAttribute) i;
402  }
403  return kPictureAttribute_None;
404 }
405 
406 #endif // _VIDEOOUT_TYPES_H_
PrimariesMode
def scan(profile, smoonURL, gate)
Definition: scan.py:57
QString toString(FrameScanType scan, bool brief=false)
PictureAttributeSupported
FrameScanType
Definition: videoouttypes.h:80
VideoErrorState
State
Definition: zmserver.h:62
QString StereoscopictoString(StereoscopicMode mode)
AspectOverrideMode
Definition: videoouttypes.h:46
bool is_interlaced(FrameScanType scan)
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)