Go to the documentation of this file.
6 #include "mythconfig.h"
25 #define LOC QString("playCtx: ")
31 m_recUsage(std::move(inUseID))
64 QString newPlaygroup(
"Default");
77 .addSecs(overrecordseconds);
81 newState = (curtime < recendts) ?
197 const QString& chan = curChan;
239 LOG(VB_GENERAL, LOG_DEBUG, QString(
"LockPlayingInfo(%1,%2)")
251 LOG(VB_GENERAL, LOG_DEBUG, QString(
"UnlockPlayingInfo(%1,%2)")
268 LOG(VB_GENERAL, LOG_DEBUG, QString(
"LockDeletePlayer(%1,%2)")
283 LOG(VB_GENERAL, LOG_DEBUG, QString(
"UnlockDeletePlayer(%1,%2)")
308 return inStateChange;
368 infoMap[
"coverartpath"] =
370 infoMap[
"fanartpath"] =
372 infoMap[
"bannerpath"] =
374 infoMap[
"screenshotpath"] =
395 QString filters = baseFilters;
406 if (!chanFilters.isEmpty())
408 if ((chanFilters[0] !=
'+'))
410 filters = chanFilters;
414 if (!filters.isEmpty() && (!filters.endsWith(
",")))
417 filters += chanFilters.midRef(1);
421 LOG(VB_CHANNEL, LOG_INFO,
LOC +
422 QString(
"Output filters for this channel are: '%1'")
430 QString mesg = QObject::tr(
"Play");
434 mesg += QString(
" 1/2x");
436 mesg += QString(
" 1/3x");
438 mesg += QString(
" 1/4x");
440 mesg += QString(
" 1/8x");
442 mesg += QString(
" 1/16x");
546 QString msg = QString(
"Wants to record: %1 %2 %3 %4")
550 LOG(VB_PLAYBACK, LOG_INFO,
LOC + msg);
558 QString msg = QString(
"Done recording: %1 %2 %3 %4")
562 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
int GetRecorderNumber(void) const
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.
uint GetSecondsInRecording(void) const
Returns length of program/recording in seconds.
void addMSecs(int ms)
Adds an offset to the last call to start() or restart().
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.
void TeardownPlayer(void)
bool GetPlayingInfoMap(InfoMap &infoMap) const
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
arg(title).arg(filename).arg(doDelete))
QString GetPlayMessage(void) const
bool IsErrored(void) const
float GetNextPlaySpeed(void) const
void start(void)
starts measuring elapsed time.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QString GetPreviousChannel(void) const
bool HandlePlayerSpeedChangeFFRew(void)
void StopPlaying(void) const
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
static const uint kMaxChannelHistory
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
MythMediaBuffer * m_buffer
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 ...
QMutex m_deletePlayerLock
QString GetPlaybackGroup(void) const
QString GetChannelPlaybackFilters(void) const
void ReloadAll(const QStringList &data=QStringList())
bool IsSameProgram(const ProgramInfo &p) const
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
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
static const uint kSMExitTimeout
Timeout after last Signal Monitor message for ignoring OSD when exiting.
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 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
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
void SetTVChain(LiveTVChain *chain)
bool IsVideoFile(void) const
bool IsPlaying(uint wait_in_msec=0, bool wait_for=true) 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
1x, default to normal speed
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
long long m_playingLen
Initial CalculateLength()
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.
void ForceNextStateNone(void)
Removes any pending state changes, and puts kState_None on the queue.
Keeps track of recordings in a current LiveTV instance.