MythTV  master
tv.cpp
Go to the documentation of this file.
1 
2 #include "tv.h"
3 
4 #include <QObject> // for QObject::tr()
5 
10 QString StateToString(TVState state)
11 {
12  QString statestr = QString("Unknown(%1)").arg((int)state);
13  switch (state) {
14  case kState_Error:
15  statestr = "Error";
16  break;
17  case kState_None:
18  statestr = "None";
19  break;
21  statestr = "WatchingLiveTV";
22  break;
24  statestr = "WatchingPreRecorded";
25  break;
27  statestr = "WatchingVideo";
28  break;
29  case kState_WatchingDVD:
30  statestr = "WatchingDVD";
31  break;
32  case kState_WatchingBD:
33  statestr = "WatchingBD";
34  break;
36  statestr = "WatchingRecording";
37  break;
39  statestr = "RecordingOnly";
40  break;
42  statestr = "ChangingState";
43  break;
44  }
45  return statestr;
46 }
47 
49 {
50  const QString kPicAdjType[] =
51  {
52  "",
53  "",
54  QObject::tr("(CH)"),
55  QObject::tr("(REC)"),
56  };
57 
58  return kPicAdjType[(uint)type & 0x3];
59 }
60 
62 {
63  const QString kPicAdjTitles[] =
64  {
65  "",
66  QObject::tr("Adjust Playback"),
67  QObject::tr("Adjust Recorder"),
68  QObject::tr("Adjust Recorder"),
69  };
70 
71  return kPicAdjTitles[(uint)type & 0x3];
72 }
73 
75 {
76  const QString kCommSkipTitles[] =
77  {
78  QObject::tr("Auto-Skip OFF"),
79  QObject::tr("Auto-Skip ON"),
80  QObject::tr("Auto-Skip Notify"),
81  };
82 
83  return kCommSkipTitles[(uint)(type) % kCommSkipCount];
84 }
Error State, if we ever try to enter this state errored is set.
Definition: tv.h:54
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
Definition: tv.h:63
QString StateToString(TVState state)
Returns a human readable QString representing a TVState.
Definition: tv.cpp:10
QString toTypeString(PictureAdjustType type)
Definition: tv.cpp:48
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
unsigned int uint
Definition: compat.h:140
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
Definition: tv.h:67
Watching DVD is the state when we are watching a DVD.
Definition: tv.h:73
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:50
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
Definition: tv.h:84
Watching Video is the state when we are watching a video and is not a dvd or BD.
Definition: tv.h:71
CommSkipMode
Definition: tv.h:130
Watching BD is the state when we are watching a BD.
Definition: tv.h:75
QString toTitleString(PictureAdjustType type)
Definition: tv.cpp:61
QString toString(CommSkipMode type)
Definition: tv.cpp:74
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
Definition: tv.h:58
PictureAdjustType
Definition: tv.h:120
This is a placeholder state which we never actually enter, but is returned by GetState() when we are ...
Definition: tv.h:89
static int x3
Definition: mythsocket.cpp:62