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