12#include <QReadWriteLock>
13#include <QWaitCondition>
20#include <QRecursiveMutex>
166 static bool IsTVRunning();
168 static bool IsPaused();
170 static void SetFuncPtr(
const char*
Name,
void* Pointer);
171 static int ConfiguredTunerCards();
172 static bool IsTunable(
uint ChanId);
179 bool event(QEvent*
Event)
override;
180 bool eventFilter(QObject* Object, QEvent*
Event)
override;
181 void timerEvent(QTimerEvent*
Event)
override;
183 void HandleOSDClosed(
int OSDType);
189 void onApplicationStateChange(Qt::ApplicationState
State);
190 void customEvent(QEvent*
Event)
override;
191 void VolumeChange(
bool Up,
int NewVolume = -1);
194 void Embed(
bool Embed, QRect Rect = {},
const QStringList& Data = {});
197 static inline QStringList lastProgramStringList = {};
209 bool StartPlaying(std::chrono::milliseconds MaxWait = -1ms);
212 static TV* AcquireRelease(
int& RefCount,
bool Acquire,
bool Create =
false);
215 static QList<QKeyEvent*> ConvertScreenPressKeyMap(
const QString& KeyList);
223 bool ProcessKeypressOrGesture(QEvent*
Event);
224 bool TranslateKeyPressOrGesture(
const QString& Context, QEvent*
Event,
225 QStringList& Actions,
bool IsLiveTV,
226 bool AllowJumps =
true);
228 QStringList& Actions,
bool IsLiveTV);
229 void ProcessNetworkControlCommand(
const QString&
Command);
231 bool HandleTrackAction(
const QString&
Action);
232 bool ActiveHandleAction(
const QStringList& Actions,
bool IsDVD,
bool IsDVDStillFrame);
233 bool BrowseHandleAction(
const QStringList& Actions);
234 void OSDDialogEvent(
int Result,
const QString& Text, QString
Action);
235 bool ToggleHandleAction(
const QStringList& Actions,
bool IsDVD);
236 bool FFRewHandleAction(
const QStringList& Actions);
237 bool ActivePostQHandleAction(
const QStringList& Actions);
238 bool HandleJumpToProgramAction(
const QStringList& Actions);
239 bool SeekHandleAction(
const QStringList& Actions,
bool IsDVD);
240 bool TimeStretchHandleAction(
const QStringList& Actions);
241 bool DiscMenuHandleAction(
const QStringList& Actions)
const;
244 int StartTimer(std::chrono::milliseconds Interval,
int Line);
245 void KillTimer(
int Id);
247 void SetSpeedChangeTimer(std::chrono::milliseconds When,
int Line);
248 void HandleEndOfPlaybackTimerEvent();
249 void HandleEndOfRecordingExitPromptTimerEvent();
250 void HandleVideoExitDialogTimerEvent();
251 void HandlePseudoLiveTVTimerEvent();
252 void HandleSpeedChangeTimerEvent();
253 void ToggleSleepTimer();
254 void ToggleSleepTimer(
const QString& Time);
255 bool HandleLCDTimerEvent();
256 void HandleLCDVolumeTimerEvent();
257 void HandleSaveLastPlayPosEvent();
261 const QString& arg =
"");
262 bool IsTunablePriv(
uint ChanId);
266 const QString & EditArg =
"");
267 QString GetRecordingGroup()
const;
268 void UpdateChannelList(
int GroupID);
272 void ReturnOSDLock()
const;
273 void GetPlayerWriteLock()
const;
274 void GetPlayerReadLock()
const;
275 void ReturnPlayerLock()
const;
278 void ToggleAutoExpire();
287 void HandleStateChange();
289 void ForceNextStateNone();
290 void ScheduleStateChange();
291 void ScheduleInputChange();
301 void PrepareToExitPlayer(
int Line);
302 void SetExitPlayer(
bool SetIt,
bool WantsTo);
307 bool StartRecorder(std::chrono::milliseconds MaxWait = -1ms);
308 void StopStuff(
bool StopRingBuffer,
bool StopPlayer,
bool StopRecorder);
309 bool StartPlayer(
TVState desiredState);
321 bool IsDeleteAllowed();
324 static void ToggleChannelFavorite();
325 void ToggleChannelFavorite(
const QString &ChangroupName)
const;
327 void ChangeChannel(
uint Chanid,
const QString&
Channum);
329 void ShowPreviousChannel();
330 void PopPreviousChannel(
bool ImmediateChange);
333 void AddKeyToInputQueue(
char Key);
334 void ClearInputQueues(
bool Hideosd);
335 bool CommitQueuedInput();
336 bool ProcessSmartChannel(QString &InputStr);
343 QString GetQueuedInput()
const;
344 int GetQueuedInputAsInt(
bool *
OK =
nullptr,
int Base = 10)
const;
345 QString GetQueuedChanNum()
const;
349 void SwitchSource(
uint Direction);
350 void SwitchInputs(
uint ChanID = 0, QString ChanNum =
"",
uint InputID = 0);
354 void UnpauseLiveTV(
bool Quietly =
false);
356 float DoTogglePauseStart();
357 void DoTogglePauseFinish(
float Time,
bool ShowOSD);
358 void DoTogglePause(
bool ShowOSD);
359 bool DoSetPauseState(
bool Pause);
360 bool ContextIsPaused(
const char* File,
int Location);
367 void DoSeek(
float Time,
const QString &Msg,
bool TimeIsOffset,
bool HonorCutlist);
368 void DoSeek(std::chrono::seconds TimeInSec,
const QString &Msg,
bool TimeIsOffset,
bool HonorCutlist) {
369 DoSeek(TimeInSec.count(), Msg, TimeIsOffset, HonorCutlist); };
370 bool DoPlayerSeek(
float Time);
371 bool DoPlayerSeekToFrame(uint64_t FrameNum);
372 enum ArbSeekWhence { ARBSEEK_SET = 0, ARBSEEK_REWIND, ARBSEEK_FORWARD, ARBSEEK_END };
373 void DoSeekAbsolute(
long long Seconds,
bool HonorCutlist);
374 void DoArbSeek(ArbSeekWhence Whence,
bool HonorCutlist);
380 void ChangeSpeed(
int Direction);
381 void ToggleTimeStretch();
382 void ChangeTimeStretch(
int Dir,
bool AllowEdit =
true);
384 void DVDJumpForward();
386 void ChangeFFRew(
int Direction);
387 void SetFFRew(
int Index);
390 bool AudioSyncHandleAction(
const QStringList& Actions);
393 int GetNumChapters();
394 void GetChapterTimes(QList<std::chrono::seconds> &Times);
395 int GetCurrentChapter();
397 int GetCurrentTitle();
398 std::chrono::seconds GetTitleDuration(
int Title);
399 QString GetTitleName(
int Title);
400 void DoSwitchTitle(
int Title);
402 int GetCurrentAngle();
403 QString GetAngleName(
int Angle);
404 void DoSwitchAngle(
int Angle);
405 void DoJumpChapter(
int Chapter);
408 void DoSkipCommercials(
int Direction);
412 void DoQueueTranscode(
const QString& Profile);
415 bool IsBookmarkAllowed();
416 void SetBookmark(
bool Clear =
false);
420 void ToggleOSD(
bool IncludeStatusOSD);
421 void UpdateOSDProgInfo(
const char *WhichInfo);
422 void UpdateOSDStatus(
const QString& Title,
const QString& Desc,
423 const QString& Value,
int Type,
const QString& Units,
426 void UpdateOSDSeekMessage(
const QString &Msg,
enum OSDTimeout Timeout);
427 void UpdateOSDInput();
428 void UpdateOSDSignal(
const QStringList &List);
429 void UpdateOSDTimeoutMessage();
430 bool CalcPlayerSliderPosition(
osdInfo &
info,
bool paddedFields =
false)
const;
431 void HideOSDWindow(
const char *window);
434 bool SubtitleZoomHandleAction(
const QStringList& Actions);
435 bool SubtitleDelayHandleAction(
const QStringList &Actions);
439 bool PictureAttributeHandleAction(
const QStringList &Actions);
444 void ITVRestart(
bool IsLive);
447 void SetManualZoom(
bool ZoomON,
const QString& Desc);
448 bool ManualZoomHandleAction(
const QStringList &Actions);
451 void StartChannelEditMode();
452 bool HandleOSDChannelEdit(
const QString&
Action);
453 void ChannelEditAutoFill(
InfoMap &Info);
454 void ChannelEditXDSFill(
InfoMap &Info);
457 bool DialogIsVisible(
const QString &Dialog);
458 void HandleOSDInfo(
const QString&
Action);
462 void ShowOSDAskAllow();
463 void HandleOSDAskAllow(
const QString&
Action);
464 void AskAllowRecording(
const QStringList &Msg,
int Timeuntil,
bool HasRec,
bool HasLater);
467 void ShowOSDCutpoint(
const QString &Type);
468 bool HandleOSDCutpoint(
const QString&
Action);
469 void StartProgramEditMode();
472 void ShowOSDAlreadyEditing();
473 void HandleOSDAlreadyEditing(
const QString&
Action,
bool WasPaused);
477 void HandleOSDSleep(
const QString&
Action);
478 void SleepDialogTimeout();
482 void HandleOSDIdle(
const QString&
Action);
483 void IdleDialogTimeout();
486 void ShowOSDStopWatchingRecording();
487 void ShowOSDPromptDeleteRecording(
const QString& Title,
bool Force =
false);
488 bool HandleOSDVideoExit(
const QString&
Action);
491 void StartOsdNavigation();
494 void ShowOSDMenu(
bool isCompact =
false);
495 void FillOSDMenuJumpRec(
const QString &Category =
"",
int Level = 0,
const QString &Selected =
"");
497 const QVector<string_pair> & people);
498 void FillOSDMenuCast(
void);
499 void FillOSDMenuActorShows(
const QString & actor,
int person_id,
500 const QString & category =
"");
501 void PlaybackMenuShow(
const MythTVMenu &Menu,
const QDomNode &Node,
const QDomNode &Selected);
505 void PlaybackMenuInit(
const MythTVMenu& Menu);
506 void PlaybackMenuDeinit(
const MythTVMenu& Menu);
507 static void MenuStrings();
508 void MenuLazyInit(
void* Field);
513 void ShowLCDChannelInfo();
514 void ShowLCDDVDInfo();
523 QString m_dbChannelFormat {
"<num> <sign>"};
524 std::chrono::milliseconds m_dbIdleTimeout {0ms};
525 int m_dbPlaybackExitPrompt {0};
526 uint m_dbAutoexpireDefault {0};
527 bool m_dbAutoSetWatched {
false};
528 bool m_dbEndOfRecExitPrompt {
false};
529 bool m_dbJumpPreferOsd {
true};
530 bool m_dbUseGuiSizeForTv {
false};
531 bool m_dbUseVideoModes {
false};
532 bool m_dbRunJobsOnRemote {
false};
533 bool m_dbContinueEmbedded {
false};
534 bool m_dbBrowseAlways {
false};
537 bool m_dbRememberLastChannelGroup {
false};
540 bool m_smartForward {
false};
541 float m_ffRewRepos {1.0F};
542 bool m_ffRewReverse {
false};
550 mutable bool m_wantsToQuit {
true};
551 bool m_stretchAdjustment {
false};
552 bool m_audiosyncAdjustment {
false};
553 bool m_subtitleZoomAdjustment {
false};
554 bool m_subtitleDelayAdjustment {
false};
555 bool m_zoomMode {
false};
556 bool m_sigMonMode {
false};
557 bool m_endOfRecording {
false};
558 bool m_requestDelete {
false};
559 bool m_allowRerecord {
false};
560 bool m_doSmartForward {
false};
561 bool m_queuedTranscode {
false};
562 bool m_savePosOnExit {
false};
563 bool m_clearPosOnExit {
false};
586 std::chrono::milliseconds m_sleepTimerTimeout {0ms};
587 int m_sleepTimerId {0};
588 int m_sleepDialogTimerId {0};
590 int m_idleTimerId {0};
591 int m_idleDialogTimerId {0};
598 bool m_ccInputMode {
false};
602 bool m_asInputMode {
false};
619 static const int kScreenPressRegionCount = 12;
625 bool m_lockTimerOn {
false};
632 bool m_inPlaylist {
false};
633 bool m_underNetworkControl {
false};
636 bool m_jumpToProgram {
false};
646 bool m_noHardwareDecoders {
false};
664 bool m_weDisabledGUI {
false};
667 bool m_ignoreKeyPresses {
false};
668 bool m_savedPause {
false};
675 volatile int m_channelGroupId {-1};
682 volatile int m_lcdTimerId {0};
683 volatile int m_lcdVolumeTimerId {0};
684 volatile int m_networkControlTimerId {0};
685 volatile int m_ccInputTimerId {0};
686 volatile int m_asInputTimerId {0};
687 volatile int m_queueInputTimerId {0};
688 volatile int m_endOfPlaybackTimerId {0};
689 volatile int m_endOfRecPromptTimerId {0};
690 volatile int m_videoExitDialogTimerId {0};
691 volatile int m_pseudoChangeChanTimerId {0};
692 volatile int m_speedChangeTimerId {0};
693 volatile int m_errorRecoveryTimerId {0};
694 mutable volatile int m_exitPlayerTimerId {0};
695 volatile int m_saveLastPlayPosTimerId {0};
696 volatile int m_signalMonitorTimerId {0};
706 bool m_tvmAvsync {
true};
709 bool m_tvmFillAutoDetect {
false};
712 int m_tvmSpeedX100 {100};
714 bool m_tvmIsRecording {
false};
715 bool m_tvmIsRecorded {
false};
716 bool m_tvmIsVideo {
false};
718 bool m_tvmIsPaused {
false};
719 int m_tvmFreeRecorderCount {-1};
720 bool m_tvmIsDvd {
false};
721 bool m_tvmIsBd {
false};
722 bool m_tvmJump {
false};
723 bool m_tvmIsLiveTv {
false};
724 bool m_tvmPreviousChan {
false};
727 int m_tvmNumChapters {0};
728 int m_tvmCurrentChapter {0};
730 int m_tvmNumAngles {0};
731 int m_tvmCurrentAngle {0};
732 int m_tvmNumTitles {0};
733 int m_tvmCurrentTitle {0};
735 bool m_tvmSubsForcedOn {
true};
736 bool m_tvmSubsHaveSubs {
false};
738 bool m_tvmIsOn {
false};
739 bool m_tvmTranscoding {
false};
750 static inline const int kInitFFRWSpeed = 0;
751 static inline const uint kInputKeysMax = 6;
752 static inline const uint kNextSource = 1;
753 static inline const uint kPreviousSource = 2;
755 static inline const std::chrono::milliseconds kInputModeTimeout = 5s;
756 static inline const std::chrono::milliseconds kLCDTimeout = 1s;
757 static inline const std::chrono::milliseconds kBrowseTimeout = 30s;
758 static inline const std::chrono::milliseconds kKeyRepeatTimeout = 300ms;
759 static inline const std::chrono::milliseconds kPrevChanTimeout = 750ms;
760 static inline const std::chrono::milliseconds kSleepTimerDialogTimeout = 45s;
761 static inline const std::chrono::milliseconds kIdleTimerDialogTimeout = 45s;
762 static inline const std::chrono::milliseconds kVideoExitDialogTimeout = 2min;
763 static inline const std::chrono::milliseconds kEndOfPlaybackCheckFrequency = 250ms;
764 static inline const std::chrono::milliseconds kEmbedCheckFrequency = 250ms;
765 static inline const std::chrono::milliseconds kSpeedChangeCheckFrequency = 250ms;
766 static inline const std::chrono::milliseconds kErrorRecoveryCheckFrequency = 250ms;
767 static inline const std::chrono::milliseconds kEndOfRecPromptCheckFrequency = 250ms;
768 static inline const std::chrono::milliseconds kSaveLastPlayPosTimeout = 5s;
770 static inline const std::chrono::milliseconds kEndOfPlaybackFirstCheckTimer = 1min;
772 static inline const std::chrono::milliseconds kEndOfPlaybackFirstCheckTimer = 5s;
std::vector< ChannelGroupItem > ChannelGroupList
std::vector< ChannelInfo > ChannelInfoList
An action (for this plugin) consists of a description, and a set of key sequences.
AskProgramInfo(QDateTime e, bool r, bool l, ProgramInfo *i)
bool m_isInSameInputGroup
A custom event that represents a mouse gesture.
A QElapsedTimer based timer to replace use of QTime as a timer.
Holds information on recordings and videos.
General purpose reference counter.
SavePositionThread(ProgramInfo *progInfoPtr, uint64_t framesPos)
bool m_dbUseChannelGroups
Tracks current playback state, as signalled by the player, and requests changes to the current state.
This is the coordinating class of the Recorder Subsystem.
QList< std::chrono::seconds > m_tvmChapterTimes
MythTVMenu m_playbackCompactMenu
InfoMap m_chanEditMap
Channel Editing initial map.
QList< QKeyEvent * > m_screenPressKeyMapLiveTV
bool GetJumpToProgram() const
This is set if the user asked MythTV to jump to the previous recording in the playlist.
QList< QKeyEvent * > m_screenPressKeyMapPlayback
static const std::vector< SleepTimerInfo > s_sleepTimes
uint GetQueuedChanID() const
QMap< QString, ProgramList > m_progLists
MythDeque< QString > m_networkControlCommands
MythTVMenu m_cutlistCompactMenu
bool HasQueuedChannel() const
bool GetAllowRerecord() const
Returns true if the user told Mythtv to allow re-recording of the show.
QVector< string_pair > m_guests
ChannelGroupList m_dbChannelGroups
void setUnderNetworkControl(bool setting)
bool GetEndOfRecording() const
This is set to true if the player reaches the end of the recording without the user explicitly exitin...
QVariant m_tvmJumprecBackHack
QMap< QString, AskProgramInfo > m_askAllowPrograms
QString m_queuedChanNum
Input key presses queued up so far to form a valid ChanNum.
MythTimer m_keyRepeatTimer
Queue of unprocessed key presses.
QRect m_playerBounds
Prior GUI window bounds, for DoEditSchedule() and player exit().
QReadWriteLock m_playerLock
lock on player and playerActive changes
QRecursiveMutex m_askAllowLock
void PlaybackExiting(TV *Player)
QPair< QString, QString > string_pair
QMutex m_channelGroupLock
Lock necessary when modifying channel group variables.
std::vector< int > m_ffRewSpeeds
QDateTime m_lastLockSeenTime
QString m_queuedInput
Input key presses queued up so far...
MythTVMenu m_playbackMenu
QVector< string_pair > m_guest_stars
bool IsSwitchingCards() const
Returns true if we are currently in the process of switching recorders.
void DoSeek(std::chrono::seconds TimeInSec, const QString &Msg, bool TimeIsOffset, bool HonorCutlist)
QElapsedTimer m_lockTimer
QRecursiveMutex m_chanEditMapLock
Lock for chanEditMap and ddMap.
bool HasQueuedInput() const
QVector< string_pair > m_actors
void SetInPlayList(bool InPlayList)
ChannelInfoList m_channelGroupChannelList
Simple screen shown while the video player is starting up.
static void ReloadKeys(void)
static void InitKeys(void)
QHash< QString, QString > InfoMap
const QString kPlayerInUseID
ChannelChangeDirection
ChannelChangeDirection is an enumeration of possible channel changing directions.
TVState
TVState is an enumeration of the states used by TV and TVRec.
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
void(*)(const ProgramInfo *, void *) EMBEDRETURNVOIDSCHEDIT
void(*)(void *, bool) EMBEDRETURNVOID
void(*)(uint, const QString &, const QDateTime, TV *, bool, bool, int) EMBEDRETURNVOIDEPG
void(*)(TV *, int, const QString &) EMBEDRETURNVOIDPROGLIST
void(*)(TV *, bool, bool) EMBEDRETURNVOIDFINDER
@ kStartTVIgnoreLastPlayPos
@ kStartTVIgnoreProgStart
@ kStartTVByNetworkCommand
NoRecorderMsg
Type of message displayed in ShowNoRecorderDialog()
@ kNoRecorders
No free recorders.
@ kNoCurrRec
No current recordings.
@ kNoTuners
No capture cards configured.