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 QString GetIcon(uint chanid)
Keeps track of recordings in a current LiveTV instance.
QString GetChannelName(int pos=-1) const
void ReloadAll(const QStringList &data=QStringList())
ProgramInfo * GetProgramAt(int at) const
Returns program at the desired location.
QString InitializeNewChain(const QString &seed)
bool IsDatabaseIgnored(void) const
/brief Returns true if database is being ignored.
QString GetHostName(void)
int GetNumSetting(const QString &key, int defaultval=0)
T dequeue()
Removes item from front of list and returns a copy. O(1).
void enqueue(const T &d)
Adds item to the back of the list. O(1).
float GetNextPlaySpeed(void) const
bool AtNormalSpeed(void) const
bool IsPlaying(std::chrono::milliseconds wait_in_msec=0ms, bool wait_for=true) const
bool IsErrored(void) const
virtual void StopPlaying(void)
void addMSecs(std::chrono::milliseconds ms)
Adds an offset to the last call to start() or restart().
void start(void)
starts measuring elapsed time.
static int GetSetting(const QString &name, const QString &field, int defval)
void SetRingBuffer(MythMediaBuffer *Buffer)
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
QRecursiveMutex m_playingInfoLock
StringDeque m_prevChan
Previous channels.
QString GetPlayMessage(void) const
PlayerContext(QString inUseID=QString("Unknown"))
void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state)
PseudoState m_pseudoLiveTVState
MythTimer m_lastSignalMsgTime
static constexpr uint kMaxChannelHistory
void LockState(void) const
void LockPlayingInfo(const char *file, int line) const
void SetPlayGroup(const QString &group)
TVState GetState(void) const
QRecursiveMutex m_deletePlayerLock
static constexpr std::chrono::milliseconds kSMExitTimeout
Timeout after last Signal Monitor message for ignoring OSD when exiting.
bool HasPlayer(void) const
bool IsPlayerErrored(void) const
void PushPreviousChannel(void)
most recently selected channel to the previous channel list
bool IsPlayerPlaying(void) const
QDateTime m_playingRecStart
std::chrono::seconds m_rewtime
int m_ffRewState
0 == normal, +1 == fast forward, -1 == rewind
TVState DequeueNextState(void)
void ForceNextStateNone(void)
Removes any pending state changes, and puts kState_None on the queue.
QString GetFilters(const QString &baseFilters) const
int m_lastCardid
CardID of current/last recorder.
void UnlockDeletePlayer(const char *file, int line) const
allow player to be deleted.
void UnlockState(void) const
int m_ffRewIndex
Index into m_ffRewSpeeds for FF and Rewind speeds.
RemoteEncoder * m_recorder
void UpdateTVChain(const QStringList &data=QStringList())
bool HandlePlayerSpeedChangeFFRew(void)
bool InStateChange(void) const
void SetPlayer(MythPlayer *newplayer)
int m_ffRewSpeed
Caches value of m_ffRewSpeeds[m_ffRewIndex].
void SetTVChain(LiveTVChain *chain)
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 ...
void SetRecorder(RemoteEncoder *rec)
bool IsRecorderErrored(void) const
bool HandlePlayerSpeedChangeEOF(void)
float m_tsNormal
Time stretch speed, 1.0F for normal playback.
std::chrono::seconds m_fftime
QString GetPreviousChannel(void) const
QRecursiveMutex m_stateLock
MythMediaBuffer * m_buffer
bool GetPlayingInfoMap(InfoMap &infoMap) const
void SetInitialTVState(bool islivetv)
determine initial tv state and playgroup for the recording
void ChangeState(TVState newState)
Puts a state change on the nextState queue.
std::chrono::minutes m_jumptime
QString PopPreviousChannel(void)
MythDeque< TVState > m_nextState
bool IsSameProgram(const ProgramInfo &p) const
std::chrono::seconds m_playingLen
Initial CalculateLength()
void TeardownPlayer(void)
void UnlockPlayingInfo(const char *file, int line) const
ProgramInfo * m_pseudoLiveTVRec
void StopPlaying(void) const
ProgramInfo * m_playingInfo
Currently playing info.
Holds information on recordings and videos.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
QString GetBasename(void) const
bool IsVideoFile(void) const
bool IsVideoDVD(void) const
QString GetChannelPlaybackFilters(void) const
QString GetInetRef(void) const
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 IsRecording(void) const
QString GetPlaybackGroup(void) const
QString GetTitle(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...
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
bool IsVideoBD(void) const
std::chrono::seconds GetSecondsInRecording(void) const
Returns length of program/recording in seconds.
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...
QString GetPathname(void) const
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
uint GetSeason(void) const
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
int GetRecorderNumber(void) const
bool GetErrorStatus(void)
static const int kInitFFRWSpeed
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QHash< QString, QString > InfoMap
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
QString StateToString(TVState state)
Returns a human readable QString representing a TVState.
TVState
TVState is an enumeration of the states used by TV and TVRec.
@ kState_WatchingDVD
Watching DVD is the state when we are watching a DVD.
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
@ kState_WatchingPreRecorded
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
@ kState_WatchingBD
Watching BD is the state when we are watching a BD.
@ kState_WatchingVideo
Watching Video is the state when we are watching a video and is not a dvd or BD.