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