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 }
CommSkipMode
CommSkipMode
Definition: tv.h:131
tv.h
PictureAdjustType
PictureAdjustType
Definition: tv.h:121
x3
static int x3
Definition: mythsocket.cpp:62
kState_Error
@ kState_Error
Error State, if we ever try to enter this state errored is set.
Definition: tv.h:54
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:89
kState_WatchingRecording
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
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:58
kCommSkipCount
@ kCommSkipCount
Definition: tv.h:135
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:71
toTypeString
QString toTypeString(PictureAdjustType type)
Definition: tv.cpp:49
uint
unsigned int uint
Definition: compat.h:141
toString
QString toString(CommSkipMode type)
Definition: tv.cpp:75
kState_WatchingPreRecorded
@ kState_WatchingPreRecorded
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
Definition: tv.h:67
kState_WatchingBD
@ kState_WatchingBD
Watching BD is the state when we are watching a BD.
Definition: tv.h:75
kState_WatchingDVD
@ kState_WatchingDVD
Watching DVD is the state when we are watching a DVD.
Definition: tv.h:73
TVState
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:51
toTitleString
QString toTitleString(PictureAdjustType type)
Definition: tv.cpp:62
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:63
StateToString
QString StateToString(TVState state)
Returns a human readable QString representing a TVState.
Definition: tv.cpp:11
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:84