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) ?
200 const QString& chan = curChan;
240 [[maybe_unused]]
int line)
const
243 LOG(VB_GENERAL, LOG_DEBUG, QString(
"LockPlayingInfo(%1,%2)")
244 .arg(
file).arg(line));
250 [[maybe_unused]]
int line)
const
253 LOG(VB_GENERAL, LOG_DEBUG, QString(
"UnlockPlayingInfo(%1,%2)")
254 .arg(
file).arg(line));
265 [[maybe_unused]]
int line)
const
268 LOG(VB_GENERAL, LOG_DEBUG, QString(
"LockDeletePlayer(%1,%2)")
269 .arg(
file).arg(line));
278 [[maybe_unused]]
int line)
const
281 LOG(VB_GENERAL, LOG_DEBUG, QString(
"UnlockDeletePlayer(%1,%2)")
282 .arg(
file).arg(line));
303 return inStateChange;
363 infoMap[
"coverartpath"] =
365 infoMap[
"fanartpath"] =
367 infoMap[
"bannerpath"] =
369 infoMap[
"screenshotpath"] =
390 QString filters = baseFilters;
401 if (!chanFilters.isEmpty())
403 if ((chanFilters[0] !=
'+'))
405 filters = chanFilters;
409 if (!filters.isEmpty() && (!filters.endsWith(
",")))
412 filters += chanFilters.mid(1);
416 LOG(VB_CHANNEL, LOG_INFO,
LOC +
417 QString(
"Output filters for this channel are: '%1'")
425 QString mesg = QObject::tr(
"Play");
428 mesg = QObject::tr(
"Rewind");
433 mesg = QObject::tr(
"Forward");
444 mesg += QString(
" 1/3X");
448 mesg += QString(
" 1/8X");
452 mesg += QString(
" 1/16X");
539 m_fftime = PlayGroup::GetDurSetting<std::chrono::seconds>(group,
"skipahead", 30s);
540 m_rewtime = PlayGroup::GetDurSetting<std::chrono::seconds>(group,
"skipback", 5s);
541 m_jumptime = PlayGroup::GetDurSetting<std::chrono::minutes>(group,
"jump", 10min);
555 QString msg = QString(
"Wants to record: %1 %2 %3 %4")
559 LOG(VB_PLAYBACK, LOG_INFO,
LOC + msg);
567 QString msg = QString(
"Done recording: %1 %2 %3 %4")
571 LOG(VB_PLAYBACK, LOG_INFO,
LOC + msg);
static int GetSetting(const QString &name, const QString &field, int defval)
@ kState_WatchingBD
Watching BD is the state when we are watching a BD.
bool IsRecorderErrored(void) const
int m_lastCardid
CardID of current/last recorder.
TVState GetState(void) const
bool AtNormalSpeed(void) const
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
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
ProgramInfo * GetProgramAt(int at) const
Returns program at the desired location.
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.
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()
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
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)
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
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
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
static QString GetIcon(uint chanid)
Holds information on recordings and videos.
uint GetSeason(void) const
@ kState_WatchingVideo
Watching Video is the state when we are watching a video and is not a dvd or BD.
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
TVState is an enumeration of the states used by TV and TVRec.
TVState DequeueNextState(void)
bool IsVideoDVD(void) const
bool InStateChange(void) const
void SetTVChain(LiveTVChain *chain)
bool IsVideoFile(void) const
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 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
@ kState_WatchingDVD
Watching DVD is the state when we are watching a DVD.
PlayerContext(QString inUseID=QString("Unknown"))
void ChangeState(TVState newState)
Puts a state change on the nextState queue.
static constexpr uint kMaxChannelHistory
void enqueue(const T &d)
Adds item to the back of the list. O(1).
void ForceNextStateNone(void)
Removes any pending state changes, and puts kState_None on the queue.
Keeps track of recordings in a current LiveTV instance.