MythTV  master
playercontext.cpp
Go to the documentation of this file.
1 #include <cmath>
2 #include <utility>
3 
4 #include <QPainter>
5 
6 #include "mythconfig.h"
7 
8 #include "playercontext.h"
9 #include "mythplayer.h"
10 #include "remoteencoder.h"
11 #include "livetvchain.h"
12 #include "io/mythmediabuffer.h"
13 #include "playgroup.h"
14 #include "videoouttypes.h"
15 #include "storagegroup.h"
16 #include "mythcorecontext.h"
17 #include "videometadatautil.h"
18 #include "metadataimagehelper.h"
19 #include "mythlogging.h"
20 #include "DVD/mythdvdplayer.h"
21 #include "Bluray/mythbdplayer.h"
22 #include "channelutil.h"
23 #include "tv_play.h"
24 
25 #define LOC QString("playCtx: ")
26 
29 
30 PlayerContext::PlayerContext(QString inUseID) :
31  m_recUsage(std::move(inUseID))
32 {
35 }
36 
38 {
40  m_nextState.clear();
41 }
42 
44 {
45  m_ffRewState = 0;
46  m_ffRewIndex = 0;
47  m_ffRewSpeed = 0;
48  m_tsNormal = 1.0F;
49 
50  SetPlayer(nullptr);
51  SetRecorder(nullptr);
52  SetRingBuffer(nullptr);
53  SetTVChain(nullptr);
54  SetPlayingInfo(nullptr);
55 }
56 
62 {
63  TVState newState = kState_None;
64  QString newPlaygroup("Default");
65 
66  LockPlayingInfo(__FILE__, __LINE__);
67  if (islivetv)
68  {
69  SetTVChain(new LiveTVChain());
70  newState = kState_WatchingLiveTV;
71  }
72  else if (m_playingInfo)
73  {
74  int overrecordseconds = gCoreContext->GetNumSetting("RecordOverTime");
75  QDateTime curtime = MythDate::current();
76  QDateTime recendts = m_playingInfo->GetRecordingEndTime()
77  .addSecs(overrecordseconds);
78 
80  {
81  newState = (curtime < recendts) ?
83  }
84  else if (m_playingInfo->IsVideoDVD())
85  newState = kState_WatchingDVD;
86  else if (m_playingInfo->IsVideoBD())
87  newState = kState_WatchingBD;
88  else
89  newState = kState_WatchingVideo;
90 
91  newPlaygroup = m_playingInfo->GetPlaybackGroup();
92  }
93  UnlockPlayingInfo(__FILE__, __LINE__);
94 
95  ChangeState(newState);
96  SetPlayGroup(newPlaygroup);
97 }
98 
99 bool PlayerContext::HasPlayer(void) const
100 {
101  QMutexLocker locker(&m_deletePlayerLock);
102  return m_player;
103 }
104 
106 {
107  QMutexLocker locker(&m_deletePlayerLock);
108  return m_player && m_player->IsErrored();
109 }
110 
112 {
113  QMutexLocker locker(&m_deletePlayerLock);
114  return m_player && m_player->IsPlaying();
115 }
116 
118 {
119  QMutexLocker locker(&m_deletePlayerLock);
121  {
122  m_ffRewSpeed = 0;
123  m_ffRewState = 0;
125  return true;
126  }
127  return false;
128 }
129 
131 {
132  QMutexLocker locker(&m_deletePlayerLock);
133  if (m_player && (m_player->GetNextPlaySpeed() != m_tsNormal) &&
135  {
136  // Speed got changed in player since we are close to the end of file
137  m_tsNormal = 1.0F;
138  return true;
139  }
140  return false;
141 }
142 
144 {
145  return m_recorder && m_recorder->GetErrorStatus();
146 }
147 
149 {
150  if (m_player)
152 }
153 
154 void PlayerContext::UpdateTVChain(const QStringList &data)
155 {
156  QMutexLocker locker(&m_deletePlayerLock);
157  if (m_tvchain && m_player)
158  {
159  m_tvchain->ReloadAll(data);
161  }
162 }
163 
165 {
166  if (!m_tvchain)
167  return false;
168 
169  m_tvchain->ReloadAll();
170  ProgramInfo *pinfo = m_tvchain->GetProgramAt(-1);
171  if (pinfo)
172  {
173  SetPlayingInfo(pinfo);
174  delete pinfo;
175  return true;
176  }
177  return false;
178 }
179 
184 {
185  if (!m_tvchain)
186  return;
187 
188  // Don't store more than kMaxChannelHistory channels. Remove the first item
189  if (m_prevChan.size() >= kMaxChannelHistory)
190  m_prevChan.pop_front();
191 
192  // This method builds the stack of previous channels
193  QString curChan = m_tvchain->GetChannelName(-1);
194  if (m_prevChan.empty() ||
195  curChan != m_prevChan[m_prevChan.size() - 1])
196  {
197  const QString& chan = curChan;
198  m_prevChan.push_back(chan);
199  }
200 }
201 
203 {
204  if (m_prevChan.empty())
205  return QString();
206 
207  QString curChan = m_tvchain->GetChannelName(-1);
208  if ((curChan == m_prevChan.back()) && !m_prevChan.empty())
209  m_prevChan.pop_back();
210 
211  if (m_prevChan.empty())
212  return QString();
213 
214  QString chan = m_prevChan.back();
215  m_prevChan.pop_back();
216  // add the current channel back to the list, to allow easy flipping between
217  // two channels using PREVCHAN
219  return chan;
220 }
221 
223 {
224  if (m_prevChan.empty())
225  return QString();
226 
227  QString curChan = m_tvchain->GetChannelName(-1);
228  QString preChan;
229  if (curChan != m_prevChan.back() || m_prevChan.size() < 2)
230  preChan = m_prevChan.back();
231  else
232  preChan = m_prevChan[m_prevChan.size()-2];
233  return preChan;
234 }
235 
236 void PlayerContext::LockPlayingInfo(const char *file, int line) const
237 {
238 #if 0
239  LOG(VB_GENERAL, LOG_DEBUG, QString("LockPlayingInfo(%1,%2)")
240  .arg(file).arg(line));
241 #else
242  Q_UNUSED(file);
243  Q_UNUSED(line);
244 #endif
245  m_playingInfoLock.lock();
246 }
247 
248 void PlayerContext::UnlockPlayingInfo(const char *file, int line) const
249 {
250 #if 0
251  LOG(VB_GENERAL, LOG_DEBUG, QString("UnlockPlayingInfo(%1,%2)")
252  .arg(file).arg(line));
253 #else
254  Q_UNUSED(file);
255  Q_UNUSED(line);
256 #endif
257  m_playingInfoLock.unlock();
258 }
259 
265 void PlayerContext::LockDeletePlayer(const char *file, int line) const
266 {
267 #if 0
268  LOG(VB_GENERAL, LOG_DEBUG, QString("LockDeletePlayer(%1,%2)")
269  .arg(file).arg(line));
270 #else
271  Q_UNUSED(file);
272  Q_UNUSED(line);
273 #endif
274  m_deletePlayerLock.lock();
275 }
276 
280 void PlayerContext::UnlockDeletePlayer(const char *file, int line) const
281 {
282 #if 0
283  LOG(VB_GENERAL, LOG_DEBUG, QString("UnlockDeletePlayer(%1,%2)")
284  .arg(file).arg(line));
285 #else
286  Q_UNUSED(file);
287  Q_UNUSED(line);
288 #endif
289  m_deletePlayerLock.unlock();
290 }
291 
292 void PlayerContext::LockState(void) const
293 {
294  m_stateLock.lock();
295 }
296 
298 {
299  m_stateLock.unlock();
300 }
301 
303 {
304  if (!m_stateLock.tryLock())
305  return true;
306  bool inStateChange = !m_nextState.empty();
307  m_stateLock.unlock();
308  return inStateChange;
309 }
310 
315 {
316  QMutexLocker locker(&m_stateLock);
317  m_nextState.enqueue(newState);
318 }
319 
321 {
322  QMutexLocker locker(&m_stateLock);
323  return m_nextState.dequeue();
324 }
325 
330 {
331  QMutexLocker locker(&m_stateLock);
332  m_nextState.clear();
333  m_nextState.push_back(kState_None);
334 }
335 
337 {
338  QMutexLocker locker(&m_stateLock);
339  return m_playingState;
340 }
341 
343 {
344  bool loaded = false;
345  LockPlayingInfo(__FILE__, __LINE__);
346  if (m_playingInfo)
347  {
348  m_playingInfo->ToMap(infoMap);
349  infoMap["tvstate"] = StateToString(m_playingState);
350  infoMap["iconpath"] = ChannelUtil::GetIcon(m_playingInfo->GetChanID());
354  {
355  infoMap["coverartpath"] = VideoMetaDataUtil::GetArtPath(
356  m_playingInfo->GetPathname(), "Coverart");
357  infoMap["fanartpath"] = VideoMetaDataUtil::GetArtPath(
358  m_playingInfo->GetPathname(), "Fanart");
359  infoMap["bannerpath"] = VideoMetaDataUtil::GetArtPath(
360  m_playingInfo->GetPathname(), "Banners");
361  infoMap["screenshotpath"] = VideoMetaDataUtil::GetArtPath(
362  m_playingInfo->GetPathname(), "Screenshots");
363  }
364  else
365  {
368  infoMap["coverartpath"] =
369  artmap.value(kArtworkCoverart).url;
370  infoMap["fanartpath"] =
371  artmap.value(kArtworkFanart).url;
372  infoMap["bannerpath"] =
373  artmap.value(kArtworkBanner).url;
374  infoMap["screenshotpath"] =
375  artmap.value(kArtworkScreenshot).url;
376  }
377  loaded = true;
378  }
379  UnlockPlayingInfo(__FILE__, __LINE__);
380  return loaded;
381 }
382 
384 {
385  bool ret = false;
386  LockPlayingInfo(__FILE__, __LINE__);
387  if (m_playingInfo)
388  ret = m_playingInfo->IsSameProgram(p);
389  UnlockPlayingInfo(__FILE__, __LINE__);
390  return ret;
391 }
392 
393 QString PlayerContext::GetFilters(const QString &baseFilters) const
394 {
395  QString filters = baseFilters;
396  QString chanFilters;
397 
399  return baseFilters;
400 
401  LockPlayingInfo(__FILE__, __LINE__);
402  if (m_playingInfo) // Recordings have this info already.
403  chanFilters = m_playingInfo->GetChannelPlaybackFilters();
404  UnlockPlayingInfo(__FILE__, __LINE__);
405 
406  if (!chanFilters.isEmpty())
407  {
408  if ((chanFilters[0] != '+'))
409  {
410  filters = chanFilters;
411  }
412  else
413  {
414  if (!filters.isEmpty() && (!filters.endsWith(",")))
415  filters += ",";
416 
417  filters += chanFilters.midRef(1);
418  }
419  }
420 
421  LOG(VB_CHANNEL, LOG_INFO, LOC +
422  QString("Output filters for this channel are: '%1'")
423  .arg(filters));
424 
425  return filters;
426 }
427 
428 QString PlayerContext::GetPlayMessage(void) const
429 {
430  QString mesg = QObject::tr("Play");
431  if (m_tsNormal != 1.0F)
432  {
433  if (m_tsNormal == 0.5F)
434  mesg += QString(" 1/2x");
435  else if (0.32F < m_tsNormal && m_tsNormal < 0.34F)
436  mesg += QString(" 1/3x");
437  else if (m_tsNormal == 0.25F)
438  mesg += QString(" 1/4x");
439  else if (m_tsNormal == 0.125F)
440  mesg += QString(" 1/8x");
441  else if (m_tsNormal == 0.0625F)
442  mesg += QString(" 1/16x");
443  else
444  mesg += QString(" %1x").arg(m_tsNormal);
445  }
446 
447  return mesg;
448 }
449 
451 {
452  QMutexLocker locker(&m_deletePlayerLock);
453  if (m_player)
454  {
455  StopPlaying();
456  delete m_player;
457  }
458  m_player = newplayer;
459 }
460 
462 {
463  if (m_recorder)
464  {
465  delete m_recorder;
466  m_recorder = nullptr;
467  }
468 
469  if (rec)
470  {
471  m_recorder = rec;
473  }
474 }
475 
477 {
478  if (m_tvchain)
479  {
481  m_tvchain->DecrRef();
482  m_tvchain = nullptr;
483  }
484 
485  m_tvchain = chain;
486 
487  if (m_tvchain)
489 }
490 
492 {
493  if (m_buffer)
494  {
495  delete m_buffer;
496  m_buffer = nullptr;
497  }
498 
499  m_buffer = Buffer;
500 }
501 
506 {
507  bool ignoreDB = gCoreContext->IsDatabaseIgnored();
508 
509  QMutexLocker locker(&m_playingInfoLock);
510 
511  if (m_playingInfo)
512  {
513  if (!ignoreDB)
515  delete m_playingInfo;
516  m_playingInfo = nullptr;
517  }
518 
519  if (info)
520  {
521  m_playingInfo = new ProgramInfo(*info);
522  if (!ignoreDB)
525  }
526 }
527 
528 void PlayerContext::SetPlayGroup(const QString &group)
529 {
530  m_fftime = PlayGroup::GetSetting(group, "skipahead", 30);
531  m_rewtime = PlayGroup::GetSetting(group, "skipback", 5);
532  m_jumptime = PlayGroup::GetSetting(group, "jump", 10);
533  m_tsNormal = PlayGroup::GetSetting(group, "timestretch", 100) * 0.01F;
534  m_tsAlt = (m_tsNormal == 1.0F) ? 1.5F : 1.0F;
535 }
536 
538  const ProgramInfo *pi, PseudoState new_state)
539 {
540  ProgramInfo *old_rec = m_pseudoLiveTVRec;
541  ProgramInfo *new_rec = nullptr;
542 
543  if (pi)
544  {
545  new_rec = new ProgramInfo(*pi);
546  QString msg = QString("Wants to record: %1 %2 %3 %4")
547  .arg(new_rec->GetTitle()).arg(new_rec->GetChanNum())
549  .arg(new_rec->GetRecordingEndTime(MythDate::ISODate));
550  LOG(VB_PLAYBACK, LOG_INFO, LOC + msg);
551  }
552 
553  m_pseudoLiveTVRec = new_rec;
554  m_pseudoLiveTVState = new_state;
555 
556  if (old_rec)
557  {
558  QString msg = QString("Done recording: %1 %2 %3 %4")
559  .arg(old_rec->GetTitle()).arg(old_rec->GetChanNum())
561  .arg(old_rec->GetRecordingEndTime(MythDate::ISODate));
562  LOG(VB_PLAYBACK, LOG_INFO, LOC + msg);
563  delete old_rec;
564  }
565 }
LiveTVChain::DestroyChain
void DestroyChain(void)
Definition: livetvchain.cpp:195
PlayGroup::GetSetting
static int GetSetting(const QString &name, const QString &field, int defval)
Definition: playgroup.cpp:248
PlayerContext::IsRecorderErrored
bool IsRecorderErrored(void) const
Definition: playercontext.cpp:143
PlayerContext::m_stateLock
QMutex m_stateLock
Definition: playercontext.h:150
PlayerContext::m_lastCardid
int m_lastCardid
CardID of current/last recorder.
Definition: playercontext.h:118
PlayerContext::GetState
TVState GetState(void) const
Definition: playercontext.cpp:336
MythPlayer::AtNormalSpeed
bool AtNormalSpeed(void) const
Definition: mythplayer.h:157
PlayerContext::UnlockPlayingInfo
void UnlockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:248
mythbdplayer.h
RemoteEncoder::GetRecorderNumber
int GetRecorderNumber(void) const
Definition: remoteencoder.cpp:61
PlayerContext::m_ffRewIndex
int m_ffRewIndex
Index into m_ffRewSpeeds for FF and Rewind speeds.
Definition: playercontext.h:122
ReferenceCounter::DecrRef
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
Definition: referencecounter.cpp:125
metadataimagehelper.h
PlayerContext::SetPseudoLiveTV
void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state)
Definition: playercontext.cpp:537
PlayerContext::m_playingInfoLock
QMutex m_playingInfoLock
Definition: playercontext.h:148
PlayerContext::SetPlayingInfo
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
Definition: playercontext.cpp:505
PlayerContext::GetFilters
QString GetFilters(const QString &baseFilters) const
Definition: playercontext.cpp:393
PlayerContext::IsPlayerPlaying
bool IsPlayerPlaying(void) const
Definition: playercontext.cpp:111
PlayerContext::m_tsNormal
float m_tsNormal
Time stretch speed, 1.0F for normal playback.
Definition: playercontext.h:145
MythPlayer::CheckTVChain
void CheckTVChain()
Definition: mythplayer.cpp:916
ProgramInfo::GetSecondsInRecording
uint GetSecondsInRecording(void) const
Returns length of program/recording in seconds.
Definition: programinfo.cpp:1789
MythTimer::addMSecs
void addMSecs(int ms)
Adds an offset to the last call to start() or restart().
Definition: mythtimer.cpp:145
PlayerContext::m_playingState
TVState m_playingState
Definition: playercontext.h:125
RemoteEncoder::GetErrorStatus
bool GetErrorStatus(void)
Definition: remoteencoder.h:82
LiveTVChain::GetChannelName
QString GetChannelName(int pos=-1) const
Definition: livetvchain.cpp:680
PlayerContext::UpdateTVChain
void UpdateTVChain(const QStringList &data=QStringList())
Definition: playercontext.cpp:154
ProgramInfo::GetChanNum
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
Definition: programinfo.h:374
PlayerContext::TeardownPlayer
void TeardownPlayer(void)
Definition: playercontext.cpp:43
PlayerContext::GetPlayingInfoMap
bool GetPlayingInfoMap(InfoMap &infoMap) const
Definition: playercontext.cpp:342
MythCoreContext::IsDatabaseIgnored
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
Definition: mythcorecontext.cpp:897
arg
arg(title).arg(filename).arg(doDelete))
GetArtwork
ArtworkMap GetArtwork(const QString &inetref, uint season, bool strict)
Definition: metadataimagehelper.cpp:23
PlayerContext::GetPlayMessage
QString GetPlayMessage(void) const
Definition: playercontext.cpp:428
MythMediaBuffer
Definition: mythmediabuffer.h:49
MythPlayer::IsErrored
bool IsErrored(void) const
Definition: mythplayer.cpp:1948
MythPlayer::GetNextPlaySpeed
float GetNextPlaySpeed(void) const
Definition: mythplayer.h:140
MythTimer::start
void start(void)
starts measuring elapsed time.
Definition: mythtimer.cpp:47
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
playgroup.h
PlayerContext::GetPreviousChannel
QString GetPreviousChannel(void) const
Definition: playercontext.cpp:222
mythplayer.h
PlayerContext::HandlePlayerSpeedChangeFFRew
bool HandlePlayerSpeedChangeFFRew(void)
Definition: playercontext.cpp:117
MythPlayer
Definition: mythplayer.h:83
build_compdb.file
file
Definition: build_compdb.py:55
PlayerContext::StopPlaying
void StopPlaying(void) const
Definition: playercontext.cpp:148
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:410
PlayerContext::kMaxChannelHistory
static const uint kMaxChannelHistory
Definition: playercontext.h:163
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
ProgramInfo::GetRecordingStartTime
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:402
ProgramInfo::GetPathname
QString GetPathname(void) const
Definition: programinfo.h:341
RemoteEncoder
Definition: remoteencoder.h:25
PlayerContext::IsPlayerErrored
bool IsPlayerErrored(void) const
Definition: playercontext.cpp:105
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
PlayerContext::ReloadTVChain
bool ReloadTVChain(void)
Definition: playercontext.cpp:164
PlayerContext::PushPreviousChannel
void PushPreviousChannel(void)
most recently selected channel to the previous channel list
Definition: playercontext.cpp:183
kState_WatchingRecording
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
LiveTVChain::GetProgramAt
ProgramInfo * GetProgramAt(int at) const
Returns program at the desired location.
Definition: livetvchain.cpp:320
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
ProgramInfo::GetInetRef
QString GetInetRef(void) const
Definition: programinfo.h:435
PlayerContext::m_jumptime
int m_jumptime
Definition: playercontext.h:138
ProgramInfo::IsVideoBD
bool IsVideoBD(void) const
Definition: programinfo.h:347
ProgramInfo::MarkAsInUse
void MarkAsInUse(bool inuse, const QString &usedFor="")
Tracks a recording's in use status, to prevent deletion and to allow the storage scheduler to perform...
Definition: programinfo.cpp:4901
PlayerContext::m_prevChan
StringDeque m_prevChan
Previous channels.
Definition: playercontext.h:130
mythlogging.h
PlayerContext::SetInitialTVState
void SetInitialTVState(bool islivetv)
determine initial tv state and playgroup for the recording
Definition: playercontext.cpp:61
videoouttypes.h
PlayerContext::SetRecorder
void SetRecorder(RemoteEncoder *rec)
Definition: playercontext.cpp:461
PlayerContext::m_playingInfo
ProgramInfo * m_playingInfo
Currently playing info.
Definition: playercontext.h:116
LOC
#define LOC
Definition: playercontext.cpp:25
PlayerContext::m_tsAlt
float m_tsAlt
Definition: playercontext.h:146
hardwareprofile.config.p
p
Definition: config.py:33
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
mythdvdplayer.h
PlayerContext::LockPlayingInfo
void LockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:236
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:359
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:115
videometadatautil.h
PlayerContext::m_pseudoLiveTVRec
ProgramInfo * m_pseudoLiveTVRec
Definition: playercontext.h:133
kArtworkFanart
@ kArtworkFanart
Definition: metadataimagehelper.h:12
PlayerContext::LockDeletePlayer
void LockDeletePlayer(const char *file, int line) const
prevent MythPlayer from being deleted used to ensure player can only be deleted after osd in TV() is ...
Definition: playercontext.cpp:265
PlayerContext::m_deletePlayerLock
QMutex m_deletePlayerLock
Definition: playercontext.h:149
PlayerContext::m_recUsage
QString m_recUsage
Definition: playercontext.h:110
storagegroup.h
PlayerContext::~PlayerContext
~PlayerContext()
Definition: playercontext.cpp:37
ProgramInfo::GetPlaybackGroup
QString GetPlaybackGroup(void) const
Definition: programinfo.h:418
ProgramInfo::GetChannelPlaybackFilters
QString GetChannelPlaybackFilters(void) const
Definition: programinfo.h:385
LiveTVChain::ReloadAll
void ReloadAll(const QStringList &data=QStringList())
Definition: livetvchain.cpp:209
PlayerContext::IsSameProgram
bool IsSameProgram(const ProgramInfo &p) const
Definition: playercontext.cpp:383
uint
unsigned int uint
Definition: compat.h:141
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
PlayerContext::UnlockDeletePlayer
void UnlockDeletePlayer(const char *file, int line) const
allow player to be deleted.
Definition: playercontext.cpp:280
PlayerContext::PopPreviousChannel
QString PopPreviousChannel(void)
Definition: playercontext.cpp:202
PlayerContext::m_tvchain
LiveTVChain * m_tvchain
Definition: playercontext.h:114
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:933
mythmediabuffer.h
channelutil.h
LiveTVChain::InitializeNewChain
QString InitializeNewChain(const QString &seed)
Definition: livetvchain.cpp:37
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
PlayerContext::LockState
void LockState(void) const
Definition: playercontext.cpp:292
PlayerContext::kSMExitTimeout
static const uint kSMExitTimeout
Timeout after last Signal Monitor message for ignoring OSD when exiting.
Definition: playercontext.h:162
PlayerContext::m_pseudoLiveTVState
PseudoState m_pseudoLiveTVState
Definition: playercontext.h:134
kState_WatchingBD
@ kState_WatchingBD
Watching BD is the state when we are watching a BD.
Definition: tv.h:75
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:370
livetvchain.h
kState_WatchingDVD
@ kState_WatchingDVD
Watching DVD is the state when we are watching a DVD.
Definition: tv.h:73
Buffer
Definition: MythExternControl.h:36
ChannelUtil::GetIcon
static QString GetIcon(uint chanid)
Definition: channelutil.cpp:1245
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
PlayerContext::m_fftime
int m_fftime
Definition: playercontext.h:136
TVState
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:50
ProgramInfo::GetSeason
uint GetSeason(void) const
Definition: programinfo.h:364
mythcorecontext.h
playercontext.h
PlayerContext::m_lastSignalMsgTime
MythTimer m_lastSignalMsgTime
Definition: playercontext.h:154
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:14
PlayerContext::SetPlayer
void SetPlayer(MythPlayer *newplayer)
Definition: playercontext.cpp:450
PlayerContext::SetRingBuffer
void SetRingBuffer(MythMediaBuffer *Buffer)
Definition: playercontext.cpp:491
PlayerContext::m_ffRewSpeed
int m_ffRewSpeed
Caches value of m_ffRewSpeeds[m_ffRewIndex].
Definition: playercontext.h:124
PlayerContext::SetPlayGroup
void SetPlayGroup(const QString &group)
Definition: playercontext.cpp:528
PlayerContext::DequeueNextState
TVState DequeueNextState(void)
Definition: playercontext.cpp:320
ProgramInfo::IsVideoDVD
bool IsVideoDVD(void) const
Definition: programinfo.h:345
PlayerContext::InStateChange
bool InStateChange(void) const
Definition: playercontext.cpp:302
ProgramInfo::ToMap
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
Definition: programinfo.cpp:1464
PlayerContext::SetTVChain
void SetTVChain(LiveTVChain *chain)
Definition: playercontext.cpp:476
ProgramInfo::IsVideoFile
bool IsVideoFile(void) const
Definition: programinfo.h:343
MythPlayer::IsPlaying
bool IsPlaying(uint wait_in_msec=0, bool wait_for=true) const
Definition: mythplayer.cpp:257
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
TV::kInitFFRWSpeed
static const int kInitFFRWSpeed
1x, default to normal speed
Definition: tv_play.h:740
remoteencoder.h
PlayerContext::HasPlayer
bool HasPlayer(void) const
Definition: playercontext.cpp:99
kArtworkBanner
@ kArtworkBanner
Definition: metadataimagehelper.h:13
PlayerContext::m_nextState
MythDeque< TVState > m_nextState
Definition: playercontext.h:159
ArtworkMap
QMultiMap< VideoArtworkType, ArtworkInfo > ArtworkMap
Definition: metadataimagehelper.h:31
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:859
MythPlayer::StopPlaying
virtual void StopPlaying(void)
Definition: mythplayer.cpp:930
PlayerContext::m_rewtime
int m_rewtime
Definition: playercontext.h:137
StateToString
QString StateToString(TVState state)
Returns a human readable QString representing a TVState.
Definition: tv.cpp:11
ProgramInfo::IsSameProgram
bool IsSameProgram(const ProgramInfo &other) const
Checks whether this is the same program as "other", which may or may not be a repeat or on another ch...
Definition: programinfo.cpp:2149
VideoMetaDataUtil::GetArtPath
static QString GetArtPath(const QString &pathname, const QString &type)
Definition: videometadatautil.cpp:16
PlayerContext::HandlePlayerSpeedChangeEOF
bool HandlePlayerSpeedChangeEOF(void)
Definition: playercontext.cpp:130
PlayerContext::m_recorder
RemoteEncoder * m_recorder
Definition: playercontext.h:113
MythDeque::enqueue
void enqueue(T d)
Adds item to the back of the list. O(1).
Definition: mythdeque.h:42
PlayerContext::UnlockState
void UnlockState(void) const
Definition: playercontext.cpp:297
kArtworkScreenshot
@ kArtworkScreenshot
Definition: metadataimagehelper.h:14
PlayerContext::m_playingLen
long long m_playingLen
Initial CalculateLength()
Definition: playercontext.h:117
PlayerContext::m_ffRewState
int m_ffRewState
0 == normal, +1 == fast forward, -1 == rewind
Definition: playercontext.h:120
ProgramInfo::IsRecording
bool IsRecording(void) const
Definition: programinfo.h:483
MythDeque::dequeue
T dequeue()
Removes item from front of list and returns a copy. O(1).
Definition: mythdeque.h:32
ProgramInfo::GetBasename
QString GetBasename(void) const
Definition: programinfo.h:342
PlayerContext::m_player
MythPlayer * m_player
Definition: playercontext.h:111
kArtworkCoverart
@ kArtworkCoverart
Definition: metadataimagehelper.h:11
PlayerContext::PlayerContext
PlayerContext(QString inUseID=QString("Unknown"))
Definition: playercontext.cpp:30
PlayerContext::ChangeState
void ChangeState(TVState newState)
Puts a state change on the nextState queue.
Definition: playercontext.cpp:314
PseudoState
PseudoState
Definition: playercontext.h:39
PlayerContext::ForceNextStateNone
void ForceNextStateNone(void)
Removes any pending state changes, and puts kState_None on the queue.
Definition: playercontext.cpp:329
tv_play.h
LiveTVChain
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:31