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([[maybe_unused]] const char *file,
234  [[maybe_unused]] int line) const
235 {
236 #if 0
237  LOG(VB_GENERAL, LOG_DEBUG, QString("LockPlayingInfo(%1,%2)")
238  .arg(file).arg(line));
239 #endif
240  m_playingInfoLock.lock();
241 }
242 
243 void PlayerContext::UnlockPlayingInfo([[maybe_unused]] const char *file,
244  [[maybe_unused]] int line) const
245 {
246 #if 0
247  LOG(VB_GENERAL, LOG_DEBUG, QString("UnlockPlayingInfo(%1,%2)")
248  .arg(file).arg(line));
249 #endif
250  m_playingInfoLock.unlock();
251 }
252 
258 void PlayerContext::LockDeletePlayer([[maybe_unused]] const char *file,
259  [[maybe_unused]] int line) const
260 {
261 #if 0
262  LOG(VB_GENERAL, LOG_DEBUG, QString("LockDeletePlayer(%1,%2)")
263  .arg(file).arg(line));
264 #endif
265  m_deletePlayerLock.lock();
266 }
267 
271 void PlayerContext::UnlockDeletePlayer([[maybe_unused]] const char *file,
272  [[maybe_unused]] int line) const
273 {
274 #if 0
275  LOG(VB_GENERAL, LOG_DEBUG, QString("UnlockDeletePlayer(%1,%2)")
276  .arg(file).arg(line));
277 #endif
278  m_deletePlayerLock.unlock();
279 }
280 
281 void PlayerContext::LockState(void) const
282 {
283  m_stateLock.lock();
284 }
285 
287 {
288  m_stateLock.unlock();
289 }
290 
292 {
293  if (!m_stateLock.tryLock())
294  return true;
295  bool inStateChange = !m_nextState.empty();
296  m_stateLock.unlock();
297  return inStateChange;
298 }
299 
304 {
305  QMutexLocker locker(&m_stateLock);
306  m_nextState.enqueue(newState);
307 }
308 
310 {
311  QMutexLocker locker(&m_stateLock);
312  return m_nextState.dequeue();
313 }
314 
319 {
320  QMutexLocker locker(&m_stateLock);
321  m_nextState.clear();
322  m_nextState.push_back(kState_None);
323 }
324 
326 {
327  QMutexLocker locker(&m_stateLock);
328  return m_playingState;
329 }
330 
332 {
333  bool loaded = false;
334  LockPlayingInfo(__FILE__, __LINE__);
335  if (m_playingInfo)
336  {
337  m_playingInfo->ToMap(infoMap);
338  infoMap["tvstate"] = StateToString(m_playingState);
339  infoMap["iconpath"] = ChannelUtil::GetIcon(m_playingInfo->GetChanID());
343  {
344  infoMap["coverartpath"] = VideoMetaDataUtil::GetArtPath(
345  m_playingInfo->GetPathname(), "Coverart");
346  infoMap["fanartpath"] = VideoMetaDataUtil::GetArtPath(
347  m_playingInfo->GetPathname(), "Fanart");
348  infoMap["bannerpath"] = VideoMetaDataUtil::GetArtPath(
349  m_playingInfo->GetPathname(), "Banners");
350  infoMap["screenshotpath"] = VideoMetaDataUtil::GetArtPath(
351  m_playingInfo->GetPathname(), "Screenshots");
352  }
353  else
354  {
357  infoMap["coverartpath"] =
358  artmap.value(kArtworkCoverart).url;
359  infoMap["fanartpath"] =
360  artmap.value(kArtworkFanart).url;
361  infoMap["bannerpath"] =
362  artmap.value(kArtworkBanner).url;
363  infoMap["screenshotpath"] =
364  artmap.value(kArtworkScreenshot).url;
365  }
366  loaded = true;
367  }
368  UnlockPlayingInfo(__FILE__, __LINE__);
369  return loaded;
370 }
371 
373 {
374  bool ret = false;
375  LockPlayingInfo(__FILE__, __LINE__);
376  if (m_playingInfo)
377  ret = m_playingInfo->IsSameProgram(p);
378  UnlockPlayingInfo(__FILE__, __LINE__);
379  return ret;
380 }
381 
382 QString PlayerContext::GetFilters(const QString &baseFilters) const
383 {
384  QString filters = baseFilters;
385  QString chanFilters;
386 
388  return baseFilters;
389 
390  LockPlayingInfo(__FILE__, __LINE__);
391  if (m_playingInfo) // Recordings have this info already.
392  chanFilters = m_playingInfo->GetChannelPlaybackFilters();
393  UnlockPlayingInfo(__FILE__, __LINE__);
394 
395  if (!chanFilters.isEmpty())
396  {
397  if ((chanFilters[0] != '+'))
398  {
399  filters = chanFilters;
400  }
401  else
402  {
403  if (!filters.isEmpty() && (!filters.endsWith(",")))
404  filters += ",";
405 
406  filters += chanFilters.mid(1);
407  }
408  }
409 
410  LOG(VB_CHANNEL, LOG_INFO, LOC +
411  QString("Output filters for this channel are: '%1'")
412  .arg(filters));
413 
414  return filters;
415 }
416 
417 QString PlayerContext::GetPlayMessage(void) const
418 {
419  QString mesg = QObject::tr("Play");
420  if (m_ffRewState < 0)
421  {
422  mesg = QObject::tr("Rewind");
423  mesg += QString(" %1X").arg(-m_ffRewSpeed);
424  }
425  else if (m_ffRewState > 0)
426  {
427  mesg = QObject::tr("Forward");
428  mesg += QString(" %1X").arg(m_ffRewSpeed);
429  }
430  // Make sure these values for m_ffRewSpeed in TV::ChangeSpeed()
431  // and PlayerContext::GetPlayMessage() stay in sync.
432  else if (m_ffRewSpeed == 0)
433  mesg += QString(" %1X").arg(m_tsNormal);
434  else if (m_ffRewSpeed == -1)
435  mesg += QString(" 1/3X");
436  else if (m_ffRewSpeed == -2)
437  mesg += QString(" 1/8X");
438  else if (m_ffRewSpeed == -3)
439  mesg += QString(" 1/16X");
440 
441  return mesg;
442 }
443 
445 {
446  QMutexLocker locker(&m_deletePlayerLock);
447  if (m_player)
448  {
449  StopPlaying();
450  delete m_player;
451  }
452  m_player = newplayer;
453 }
454 
456 {
457  if (m_recorder)
458  {
459  delete m_recorder;
460  m_recorder = nullptr;
461  }
462 
463  if (rec)
464  {
465  m_recorder = rec;
467  }
468 }
469 
471 {
472  if (m_tvchain)
473  {
475  m_tvchain->DecrRef();
476  m_tvchain = nullptr;
477  }
478 
479  m_tvchain = chain;
480 
481  if (m_tvchain)
483 }
484 
486 {
487  if (m_buffer)
488  {
489  delete m_buffer;
490  m_buffer = nullptr;
491  }
492 
493  m_buffer = Buffer;
494 }
495 
500 {
501  bool ignoreDB = gCoreContext->IsDatabaseIgnored();
502 
503  QMutexLocker locker(&m_playingInfoLock);
504 
505  if (m_playingInfo)
506  {
507  if (!ignoreDB)
509  delete m_playingInfo;
510  m_playingInfo = nullptr;
511  }
512 
513  if (info)
514  {
515  m_playingInfo = new ProgramInfo(*info);
516  if (!ignoreDB)
520  }
521 }
522 
523 void PlayerContext::SetPlayGroup(const QString &group)
524 {
525  m_fftime = PlayGroup::GetDurSetting<std::chrono::seconds>(group, "skipahead", 30s);
526  m_rewtime = PlayGroup::GetDurSetting<std::chrono::seconds>(group, "skipback", 5s);
527  m_jumptime = PlayGroup::GetDurSetting<std::chrono::minutes>(group, "jump", 10min);
528  m_tsNormal = PlayGroup::GetSetting(group, "timestretch", 100) * 0.01F;
529  m_tsAlt = (m_tsNormal == 1.0F) ? 1.5F : 1.0F;
530 }
531 
533  const ProgramInfo *pi, PseudoState new_state)
534 {
535  ProgramInfo *old_rec = m_pseudoLiveTVRec;
536  ProgramInfo *new_rec = nullptr;
537 
538  if (pi)
539  {
540  new_rec = new ProgramInfo(*pi);
541  QString msg = QString("Wants to record: %1 %2 %3 %4")
542  .arg(new_rec->GetTitle(), new_rec->GetChanNum(),
545  LOG(VB_PLAYBACK, LOG_INFO, LOC + msg);
546  }
547 
548  m_pseudoLiveTVRec = new_rec;
549  m_pseudoLiveTVState = new_state;
550 
551  if (old_rec)
552  {
553  QString msg = QString("Done recording: %1 %2 %3 %4")
554  .arg(old_rec->GetTitle(), old_rec->GetChanNum(),
557  LOG(VB_PLAYBACK, LOG_INFO, LOC + msg);
558  delete old_rec;
559  }
560 }
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:325
MythPlayer::AtNormalSpeed
bool AtNormalSpeed(void) const
Definition: mythplayer.h:161
PlayerContext::UnlockPlayingInfo
void UnlockPlayingInfo(const char *file, int line) const
Definition: playercontext.cpp:243
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:532
PlayerContext::SetPlayingInfo
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
Definition: playercontext.cpp:499
PlayerContext::GetFilters
QString GetFilters(const QString &baseFilters) const
Definition: playercontext.cpp:382
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:930
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:331
MythCoreContext::IsDatabaseIgnored
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
Definition: mythcorecontext.cpp:875
GetArtwork
ArtworkMap GetArtwork(const QString &inetref, uint season, bool strict)
Definition: metadataimagehelper.cpp:23
PlayerContext::GetPlayMessage
QString GetPlayMessage(void) const
Definition: playercontext.cpp:417
MythMediaBuffer
Definition: mythmediabuffer.h:50
MythPlayer::IsErrored
bool IsErrored(void) const
Definition: mythplayer.cpp:1952
MythPlayer::GetNextPlaySpeed
float GetNextPlaySpeed(void) const
Definition: mythplayer.h:143
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:254
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:85
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:455
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:258
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:372
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:271
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:911
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:281
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:1246
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:444
PlayerContext::SetRingBuffer
void SetRingBuffer(MythMediaBuffer *Buffer)
Definition: playercontext.cpp:485
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:523
PlayerContext::DequeueNextState
TVState DequeueNextState(void)
Definition: playercontext.cpp:309
ProgramInfo::IsVideoDVD
bool IsVideoDVD(void) const
Definition: programinfo.h:347
PlayerContext::InStateChange
bool InStateChange(void) const
Definition: playercontext.cpp:291
PlayerContext::SetTVChain
void SetTVChain(LiveTVChain *chain)
Definition: playercontext.cpp:470
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:837
MythPlayer::StopPlaying
virtual void StopPlaying(void)
Definition: mythplayer.cpp:944
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:286
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:303
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:318
tv_play.h
LiveTVChain
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:34