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 
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 QString();
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 QString();
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 QString();
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_tsNormal != 1.0F)
429  {
430  if (m_tsNormal == 0.5F)
431  mesg += QString(" 1/2x");
432  else if (0.32F < m_tsNormal && m_tsNormal < 0.34F)
433  mesg += QString(" 1/3x");
434  else if (m_tsNormal == 0.25F)
435  mesg += QString(" 1/4x");
436  else if (m_tsNormal == 0.125F)
437  mesg += QString(" 1/8x");
438  else if (m_tsNormal == 0.0625F)
439  mesg += QString(" 1/16x");
440  else
441  mesg += QString(" %1x").arg(m_tsNormal);
442  }
443 
444  return mesg;
445 }
446 
448 {
449  QMutexLocker locker(&m_deletePlayerLock);
450  if (m_player)
451  {
452  StopPlaying();
453  delete m_player;
454  }
455  m_player = newplayer;
456 }
457 
459 {
460  if (m_recorder)
461  {
462  delete m_recorder;
463  m_recorder = nullptr;
464  }
465 
466  if (rec)
467  {
468  m_recorder = rec;
470  }
471 }
472 
474 {
475  if (m_tvchain)
476  {
478  m_tvchain->DecrRef();
479  m_tvchain = nullptr;
480  }
481 
482  m_tvchain = chain;
483 
484  if (m_tvchain)
486 }
487 
489 {
490  if (m_buffer)
491  {
492  delete m_buffer;
493  m_buffer = nullptr;
494  }
495 
496  m_buffer = Buffer;
497 }
498 
503 {
504  bool ignoreDB = gCoreContext->IsDatabaseIgnored();
505 
506  QMutexLocker locker(&m_playingInfoLock);
507 
508  if (m_playingInfo)
509  {
510  if (!ignoreDB)
512  delete m_playingInfo;
513  m_playingInfo = nullptr;
514  }
515 
516  if (info)
517  {
518  m_playingInfo = new ProgramInfo(*info);
519  if (!ignoreDB)
522  }
523 }
524 
525 void PlayerContext::SetPlayGroup(const QString &group)
526 {
527  m_fftime = PlayGroup::GetDurSetting<std::chrono::seconds>(group, "skipahead", 30s);
528  m_rewtime = PlayGroup::GetDurSetting<std::chrono::seconds>(group, "skipback", 5s);
529  m_jumptime = PlayGroup::GetDurSetting<std::chrono::minutes>(group, "jump", 10min);
530  m_tsNormal = PlayGroup::GetSetting(group, "timestretch", 100) * 0.01F;
531  m_tsAlt = (m_tsNormal == 1.0F) ? 1.5F : 1.0F;
532 }
533 
535  const ProgramInfo *pi, PseudoState new_state)
536 {
537  ProgramInfo *old_rec = m_pseudoLiveTVRec;
538  ProgramInfo *new_rec = nullptr;
539 
540  if (pi)
541  {
542  new_rec = new ProgramInfo(*pi);
543  QString msg = QString("Wants to record: %1 %2 %3 %4")
544  .arg(new_rec->GetTitle(), new_rec->GetChanNum(),
547  LOG(VB_PLAYBACK, LOG_INFO, LOC + msg);
548  }
549 
550  m_pseudoLiveTVRec = new_rec;
551  m_pseudoLiveTVState = new_state;
552 
553  if (old_rec)
554  {
555  QString msg = QString("Done recording: %1 %2 %3 %4")
556  .arg(old_rec->GetTitle(), old_rec->GetChanNum(),
559  LOG(VB_PLAYBACK, LOG_INFO, LOC + msg);
560  delete old_rec;
561  }
562 }
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:140
PlayerContext::m_lastCardid
int m_lastCardid
CardID of current/last recorder.
Definition: playercontext.h:122
PlayerContext::GetState
TVState GetState(void) const
Definition: playercontext.cpp:333
MythPlayer::AtNormalSpeed
bool AtNormalSpeed(void) const
Definition: mythplayer.h:161
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:159
RemoteEncoder::GetRecorderNumber
int GetRecorderNumber(void) const
Definition: remoteencoder.cpp:61
PlayerContext::kSMExitTimeout
static constexpr std::chrono::milliseconds kSMExitTimeout
Timeout after last Signal Monitor message for ignoring OSD when exiting.
Definition: playercontext.h:172
PlayerContext::m_ffRewIndex
int m_ffRewIndex
Index into m_ffRewSpeeds for FF and Rewind speeds.
Definition: playercontext.h:126
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:534
PlayerContext::SetPlayingInfo
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
Definition: playercontext.cpp:502
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:149
MythPlayer::CheckTVChain
void CheckTVChain()
Definition: mythplayer.cpp:915
PlayerContext::m_playingState
TVState m_playingState
Definition: playercontext.h:129
RemoteEncoder::GetErrorStatus
bool GetErrorStatus(void)
Definition: remoteencoder.h:81
LiveTVChain::GetChannelName
QString GetChannelName(int pos=-1) const
Definition: livetvchain.cpp:679
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:375
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:900
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:1984
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:142
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
playgroup.h
MythPlayer::IsPlaying
bool IsPlaying(std::chrono::milliseconds wait_in_msec=0ms, bool wait_for=true) const
Definition: mythplayer.cpp:257
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:86
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:140
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:411
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:403
ProgramInfo::GetPathname
QString GetPathname(void) const
Definition: programinfo.h:342
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: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:436
ProgramInfo::IsVideoBD
bool IsVideoBD(void) const
Definition: programinfo.h:348
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:5001
PlayerContext::m_prevChan
StringDeque m_prevChan
Previous channels.
Definition: playercontext.h:134
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:458
PlayerContext::m_playingInfo
ProgramInfo * m_playingInfo
Currently playing info.
Definition: playercontext.h:120
LOC
#define LOC
Definition: playercontext.cpp:25
PlayerContext::m_tsAlt
float m_tsAlt
Definition: playercontext.h:150
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:360
PlayerContext::m_rewtime
std::chrono::seconds m_rewtime
Definition: playercontext.h:141
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:119
PlayerContext::m_deletePlayerLock
QRecursiveMutex m_deletePlayerLock
Definition: playercontext.h:158
videometadatautil.h
PlayerContext::m_pseudoLiveTVRec
ProgramInfo * m_pseudoLiveTVRec
Definition: playercontext.h:137
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:1560
PlayerContext::m_recUsage
QString m_recUsage
Definition: playercontext.h:114
storagegroup.h
PlayerContext::m_playingLen
std::chrono::seconds m_playingLen
Initial CalculateLength()
Definition: playercontext.h:121
PlayerContext::~PlayerContext
~PlayerContext()
Definition: playercontext.cpp:34
ProgramInfo::GetPlaybackGroup
QString GetPlaybackGroup(void) const
Definition: programinfo.h:419
ProgramInfo::GetChannelPlaybackFilters
QString GetChannelPlaybackFilters(void) const
Definition: programinfo.h:386
LiveTVChain::ReloadAll
void ReloadAll(const QStringList &data=QStringList())
Definition: livetvchain.cpp:209
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:1890
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
PlayerContext::m_playingInfoLock
QRecursiveMutex m_playingInfoLock
Definition: playercontext.h:157
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:118
MythCoreContext::GetNumSetting
int GetNumSetting(const QString &key, int defaultval=0)
Definition: mythcorecontext.cpp:936
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:289
PlayerContext::m_pseudoLiveTVState
PseudoState m_pseudoLiveTVState
Definition: playercontext.h:138
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:371
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:1243
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:365
mythcorecontext.h
playercontext.h
PlayerContext::m_lastSignalMsgTime
MythTimer m_lastSignalMsgTime
Definition: playercontext.h:164
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:447
PlayerContext::SetRingBuffer
void SetRingBuffer(MythMediaBuffer *Buffer)
Definition: playercontext.cpp:488
PlayerContext::m_ffRewSpeed
int m_ffRewSpeed
Caches value of m_ffRewSpeeds[m_ffRewIndex].
Definition: playercontext.h:128
PlayerContext::SetPlayGroup
void SetPlayGroup(const QString &group)
Definition: playercontext.cpp:525
PlayerContext::DequeueNextState
TVState DequeueNextState(void)
Definition: playercontext.cpp:317
ProgramInfo::IsVideoDVD
bool IsVideoDVD(void) const
Definition: programinfo.h:346
PlayerContext::InStateChange
bool InStateChange(void) const
Definition: playercontext.cpp:299
PlayerContext::SetTVChain
void SetTVChain(LiveTVChain *chain)
Definition: playercontext.cpp:473
ProgramInfo::IsVideoFile
bool IsVideoFile(void) const
Definition: programinfo.h:344
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:169
ArtworkMap
QMultiMap< VideoArtworkType, ArtworkInfo > ArtworkMap
Definition: metadataimagehelper.h:31
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:862
MythPlayer::StopPlaying
virtual void StopPlaying(void)
Definition: mythplayer.cpp:929
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:2249
VideoMetaDataUtil::GetArtPath
static QString GetArtPath(const QString &pathname, const QString &type)
Definition: videometadatautil.cpp:16
PlayerContext::HandlePlayerSpeedChangeEOF
bool HandlePlayerSpeedChangeEOF(void)
Definition: playercontext.cpp:127
PlayerContext::m_recorder
RemoteEncoder * m_recorder
Definition: playercontext.h:117
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:294
kArtworkScreenshot
@ kArtworkScreenshot
Definition: metadataimagehelper.h:14
PlayerContext::m_ffRewState
int m_ffRewState
0 == normal, +1 == fast forward, -1 == rewind
Definition: playercontext.h:124
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:32
ProgramInfo::GetBasename
QString GetBasename(void) const
Definition: programinfo.h:343
PlayerContext::m_player
MythPlayer * m_player
Definition: playercontext.h:115
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:173
PseudoState
PseudoState
Definition: playercontext.h:43
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