Go to the documentation of this file.
6 #include "libmythbase/mythconfig.h"
25 #define LOC QString("playCtx: ")
28 m_recUsage(
std::move(inUseID))
61 QString newPlaygroup(
"Default");
74 .addSecs(overrecordseconds);
78 newState = (curtime < recendts) ?
194 const QString& chan = curChan;
236 LOG(VB_GENERAL, LOG_DEBUG, QString(
"LockPlayingInfo(%1,%2)")
237 .arg(
file).arg(line));
248 LOG(VB_GENERAL, LOG_DEBUG, QString(
"UnlockPlayingInfo(%1,%2)")
249 .arg(
file).arg(line));
265 LOG(VB_GENERAL, LOG_DEBUG, QString(
"LockDeletePlayer(%1,%2)")
266 .arg(
file).arg(line));
280 LOG(VB_GENERAL, LOG_DEBUG, QString(
"UnlockDeletePlayer(%1,%2)")
281 .arg(
file).arg(line));
305 return inStateChange;
365 infoMap[
"coverartpath"] =
367 infoMap[
"fanartpath"] =
369 infoMap[
"bannerpath"] =
371 infoMap[
"screenshotpath"] =
392 QString filters = baseFilters;
403 if (!chanFilters.isEmpty())
405 if ((chanFilters[0] !=
'+'))
407 filters = chanFilters;
411 if (!filters.isEmpty() && (!filters.endsWith(
",")))
414 filters += chanFilters.mid(1);
418 LOG(VB_CHANNEL, LOG_INFO,
LOC +
419 QString(
"Output filters for this channel are: '%1'")
427 QString mesg = QObject::tr(
"Play");
430 mesg = QObject::tr(
"Rewind");
435 mesg = QObject::tr(
"Forward");
443 mesg += QString(
" 1/3X");
445 mesg += QString(
" 1/8X");
447 mesg += QString(
" 1/16X");
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);
549 QString msg = QString(
"Wants to record: %1 %2 %3 %4")
553 LOG(VB_PLAYBACK, LOG_INFO,
LOC + msg);
561 QString msg = QString(
"Done recording: %1 %2 %3 %4")
565 LOG(VB_PLAYBACK, LOG_INFO,
LOC + msg);
static int GetSetting(const QString &name, const QString &field, int defval)
bool IsRecorderErrored(void) const
int m_lastCardid
CardID of current/last recorder.
TVState GetState(void) const
bool AtNormalSpeed(void) const
void UnlockPlayingInfo(const char *file, int line) const
QRecursiveMutex m_stateLock
int GetRecorderNumber(void) const
static constexpr std::chrono::milliseconds kSMExitTimeout
Timeout after last Signal Monitor message for ignoring OSD when exiting.
int m_ffRewIndex
Index into m_ffRewSpeeds for FF and Rewind speeds.
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state)
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
QString GetFilters(const QString &baseFilters) const
bool IsPlayerPlaying(void) const
float m_tsNormal
Time stretch speed, 1.0F for normal playback.
bool GetErrorStatus(void)
QString GetChannelName(int pos=-1) const
void UpdateTVChain(const QStringList &data=QStringList())
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
QDateTime m_playingRecStart
void TeardownPlayer(void)
bool GetPlayingInfoMap(InfoMap &infoMap) const
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
QString GetPlayMessage(void) const
bool IsErrored(void) const
float GetNextPlaySpeed(void) const
void start(void)
starts measuring elapsed time.
std::chrono::minutes m_jumptime
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
bool IsPlaying(std::chrono::milliseconds wait_in_msec=0ms, bool wait_for=true) const
QString GetPreviousChannel(void) const
bool HandlePlayerSpeedChangeFFRew(void)
void StopPlaying(void) const
std::chrono::seconds m_fftime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QString GetPathname(void) const
bool IsPlayerErrored(void) const
QHash< QString, QString > InfoMap
void PushPreviousChannel(void)
most recently selected channel to the previous channel list
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
ProgramInfo * GetProgramAt(int at) const
Returns program at the desired location.
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
QString GetInetRef(void) const
bool IsVideoBD(void) const
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...
StringDeque m_prevChan
Previous channels.
void SetInitialTVState(bool islivetv)
determine initial tv state and playgroup for the recording
void SetRecorder(RemoteEncoder *rec)
ProgramInfo * m_playingInfo
Currently playing info.
@ kState_WatchingVideo
Watching Video is the state when we are watching a video and is not a dvd or BD.
void LockPlayingInfo(const char *file, int line) const
QString GetTitle(void) const
std::chrono::seconds m_rewtime
MythMediaBuffer * m_buffer
QRecursiveMutex m_deletePlayerLock
ProgramInfo * m_pseudoLiveTVRec
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 ...
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...
std::chrono::seconds m_playingLen
Initial CalculateLength()
QString GetPlaybackGroup(void) const
QString GetChannelPlaybackFilters(void) const
void ReloadAll(const QStringList &data=QStringList())
bool IsSameProgram(const ProgramInfo &p) const
std::chrono::seconds GetSecondsInRecording(void) const
Returns length of program/recording in seconds.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QRecursiveMutex m_playingInfoLock
void UnlockDeletePlayer(const char *file, int line) const
allow player to be deleted.
QString PopPreviousChannel(void)
int GetNumSetting(const QString &key, int defaultval=0)
QString InitializeNewChain(const QString &seed)
@ kState_WatchingPreRecorded
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
void LockState(void) const
PseudoState m_pseudoLiveTVState
@ kState_WatchingBD
Watching BD is the state when we are watching a BD.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
@ kState_WatchingDVD
Watching DVD is the state when we are watching a DVD.
static QString GetIcon(uint chanid)
Holds information on recordings and videos.
TVState
TVState is an enumeration of the states used by TV and TVRec.
uint GetSeason(void) const
MythTimer m_lastSignalMsgTime
void addMSecs(std::chrono::milliseconds ms)
Adds an offset to the last call to start() or restart().
void SetPlayer(MythPlayer *newplayer)
void SetRingBuffer(MythMediaBuffer *Buffer)
int m_ffRewSpeed
Caches value of m_ffRewSpeeds[m_ffRewIndex].
void SetPlayGroup(const QString &group)
TVState DequeueNextState(void)
bool IsVideoDVD(void) const
bool InStateChange(void) const
void SetTVChain(LiveTVChain *chain)
bool IsVideoFile(void) const
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
static const int kInitFFRWSpeed
bool HasPlayer(void) const
MythDeque< TVState > m_nextState
QString GetHostName(void)
virtual void StopPlaying(void)
QString StateToString(TVState state)
Returns a human readable QString representing a TVState.
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...
bool HandlePlayerSpeedChangeEOF(void)
RemoteEncoder * m_recorder
void enqueue(T d)
Adds item to the back of the list. O(1).
void UnlockState(void) const
int m_ffRewState
0 == normal, +1 == fast forward, -1 == rewind
bool IsRecording(void) const
T dequeue()
Removes item from front of list and returns a copy. O(1).
QString GetBasename(void) const
PlayerContext(QString inUseID=QString("Unknown"))
void ChangeState(TVState newState)
Puts a state change on the nextState queue.
static constexpr uint kMaxChannelHistory
void ForceNextStateNone(void)
Removes any pending state changes, and puts kState_None on the queue.
Keeps track of recordings in a current LiveTV instance.