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  bool paddedFields) const
145 {
146  QMutexLocker locker(&m_deletePlayerLock);
147  if (m_player)
148  {
149  m_player->calcSliderPos(info, paddedFields);
150  return true;
151  }
152  return false;
153 }
154 
156 {
157  return m_recorder && m_recorder->GetErrorStatus();
158 }
159 
166 {
167  if (!m_player)
168  return false;
169 
170  if (!m_player->StartPlaying())
171  {
172  LOG(VB_GENERAL, LOG_ERR, LOC + "StartPlaying() Failed to start player");
173  // no need to call StopPlaying here as the player context will be deleted
174  // later following the error
175  return false;
176  }
177  maxWait = (maxWait <= 0) ? 20000 : maxWait;
178 #ifdef USING_VALGRIND
179  maxWait = (1<<30);
180 #endif // USING_VALGRIND
181  MythTimer t;
182  t.start();
183 
184  while (!m_player->IsPlaying(50, true) && (t.elapsed() < maxWait))
185  ReloadTVChain();
186 
187  if (m_player->IsPlaying())
188  {
189  LOG(VB_PLAYBACK, LOG_INFO, LOC +
190  QString("StartPlaying(): took %1 ms to start player.")
191  .arg(t.elapsed()));
192  return true;
193  }
194  LOG(VB_GENERAL, LOG_ERR, LOC + "StartPlaying() Failed to start player");
195  StopPlaying();
196  return false;
197 }
198 
200 {
201  if (m_player)
203 }
204 
205 void PlayerContext::UpdateTVChain(const QStringList &data)
206 {
207  QMutexLocker locker(&m_deletePlayerLock);
208  if (m_tvchain && m_player)
209  {
210  m_tvchain->ReloadAll(data);
212  }
213 }
214 
216 {
217  if (!m_tvchain)
218  return false;
219 
220  m_tvchain->ReloadAll();
221  ProgramInfo *pinfo = m_tvchain->GetProgramAt(-1);
222  if (pinfo)
223  {
224  SetPlayingInfo(pinfo);
225  delete pinfo;
226  return true;
227  }
228  return false;
229 }
230 
235 {
236  if (!m_tvchain)
237  return;
238 
239  // Don't store more than kMaxChannelHistory channels. Remove the first item
240  if (m_prevChan.size() >= kMaxChannelHistory)
241  m_prevChan.pop_front();
242 
243  // This method builds the stack of previous channels
244  QString curChan = m_tvchain->GetChannelName(-1);
245  if (m_prevChan.empty() ||
246  curChan != m_prevChan[m_prevChan.size() - 1])
247  {
248  const QString& chan = curChan;
249  m_prevChan.push_back(chan);
250  }
251 }
252 
254 {
255  if (m_prevChan.empty())
256  return QString();
257 
258  QString curChan = m_tvchain->GetChannelName(-1);
259  if ((curChan == m_prevChan.back()) && !m_prevChan.empty())
260  m_prevChan.pop_back();
261 
262  if (m_prevChan.empty())
263  return QString();
264 
265  QString chan = m_prevChan.back();
266  m_prevChan.pop_back();
267  // add the current channel back to the list, to allow easy flipping between
268  // two channels using PREVCHAN
270  return chan;
271 }
272 
274 {
275  if (m_prevChan.empty())
276  return QString();
277 
278  QString curChan = m_tvchain->GetChannelName(-1);
279  QString preChan;
280  if (curChan != m_prevChan.back() || m_prevChan.size() < 2)
281  preChan = m_prevChan.back();
282  else
283  preChan = m_prevChan[m_prevChan.size()-2];
284  return preChan;
285 }
286 
287 void PlayerContext::LockPlayingInfo(const char *file, int line) const
288 {
289 #if 0
290  LOG(VB_GENERAL, LOG_DEBUG, QString("LockPlayingInfo(%1,%2)")
291  .arg(file).arg(line));
292 #else
293  Q_UNUSED(file);
294  Q_UNUSED(line);
295 #endif
296  m_playingInfoLock.lock();
297 }
298 
299 void PlayerContext::UnlockPlayingInfo(const char *file, int line) const
300 {
301 #if 0
302  LOG(VB_GENERAL, LOG_DEBUG, QString("UnlockPlayingInfo(%1,%2)")
303  .arg(file).arg(line));
304 #else
305  Q_UNUSED(file);
306  Q_UNUSED(line);
307 #endif
308  m_playingInfoLock.unlock();
309 }
310 
316 void PlayerContext::LockDeletePlayer(const char *file, int line) const
317 {
318 #if 0
319  LOG(VB_GENERAL, LOG_DEBUG, QString("LockDeletePlayer(%1,%2)")
320  .arg(file).arg(line));
321 #else
322  Q_UNUSED(file);
323  Q_UNUSED(line);
324 #endif
325  m_deletePlayerLock.lock();
326 }
327 
331 void PlayerContext::UnlockDeletePlayer(const char *file, int line) const
332 {
333 #if 0
334  LOG(VB_GENERAL, LOG_DEBUG, QString("UnlockDeletePlayer(%1,%2)")
335  .arg(file).arg(line));
336 #else
337  Q_UNUSED(file);
338  Q_UNUSED(line);
339 #endif
340  m_deletePlayerLock.unlock();
341 }
342 
343 void PlayerContext::LockState(void) const
344 {
345  m_stateLock.lock();
346 }
347 
349 {
350  m_stateLock.unlock();
351 }
352 
354 {
355  m_player->LockOSD();
356 }
357 
358 void PlayerContext::UnlockOSD(void) const
359 {
360  m_player->UnlockOSD();
361 }
362 
364 {
365  if (!m_stateLock.tryLock())
366  return true;
367  bool inStateChange = !m_nextState.empty();
368  m_stateLock.unlock();
369  return inStateChange;
370 }
371 
376 {
377  QMutexLocker locker(&m_stateLock);
378  m_nextState.enqueue(newState);
379 }
380 
382 {
383  QMutexLocker locker(&m_stateLock);
384  return m_nextState.dequeue();
385 }
386 
391 {
392  QMutexLocker locker(&m_stateLock);
393  m_nextState.clear();
394  m_nextState.push_back(kState_None);
395 }
396 
398 {
399  QMutexLocker locker(&m_stateLock);
400  return m_playingState;
401 }
402 
404 {
405  bool loaded = false;
406  LockPlayingInfo(__FILE__, __LINE__);
407  if (m_playingInfo)
408  {
409  m_playingInfo->ToMap(infoMap);
410  infoMap["tvstate"] = StateToString(m_playingState);
411  infoMap["iconpath"] = ChannelUtil::GetIcon(m_playingInfo->GetChanID());
415  {
416  infoMap["coverartpath"] = VideoMetaDataUtil::GetArtPath(
417  m_playingInfo->GetPathname(), "Coverart");
418  infoMap["fanartpath"] = VideoMetaDataUtil::GetArtPath(
419  m_playingInfo->GetPathname(), "Fanart");
420  infoMap["bannerpath"] = VideoMetaDataUtil::GetArtPath(
421  m_playingInfo->GetPathname(), "Banners");
422  infoMap["screenshotpath"] = VideoMetaDataUtil::GetArtPath(
423  m_playingInfo->GetPathname(), "Screenshots");
424  }
425  else
426  {
429  infoMap["coverartpath"] =
430  artmap.value(kArtworkCoverart).url;
431  infoMap["fanartpath"] =
432  artmap.value(kArtworkFanart).url;
433  infoMap["bannerpath"] =
434  artmap.value(kArtworkBanner).url;
435  infoMap["screenshotpath"] =
436  artmap.value(kArtworkScreenshot).url;
437  }
438  loaded = true;
439  }
440  UnlockPlayingInfo(__FILE__, __LINE__);
441  return loaded;
442 }
443 
445 {
446  bool ret = false;
447  LockPlayingInfo(__FILE__, __LINE__);
448  if (m_playingInfo)
449  ret = m_playingInfo->IsSameProgram(p);
450  UnlockPlayingInfo(__FILE__, __LINE__);
451  return ret;
452 }
453 
454 QString PlayerContext::GetFilters(const QString &baseFilters) const
455 {
456  QString filters = baseFilters;
457  QString chanFilters;
458 
460  return baseFilters;
461 
462  LockPlayingInfo(__FILE__, __LINE__);
463  if (m_playingInfo) // Recordings have this info already.
464  chanFilters = m_playingInfo->GetChannelPlaybackFilters();
465  UnlockPlayingInfo(__FILE__, __LINE__);
466 
467  if (!chanFilters.isEmpty())
468  {
469  if ((chanFilters[0] != '+'))
470  {
471  filters = chanFilters;
472  }
473  else
474  {
475  if (!filters.isEmpty() && (!filters.endsWith(",")))
476  filters += ",";
477 
478  filters += chanFilters.midRef(1);
479  }
480  }
481 
482  LOG(VB_CHANNEL, LOG_INFO, LOC +
483  QString("Output filters for this channel are: '%1'")
484  .arg(filters));
485 
486  return filters;
487 }
488 
489 QString PlayerContext::GetPlayMessage(void) const
490 {
491  QString mesg = QObject::tr("Play");
492  if (m_tsNormal != 1.0F)
493  {
494  if (m_tsNormal == 0.5F)
495  mesg += QString(" 1/2x");
496  else if (0.32F < m_tsNormal && m_tsNormal < 0.34F)
497  mesg += QString(" 1/3x");
498  else if (m_tsNormal == 0.25F)
499  mesg += QString(" 1/4x");
500  else if (m_tsNormal == 0.125F)
501  mesg += QString(" 1/8x");
502  else if (m_tsNormal == 0.0625F)
503  mesg += QString(" 1/16x");
504  else
505  mesg += QString(" %1x").arg(m_tsNormal);
506  }
507 
508  return mesg;
509 }
510 
512 {
513  QMutexLocker locker(&m_deletePlayerLock);
514  if (m_player)
515  {
516  StopPlaying();
517  delete m_player;
518  }
519  m_player = newplayer;
520 }
521 
523 {
524  if (m_recorder)
525  {
526  delete m_recorder;
527  m_recorder = nullptr;
528  }
529 
530  if (rec)
531  {
532  m_recorder = rec;
534  }
535 }
536 
538 {
539  if (m_tvchain)
540  {
542  m_tvchain->DecrRef();
543  m_tvchain = nullptr;
544  }
545 
546  m_tvchain = chain;
547 
548  if (m_tvchain)
550 }
551 
553 {
554  if (m_buffer)
555  {
556  delete m_buffer;
557  m_buffer = nullptr;
558  }
559 
560  m_buffer = Buffer;
561 }
562 
567 {
568  bool ignoreDB = gCoreContext->IsDatabaseIgnored();
569 
570  QMutexLocker locker(&m_playingInfoLock);
571 
572  if (m_playingInfo)
573  {
574  if (!ignoreDB)
576  delete m_playingInfo;
577  m_playingInfo = nullptr;
578  }
579 
580  if (info)
581  {
582  m_playingInfo = new ProgramInfo(*info);
583  if (!ignoreDB)
586  }
587 }
588 
589 void PlayerContext::SetPlayGroup(const QString &group)
590 {
591  m_fftime = PlayGroup::GetSetting(group, "skipahead", 30);
592  m_rewtime = PlayGroup::GetSetting(group, "skipback", 5);
593  m_jumptime = PlayGroup::GetSetting(group, "jump", 10);
594  m_tsNormal = PlayGroup::GetSetting(group, "timestretch", 100) * 0.01F;
595  m_tsAlt = (m_tsNormal == 1.0F) ? 1.5F : 1.0F;
596 }
597 
599  const ProgramInfo *pi, PseudoState new_state)
600 {
601  ProgramInfo *old_rec = m_pseudoLiveTVRec;
602  ProgramInfo *new_rec = nullptr;
603 
604  if (pi)
605  {
606  new_rec = new ProgramInfo(*pi);
607  QString msg = QString("Wants to record: %1 %2 %3 %4")
608  .arg(new_rec->GetTitle()).arg(new_rec->GetChanNum())
610  .arg(new_rec->GetRecordingEndTime(MythDate::ISODate));
611  LOG(VB_PLAYBACK, LOG_INFO, LOC + msg);
612  }
613 
614  m_pseudoLiveTVRec = new_rec;
615  m_pseudoLiveTVState = new_state;
616 
617  if (old_rec)
618  {
619  QString msg = QString("Done recording: %1 %2 %3 %4")
620  .arg(old_rec->GetTitle()).arg(old_rec->GetChanNum())
622  .arg(old_rec->GetRecordingEndTime(MythDate::ISODate));
623  LOG(VB_PLAYBACK, LOG_INFO, LOC + msg);
624  delete old_rec;
625  }
626 }
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:155
PlayerContext::m_stateLock
QMutex m_stateLock
Definition: playercontext.h:158
PlayerContext::m_lastCardid
int m_lastCardid
CardID of current/last recorder.
Definition: playercontext.h:126
PlayerContext::GetState
TVState GetState(void) const
Definition: playercontext.cpp:397
MythPlayer::AtNormalSpeed
bool AtNormalSpeed(void) const
Definition: mythplayer.h:184
osdInfo
Definition: playercontext.h:34
PlayerContext::UnlockPlayingInfo
void UnlockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:299
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:130
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:598
PlayerContext::m_playingInfoLock
QMutex m_playingInfoLock
Definition: playercontext.h:156
PlayerContext::SetPlayingInfo
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
Definition: playercontext.cpp:566
MythTimer
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:14
PlayerContext::GetFilters
QString GetFilters(const QString &baseFilters) const
Definition: playercontext.cpp:454
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:153
MythPlayer::CheckTVChain
void CheckTVChain()
Definition: mythplayer.cpp:1561
ProgramInfo::GetSecondsInRecording
uint GetSecondsInRecording(void) const
Returns length of program/recording in seconds.
Definition: programinfo.cpp:1782
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:133
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:205
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:403
MythCoreContext::IsDatabaseIgnored
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
Definition: mythcorecontext.cpp:893
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:489
MythMediaBuffer
Definition: mythmediabuffer.h:50
MythPlayer::IsErrored
bool IsErrored(void) const
Definition: mythplayer.cpp:3484
MythPlayer::GetNextPlaySpeed
float GetNextPlaySpeed(void) const
Definition: mythplayer.h:158
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:273
PlayerContext::StartPlaying
bool StartPlaying(int maxWait=-1)
Starts player, must be called after StartRecorder().
Definition: playercontext.cpp:165
mythplayer.h
PlayerContext::LockOSD
void LockOSD(void) const
Definition: playercontext.cpp:353
PlayerContext::HandlePlayerSpeedChangeFFRew
bool HandlePlayerSpeedChangeFFRew(void)
Definition: playercontext.cpp:117
MythPlayer
Definition: mythplayer.h:100
build_compdb.file
file
Definition: build_compdb.py:55
PlayerContext::StopPlaying
void StopPlaying(void) const
Definition: playercontext.cpp:199
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:171
MythPlayer::calcSliderPos
virtual void calcSliderPos(osdInfo &info, bool paddedFields=false)
Definition: mythplayer.cpp:2996
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:26
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:215
PlayerContext::PushPreviousChannel
void PushPreviousChannel(void)
most recently selected channel to the previous channel list
Definition: playercontext.cpp:234
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:146
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:4893
PlayerContext::m_prevChan
StringDeque m_prevChan
Previous channels.
Definition: playercontext.h:138
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:522
PlayerContext::m_playingInfo
ProgramInfo * m_playingInfo
Currently playing info.
Definition: playercontext.h:124
LOC
#define LOC
Definition: playercontext.cpp:25
PlayerContext::m_tsAlt
float m_tsAlt
Definition: playercontext.h:154
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
hardwareprofile.i18n.t
t
Definition: i18n.py:36
PlayerContext::LockPlayingInfo
void LockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:287
ProgramInfo::GetTitle
QString GetTitle(void) const
Definition: programinfo.h:359
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:123
videometadatautil.h
PlayerContext::m_pseudoLiveTVRec
ProgramInfo * m_pseudoLiveTVRec
Definition: playercontext.h:141
PlayerContext::UnlockOSD
void UnlockOSD(void) const
Definition: playercontext.cpp:358
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:316
PlayerContext::m_deletePlayerLock
QMutex m_deletePlayerLock
Definition: playercontext.h:157
PlayerContext::m_recUsage
QString m_recUsage
Definition: playercontext.h:118
MythPlayer::StartPlaying
virtual bool StartPlaying(void)
Definition: mythplayer.cpp:1852
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::CalcPlayerSliderPosition
bool CalcPlayerSliderPosition(osdInfo &info, bool paddedFields=false) const
Definition: playercontext.cpp:143
PlayerContext::IsSameProgram
bool IsSameProgram(const ProgramInfo &p) const
Definition: playercontext.cpp:444
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:56
PlayerContext::UnlockDeletePlayer
void UnlockDeletePlayer(const char *file, int line) const
allow player to be deleted.
Definition: playercontext.cpp:331
PlayerContext::PopPreviousChannel
QString PopPreviousChannel(void)
Definition: playercontext.cpp:253
PlayerContext::m_tvchain
LiveTVChain * m_tvchain
Definition: playercontext.h:122
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:929
mythmediabuffer.h
channelutil.h
LiveTVChain::InitializeNewChain
QString InitializeNewChain(const QString &seed)
Definition: livetvchain.cpp:37
MythPlayer::LockOSD
void LockOSD(void)
Definition: mythplayer.h:286
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:343
PlayerContext::kSMExitTimeout
static const uint kSMExitTimeout
Timeout after last Signal Monitor message for ignoring OSD when exiting.
Definition: playercontext.h:170
PlayerContext::m_pseudoLiveTVState
PseudoState m_pseudoLiveTVState
Definition: playercontext.h:142
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:37
ChannelUtil::GetIcon
static QString GetIcon(uint chanid)
Definition: channelutil.cpp:1245
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
PlayerContext::m_fftime
int m_fftime
Definition: playercontext.h:144
TVState
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:51
ProgramInfo::GetSeason
uint GetSeason(void) const
Definition: programinfo.h:364
mythcorecontext.h
playercontext.h
PlayerContext::m_lastSignalMsgTime
MythTimer m_lastSignalMsgTime
Definition: playercontext.h:162
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:14
PlayerContext::SetPlayer
void SetPlayer(MythPlayer *newplayer)
Definition: playercontext.cpp:511
PlayerContext::SetRingBuffer
void SetRingBuffer(MythMediaBuffer *Buffer)
Definition: playercontext.cpp:552
PlayerContext::m_ffRewSpeed
int m_ffRewSpeed
Caches value of m_ffRewSpeeds[m_ffRewIndex].
Definition: playercontext.h:132
PlayerContext::SetPlayGroup
void SetPlayGroup(const QString &group)
Definition: playercontext.cpp:589
PlayerContext::DequeueNextState
TVState DequeueNextState(void)
Definition: playercontext.cpp:381
ProgramInfo::IsVideoDVD
bool IsVideoDVD(void) const
Definition: programinfo.h:345
PlayerContext::InStateChange
bool InStateChange(void) const
Definition: playercontext.cpp:363
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:537
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:295
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:904
remoteencoder.h
MythPlayer::UnlockOSD
void UnlockOSD(void)
Definition: mythplayer.h:287
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:167
ArtworkMap
QMultiMap< VideoArtworkType, ArtworkInfo > ArtworkMap
Definition: metadataimagehelper.h:31
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:855
MythPlayer::StopPlaying
virtual void StopPlaying(void)
Definition: mythplayer.cpp:1902
PlayerContext::m_rewtime
int m_rewtime
Definition: playercontext.h:145
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:2141
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:121
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:348
kArtworkScreenshot
@ kArtworkScreenshot
Definition: metadataimagehelper.h:14
PlayerContext::m_playingLen
long long m_playingLen
Initial CalculateLength()
Definition: playercontext.h:125
PlayerContext::m_ffRewState
int m_ffRewState
0 == normal, +1 == fast forward, -1 == rewind
Definition: playercontext.h:128
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:119
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:375
PseudoState
PseudoState
Definition: playercontext.h:40
PlayerContext::ForceNextStateNone
void ForceNextStateNone(void)
Removes any pending state changes, and puts kState_None on the queue.
Definition: playercontext.cpp:390
tv_play.h
LiveTVChain
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:32