MythTV  master
tv_play.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 #ifndef TVPLAY_H
4 #define TVPLAY_H
5 
6 // C++
7 #include <cstdint>
8 #include <utility>
9 #include <vector>
10 
11 // Qt
12 #include <QReadWriteLock>
13 #include <QWaitCondition>
14 #include <QStringList>
15 #include <QDateTime>
16 #include <QObject>
17 #include <QRegExp>
18 #include <QString>
19 #include <QMutex>
20 #include <QMap>
21 #include <QSet>
22 
23 // MythTV
24 #include "mythdeque.h"
25 #include "tv.h"
26 #include "channelinfo.h"
27 #include "videoouttypes.h"
28 #include "volumebase.h"
29 #include "inputinfo.h"
30 #include "channelgroup.h"
31 #include "mythtimer.h"
32 #include "osd.h"
33 #include "playercontext.h"
34 #include "decoders/decoderbase.h"
35 #include "mythmiscutil.h"
36 #include "tvbrowsehelper.h"
37 #include "mythtvmenu.h"
38 #include "tvplaybackstate.h"
39 #include "referencecounter.h"
40 
41 class QEvent;
42 class QKeyEvent;
43 class QTimerEvent;
44 class QDateTime;
45 class QDomDocument;
46 class QDomNode;
47 class OSD;
48 class RemoteEncoder;
49 class MythPlayer;
50 class MythPlayerUI;
51 class MythMediaBuffer;
52 class ProgramInfo;
53 class TvPlayWindow;
54 class TV;
55 class MythMainWindow;
56 struct osdInfo;
57 
58 using EMBEDRETURNVOID = void (*) (void *, bool);
59 using EMBEDRETURNVOIDEPG = void (*) (uint, const QString &, const QDateTime, TV *, bool, bool, int);
60 using EMBEDRETURNVOIDFINDER = void (*) (TV *, bool, bool);
61 using EMBEDRETURNVOIDSCHEDIT = void (*) (const ProgramInfo *, void *);
62 
63 // Locking order
64 //
65 // playerLock -> askAllowLock -> osdLock
66 // -> progListLock -> osdLock
67 // -> chanEditMapLock -> osdLock
68 // -> lastProgramLock
69 // -> recorderPlaybackInfoLock
70 // -> timerIdLock
71 // -> mainLoopCondLock
72 // -> channelGroupLock
73 //
74 // When holding one of these locks, you may lock any lock of the locks to
75 // the right of the current lock, but may not lock any lock to the left of
76 // this lock (which will cause a deadlock). Nor should you lock any other
77 // lock in the TV class without first adding it to the locking order list
78 // above.
79 //
80 // Note: Taking a middle lock such as askAllowLock, without taking a
81 // playerLock first does not violate these rules, but once you are
82 // holding it, you cannot later lock playerLock.
83 //
84 // It goes without saying that any locks outside of this class should only
85 // be taken one at a time, and should be taken last and released first of
86 // all the locks required for any algorithm. (Unless you use tryLock and
87 // release all locks if it can't gather them all at once, see the
88 // "multi_lock()" function as an example; but this is not efficient nor
89 // desirable and should be avoided when possible.)
90 //
91 
98 };
99 
104 {
107  kNoTuners = 2,
108 };
109 
110 enum {
117 };
118 
120 {
121  public:
122  AskProgramInfo() = default;
123  AskProgramInfo(QDateTime e, bool r, bool l, ProgramInfo *i) :
124  m_expiry(std::move(e)), m_hasRec(r), m_hasLater(l), m_info(i) {}
125 
126  QDateTime m_expiry;
127  bool m_hasRec {false};
128  bool m_hasLater {false};
129  bool m_isInSameInputGroup {false};
130  bool m_isConflicting {false};
131  ProgramInfo *m_info {nullptr};
132 };
133 
153 {
154  friend class PlaybackBox;
155  friend class GuideGrid;
156  friend class TVBrowseHelper;
157 
158  Q_OBJECT
159 
160  public:
161  static bool IsTVRunning();
162  static bool StartTV(ProgramInfo* TVRec, uint Flags, const ChannelInfoList& Selection = ChannelInfoList());
163  static bool IsPaused();
164  static void InitKeys();
165  static void SetFuncPtr(const char* Name, void* Pointer);
166  static int ConfiguredTunerCards();
167  static bool IsTunable(uint ChanId);
168  void ReloadKeys();
169 
170  bool IsSameProgram(const ProgramInfo* ProgInfo) const;
171 
172  public slots:
173  bool event(QEvent* Event) override;
174  bool eventFilter(QObject* Object, QEvent* Event) override;
175  void timerEvent(QTimerEvent* Event) override;
176  void StopPlayback();
177  void HandleOSDClosed(int OSDType);
178 
179  signals:
180  void PlaybackExiting(TV* Player);
181 
182  protected slots:
183  void onApplicationStateChange(Qt::ApplicationState State);
184  void customEvent(QEvent* Event) override;
185  void VolumeChange(bool Up, int NewVolume = -1);
186 
187  private slots:
188  void Embed(bool Embed, QRect Rect = {}, const QStringList& Data = {});
189 
190  private:
191  static QStringList lastProgramStringList;
197 
198  explicit TV(MythMainWindow* MainWindow);
199  ~TV() override;
200  PlayerContext* GetPlayerContext();
201  bool CreatePlayer(TVState State, bool Muted = false);
202  bool StartPlaying(int MaxWait = -1);
203 
204  // Private initialisation
205  static TV* AcquireRelease(int& RefCount, bool Acquire, bool Create = false);
206  bool Init();
207  void InitFromDB();
208  static QList<QKeyEvent> ConvertScreenPressKeyMap(const QString& KeyList);
209 
210  // Top level playback methods
211  bool LiveTV(bool ShowDialogs, const ChannelInfoList &Selection);
212  int Playback(const ProgramInfo &ProgInfo);
213  void PlaybackLoop();
214 
215  // Private event handling
216  bool ProcessKeypressOrGesture(QEvent* Event);
217  bool TranslateKeyPressOrGesture(const QString& Context, QEvent* Event,
218  QStringList& Actions, bool IsLiveTV,
219  bool AllowJumps = true);
220  bool TranslateGesture(const QString &Context, MythGestureEvent *Event,
221  QStringList& Actions, bool IsLiveTV);
222  void ProcessNetworkControlCommand(const QString& Command);
223 
224  bool HandleTrackAction(const QString& Action);
225  bool ActiveHandleAction(const QStringList& Actions, bool IsDVD, bool IsDVDStillFrame);
226  bool BrowseHandleAction(const QStringList& Actions);
227  void OSDDialogEvent(int Result, const QString& Text, QString Action);
228  bool ToggleHandleAction(const QStringList& Actions, bool IsDVD);
229  bool FFRewHandleAction(const QStringList& Actions);
230  bool ActivePostQHandleAction(const QStringList& Actions);
231  bool HandleJumpToProgramAction(const QStringList& Actions);
232  bool SeekHandleAction(const QStringList& Actions, bool IsDVD);
233  bool TimeStretchHandleAction(const QStringList& Actions);
234  bool DiscMenuHandleAction(const QStringList& Actions) const;
235 
236  // Timers and timer events
237  int StartTimer(int Interval, int Line);
238  void KillTimer(int Id);
239 
240  void SetSpeedChangeTimer(int When, int Line);
241  void HandleEndOfPlaybackTimerEvent();
242  void HandleEndOfRecordingExitPromptTimerEvent();
243  void HandleVideoExitDialogTimerEvent();
244  void HandlePseudoLiveTVTimerEvent();
245  void HandleSpeedChangeTimerEvent();
246  void ToggleSleepTimer();
247  void ToggleSleepTimer(const QString& Time);
248  bool HandleLCDTimerEvent();
249  void HandleLCDVolumeTimerEvent();
250  void HandleSaveLastPlayPosEvent();
251 
252  // Commands used by frontend UI screens (PlaybackBox, GuideGrid etc)
253  void EditSchedule(int EditType = kScheduleProgramGuide);
254  bool IsTunablePriv(uint ChanId);
255  static QSet<uint> IsTunableOn(PlayerContext* Context, uint ChanId);
256  void ChangeChannel(const ChannelInfoList& Options);
257  void DoEditSchedule(int EditType = kScheduleProgramGuide);
258  QString GetRecordingGroup() const;
259  void UpdateChannelList(int GroupID);
260 
261  // Lock handling
262  OSD* GetOSDL();
263  void ReturnOSDLock();
264  void GetPlayerWriteLock();
265  void GetPlayerReadLock();
266  void GetPlayerReadLock() const;
267  void ReturnPlayerLock();
268  void ReturnPlayerLock() const;
269 
270  // Other toggles
271  void ToggleAutoExpire();
272  void QuickRecord();
273 
274  // General TV state
275  static bool StateIsRecording(TVState State);
276  static bool StateIsPlaying(TVState State);
277  static bool StateIsLiveTV(TVState State);
278 
279  TVState GetState() const;
280  void HandleStateChange();
281  void GetStatus();
282  void ForceNextStateNone();
283  void ScheduleStateChange();
284  void ScheduleInputChange();
285  void SetErrored();
286  void SetInPlayList(bool InPlayList) { m_inPlaylist = InPlayList; }
287  void setUnderNetworkControl(bool setting) { m_underNetworkControl = setting; }
288  void PrepToSwitchToRecordedProgram(const ProgramInfo& ProgInfo);
292  kBookmarkAuto // set iff db_playback_exit_prompt==2
293  };
294  void PrepareToExitPlayer(int Line, BookmarkAction Bookmark = kBookmarkAuto);
295  void SetExitPlayer(bool SetIt, bool WantsTo);
296 
297  bool RequestNextRecorder(bool ShowDialogs, const ChannelInfoList &Selection = ChannelInfoList());
298  void DeleteRecorder();
299 
300  bool StartRecorder(int MaxWait = -1);
301  void StopStuff(bool StopRingBuffer, bool StopPlayer, bool StopRecorder);
302  bool StartPlayer(TVState desiredState);
303 
305  bool IsSwitchingCards() const { return m_switchToRec; }
307  bool GetAllowRerecord() const { return m_allowRerecord; }
310  bool GetEndOfRecording() const { return m_endOfRecording; }
313  bool GetJumpToProgram() const { return m_jumpToProgram; }
314  bool IsDeleteAllowed();
315 
316  // Channels
317  static void ToggleChannelFavorite();
318  void ToggleChannelFavorite(const QString &ChangroupName) const;
319  void ChangeChannel(ChannelChangeDirection Direction);
320  void ChangeChannel(uint Chanid, const QString& Channum);
321 
322  void ShowPreviousChannel();
323  void PopPreviousChannel(bool ImmediateChange);
324 
325  // key queue commands
326  void AddKeyToInputQueue(char Key);
327  void ClearInputQueues(bool Hideosd);
328  bool CommitQueuedInput();
329  bool ProcessSmartChannel(QString &InputStr);
330 
331  // query key queues
332  bool HasQueuedInput() const { return !GetQueuedInput().isEmpty(); }
333  bool HasQueuedChannel() const { return m_queuedChanID || !GetQueuedChanNum().isEmpty(); }
334 
335  // get queued up input
336  QString GetQueuedInput() const;
337  int GetQueuedInputAsInt(bool *OK = nullptr, int Base = 10) const;
338  QString GetQueuedChanNum() const;
339  uint GetQueuedChanID() const { return m_queuedChanID; }
340 
341  // Source and input
342  void SwitchSource(uint Direction);
343  void SwitchInputs(uint ChanID = 0, QString ChanNum = "", uint InputID = 0);
344 
345  // Pause/play
346  void PauseLiveTV();
347  void UnpauseLiveTV(bool Quietly = false);
348  void DoPlay();
349  float DoTogglePauseStart();
350  void DoTogglePauseFinish(float Time, bool ShowOSD);
351  void DoTogglePause(bool ShowOSD);
352  bool DoSetPauseState(bool Pause);
353  bool ContextIsPaused(const char* File, int Location);
354 
355  // Program jumping stuff
356  void SetLastProgram(const ProgramInfo* ProgInfo);
357  ProgramInfo *GetLastProgram() const;
358 
359  // Seek, skip, jump, speed
360  void DoSeek(float Time, const QString &Msg, bool TimeIsOffset, bool HonorCutlist);
361  bool DoPlayerSeek(float Time);
362  bool DoPlayerSeekToFrame(uint64_t FrameNum);
363  enum ArbSeekWhence { ARBSEEK_SET = 0, ARBSEEK_REWIND, ARBSEEK_FORWARD, ARBSEEK_END };
364  void DoSeekAbsolute(long long Seconds, bool HonorCutlist);
365  void DoArbSeek(ArbSeekWhence Whence, bool HonorCutlist);
366  void DoJumpFFWD();
367  void DoJumpRWND();
368  void DoSeekFFWD();
369  void DoSeekRWND();
370  void NormalSpeed();
371  void ChangeSpeed(int Direction);
372  void ToggleTimeStretch();
373  void ChangeTimeStretch(int Dir, bool AllowEdit = true);
374  void DVDJumpBack();
375  void DVDJumpForward();
376  float StopFFRew();
377  void ChangeFFRew(int Direction);
378  void SetFFRew(int Index);
379 
380  // Private audio methods
381  bool AudioSyncHandleAction(const QStringList& Actions);
382 
383  // Chapters, titles and angles
384  int GetNumChapters();
385  void GetChapterTimes(QList<long long> &Times);
386  int GetCurrentChapter();
387  int GetNumTitles();
388  int GetCurrentTitle();
389  int GetTitleDuration(int Title);
390  QString GetTitleName(int Title);
391  void DoSwitchTitle(int Title);
392  int GetNumAngles();
393  int GetCurrentAngle();
394  QString GetAngleName(int Angle);
395  void DoSwitchAngle(int Angle);
396  void DoJumpChapter(int Chapter);
397 
398  // Commercial skipping
399  void DoSkipCommercials(int Direction);
400  void SetAutoCommercialSkip(CommSkipMode SkipMode = kCommSkipOff);
401 
402  // Transcode
403  void DoQueueTranscode(const QString& Profile);
404 
405  // Bookmarks
406  bool IsBookmarkAllowed();
407  void SetBookmark(bool Clear = false);
408 
409  // OSD
410  void ClearOSD();
411  void ToggleOSD( bool IncludeStatusOSD);
412  void UpdateOSDProgInfo(const char *WhichInfo);
413  void UpdateOSDStatus(const QString& Title, const QString& Desc,
414  const QString& Value, int Type, const QString& Units,
415  int Position = 0, enum OSDTimeout Timeout = kOSDTimeout_Med);
416  void UpdateOSDStatus(osdInfo &Info, int Type, enum OSDTimeout Timeout);
417  void UpdateOSDSeekMessage(const QString &Msg, enum OSDTimeout Timeout);
418  void UpdateOSDInput();
419  void UpdateOSDSignal(const QStringList &List);
420  void UpdateOSDTimeoutMessage();
421  bool CalcPlayerSliderPosition(osdInfo &info, bool paddedFields = false) const;
422 
423  // Captions/subtitles
424  bool SubtitleZoomHandleAction(const QStringList& Actions);
425  bool SubtitleDelayHandleAction(const QStringList &Actions);
426 
427  // Video controls
428  void DoTogglePictureAttribute(PictureAdjustType Type);
429  bool PictureAttributeHandleAction(const QStringList &Actions);
430  PictureAttribute NextPictureAdjustType(PictureAdjustType Type, PictureAttribute Attr);
431  void OverrideScan(FrameScanType Scan);
432 
433  // Sundry on screen
434  void ITVRestart(bool IsLive);
435 
436  // Manual zoom mode
437  void SetManualZoom(bool ZoomON, const QString& Desc);
438  bool ManualZoomHandleAction(const QStringList &Actions);
439 
440  // Channel editing support
441  void StartChannelEditMode();
442  bool HandleOSDChannelEdit(const QString& Action);
443  void ChannelEditAutoFill(InfoMap &Info);
444  void ChannelEditXDSFill(InfoMap &Info);
445 
446  // General dialog handling
447  bool DialogIsVisible(const QString &Dialog);
448  void HandleOSDInfo(const QString& Action);
449  void ShowNoRecorderDialog(NoRecorderMsg MsgType = kNoRecorders);
450 
451  // AskAllow dialog handling
452  void ShowOSDAskAllow();
453  void HandleOSDAskAllow(const QString& Action);
454  void AskAllowRecording(const QStringList &Msg, int Timeuntil, bool HasRec, bool HasLater);
455 
456  // Program editing support
457  void ShowOSDCutpoint(const QString &Type);
458  bool HandleOSDCutpoint(const QString& Action);
459  void StartProgramEditMode();
460 
461  // Already editing dialog
462  void ShowOSDAlreadyEditing();
463  void HandleOSDAlreadyEditing(const QString& Action, bool WasPaused);
464 
465  // Sleep dialog handling
466  void ShowOSDSleep();
467  void HandleOSDSleep(const QString& Action);
468  void SleepDialogTimeout();
469 
470  // Idle dialog handling
471  void ShowOSDIdle();
472  void HandleOSDIdle(const QString& Action);
473  void IdleDialogTimeout();
474 
475  // Exit/delete dialog handling
476  void ShowOSDStopWatchingRecording();
477  void ShowOSDPromptDeleteRecording(const QString& Title, bool Force = false);
478  bool HandleOSDVideoExit(const QString& Action);
479 
480  // Navigation Dialog
481  void StartOsdNavigation();
482 
483  // Menu dialog
484  void ShowOSDMenu(bool isCompact = false);
485  void FillOSDMenuJumpRec(const QString &Category = "", int Level = 0, const QString &Selected = "");
486  void PlaybackMenuShow(const MythTVMenu &Menu, const QDomNode &Node, const QDomNode &Selected);
487  bool MenuItemDisplay(const MythTVMenuItemContext& Context, MythOSDDialogData* Menu) override;
488  bool MenuItemDisplayPlayback(const MythTVMenuItemContext& Context, MythOSDDialogData* Menu);
489  bool MenuItemDisplayCutlist(const MythTVMenuItemContext& Context, MythOSDDialogData* Menu);
490  void PlaybackMenuInit(const MythTVMenu& Menu);
491  void PlaybackMenuDeinit(const MythTVMenu& Menu);
492  static void MenuStrings();
493  void MenuLazyInit(void* Field);
494 
495  // LCD
496  void UpdateLCD();
497  void ShowLCDChannelInfo();
498  void ShowLCDDVDInfo();
499 
500  private:
501  MythMainWindow* m_mainWindow { nullptr };
502 
503  // Configuration variables from database
504  QString m_baseFilters;
505  QString m_dbChannelFormat {"<num> <sign>"};
506  uint m_dbIdleTimeout {0};
507  int m_dbPlaybackExitPrompt {0};
508  uint m_dbAutoexpireDefault {0};
509  bool m_dbAutoSetWatched {false};
510  bool m_dbEndOfRecExitPrompt {false};
511  bool m_dbJumpPreferOsd {true};
512  bool m_dbUseGuiSizeForTv {false};
513  bool m_dbUseVideoModes {false};
514  bool m_dbClearSavedPosition {false};
515  bool m_dbRunJobsOnRemote {false};
516  bool m_dbContinueEmbedded {false};
517  bool m_dbRunFrontendInWindow {false};
518  bool m_dbBrowseAlways {false};
519  bool m_dbBrowseAllTuners {false};
520  bool m_dbUseChannelGroups {false};
521  bool m_dbRememberLastChannelGroup {false};
523 
524  bool m_tryUnflaggedSkip {false};
525 
526  bool m_smartForward {false};
527  float m_ffRewRepos {1.0F};
528  bool m_ffRewReverse {false};
529  std::vector<int> m_ffRewSpeeds;
530 
531  uint m_vbimode {VBIMode::None};
532 
533  QElapsedTimer m_ctorTime;
534  uint m_switchToInputId {0};
535 
538  mutable bool m_wantsToQuit {true};
539  bool m_stretchAdjustment {false};
540  bool m_audiosyncAdjustment {false};
541  bool m_subtitleZoomAdjustment {false};
542  bool m_subtitleDelayAdjustment {false};
543  bool m_zoomMode {false};
544  bool m_sigMonMode {false};
545  bool m_endOfRecording {false};
546  bool m_requestDelete {false};
547  bool m_allowRerecord {false};
548  bool m_doSmartForward {false};
549  bool m_queuedTranscode {false};
553  PictureAttribute m_adjustingPictureAttribute {kPictureAttribute_None};
554 
555  // Ask Allow state
556  QMap<QString,AskProgramInfo> m_askAllowPrograms;
557  QMutex m_askAllowLock {QMutex::Recursive};
558 
560  QMap<QString,ProgramList> m_progLists;
561 
562  mutable QMutex m_chanEditMapLock {QMutex::Recursive};
564 
566  static const std::vector<SleepTimerInfo> s_sleepTimes;
567  uint m_sleepIndex {0};
568  uint m_sleepTimerTimeout {0};
569  int m_sleepTimerId {0};
570  int m_sleepDialogTimerId {0};
571  int m_idleTimerId {0};
573  int m_idleDialogTimerId {0};
574 
577 
578  // CC/Teletex input state variables
580  bool m_ccInputMode {false};
581 
582  // Arbitrary Seek input state variables
584  bool m_asInputMode {false};
585 
586  // Channel changing state variables
588  QString m_queuedInput;
590  mutable QString m_queuedChanNum;
592  uint m_queuedChanID {0};
594  uint m_initialChanID {0};
595 
601  static const int kScreenPressRegionCount = 12;
602  QList<QKeyEvent> m_screenPressKeyMapPlayback;
603  QList<QKeyEvent> m_screenPressKeyMapLiveTV;
604 
605  // Channel changing timeout notification variables
606  QElapsedTimer m_lockTimer;
607  bool m_lockTimerOn {false};
609 
610  // Program Info for currently playing video
611  // (or next video if InChangeState() is true)
612  mutable QMutex m_lastProgramLock;
613  ProgramInfo *m_lastProgram {nullptr};
614  bool m_inPlaylist {false};
615  bool m_underNetworkControl {false};
616 
617  // Program Jumping
618  bool m_jumpToProgram {false};
619 
620  // Video Player
621  PlayerContext m_playerContext { kPlayerInUseID };
622  // Ugly temporary workaround. We need a full MythPlayerInterface object but
623  // avoid endless casts
624  MythPlayerUI* m_player { nullptr };
626  mutable QReadWriteLock m_playerLock;
627 
628  bool m_noHardwareDecoders {false};
629 
630  // Remote Encoders
632  RemoteEncoder *m_switchToRec {nullptr};
633 
634  // LCD Info
635  QString m_lcdTitle;
636  QString m_lcdSubtitle;
637  QString m_lcdCallsign;
638 
639  // Window info (GUI is optional, transcoding, preview img, etc)
640  TvPlayWindow *m_myWindow {nullptr};
641  QRect m_playerBounds;
646  bool m_weDisabledGUI {false};
647 
648  // embedded and suspended status
649  bool m_ignoreKeyPresses {false};
650  bool m_savedPause {false};
651 
652  // Channel group stuff
656  mutable QMutex m_channelGroupLock;
657  volatile int m_channelGroupId {-1};
659 
660  // Network Control stuff
662 
663  // Timers
664  volatile int m_lcdTimerId {0};
665  volatile int m_lcdVolumeTimerId {0};
666  volatile int m_networkControlTimerId {0};
667  volatile int m_ccInputTimerId {0};
668  volatile int m_asInputTimerId {0};
669  volatile int m_queueInputTimerId {0};
670  volatile int m_endOfPlaybackTimerId {0};
671  volatile int m_endOfRecPromptTimerId {0};
672  volatile int m_videoExitDialogTimerId {0};
673  volatile int m_pseudoChangeChanTimerId {0};
674  volatile int m_speedChangeTimerId {0};
675  volatile int m_errorRecoveryTimerId {0};
676  mutable volatile int m_exitPlayerTimerId {0};
677  volatile int m_saveLastPlayPosTimerId {0};
678  volatile int m_signalMonitorTimerId {0};
679 
680  // Various tracks
681  // XXX This ignores kTrackTypeTextSubtitle which is greater than
682  // kTrackTypeCount, and it unnecessarily includes
683  // kTrackTypeUnknown.
684  QStringList m_tvmTracks[kTrackTypeCount];
685  int m_tvmCurtrack[kTrackTypeCount] {};
686 
687  // Audio
688  bool m_tvmAvsync {true};
689  bool m_tvmUpmixing {false};
690  bool m_tvmCanUpmix {false};
691 
692  // Video
693  bool m_tvmFillAutoDetect {false};
696 
697  // Playback
698  int m_tvmSpeedX100 {100};
699  TVState m_tvmState {kState_None};
700  bool m_tvmIsRecording {false};
701  bool m_tvmIsRecorded {false};
702  bool m_tvmIsVideo {false};
703  CommSkipMode m_tvmCurSkip {kCommSkipOff};
704  bool m_tvmIsPaused {false};
705  int m_tvmFreeRecorderCount {-1};
706  bool m_tvmIsDvd {false};
707  bool m_tvmIsBd {false};
708  bool m_tvmJump {false};
709  bool m_tvmIsLiveTv {false};
710  bool m_tvmPreviousChan {false};
711 
712  // Navigate
713  int m_tvmNumChapters {0};
714  int m_tvmCurrentChapter {0};
715  QList<long long> m_tvmChapterTimes;
716  int m_tvmNumAngles {0};
717  int m_tvmCurrentAngle {0};
718  int m_tvmNumTitles {0};
719  int m_tvmCurrentTitle {0};
720  // Subtitles
721  uint m_tvmSubsCapMode {0};
722  bool m_tvmSubsHaveText {false};
723  bool m_tvmSubsForcedOn {true};
724  bool m_tvmSubsEnabled {false};
725  bool m_tvmSubsHaveSubs {false};
726 
727  bool m_tvmIsOn {false};
728  bool m_tvmTranscoding {false};
729 
731  // End of playback menu state caching
732 
737 
738  public:
739  // Constants
740  static const int kInitFFRWSpeed;
741  static const uint kInputKeysMax;
742  static const uint kNextSource;
743  static const uint kPreviousSource;
744 
746  static const uint kInputModeTimeout;
748  static const uint kLCDTimeout;
750  static const uint kBrowseTimeout;
752  static const uint kKeyRepeatTimeout;
754  static const uint kPrevChanTimeout;
761 
769 };
770 
771 #endif
TV::kPrevChanTimeout
static const uint kPrevChanTimeout
How long to wait before applying all previous channel keypresses in msec.
Definition: tv_play.h:754
kPictureAttribute_None
@ kPictureAttribute_None
Definition: videoouttypes.h:105
TV::IsSwitchingCards
bool IsSwitchingCards() const
Returns true if we are currently in the process of switching recorders.
Definition: tv_play.h:305
MythTVMenuItemDisplayer
Definition: mythtvmenu.h:63
CommSkipMode
CommSkipMode
Definition: tv.h:130
kViewSchedule
@ kViewSchedule
Definition: tv_play.h:96
TVPlaybackState
Tracks current playback state, as signalled by the player, and requests changes to the current state.
Definition: tvplaybackstate.h:12
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1420
bool
bool
Definition: pxsup2dast.c:30
TV::m_lastProgramLock
QMutex m_lastProgramLock
Definition: tv_play.h:612
tv.h
kStartTVIgnoreProgStart
@ kStartTVIgnoreProgStart
Definition: tv_play.h:115
osdInfo
Definition: playercontext.h:33
TV::m_playerLock
QReadWriteLock m_playerLock
lock on player and playerActive changes
Definition: tv_play.h:626
ChannelChangeDirection
ChannelChangeDirection
ChannelChangeDirection is an enumeration of possible channel changing directions.
Definition: tv.h:28
TV::m_ffRewSpeeds
std::vector< int > m_ffRewSpeeds
Definition: tv_play.h:529
kScheduleProgramFinder
@ kScheduleProgramFinder
Definition: tv_play.h:94
kTrackTypeCount
@ kTrackTypeCount
Definition: decoderbase.h:38
MythTimer
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:13
PictureAdjustType
PictureAdjustType
Definition: tv.h:120
TV::m_cutlistMenu
MythTVMenu m_cutlistMenu
Definition: tv_play.h:735
TV::m_keyRepeatTimer
MythTimer m_keyRepeatTimer
Queue of unprocessed key presses.
Definition: tv_play.h:576
ReloadKeys
static void ReloadKeys(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1629
TV::kBookmarkAlways
@ kBookmarkAlways
Definition: tv_play.h:290
TV::kVideoExitDialogTimeout
static const uint kVideoExitDialogTimeout
How long to display idle timer dialog in msec.
Definition: tv_play.h:760
MythTVMenuItemContext
Definition: mythtvmenu.h:36
TV::ArbSeekWhence
ArbSeekWhence
Definition: tv_play.h:363
TV::GetEndOfRecording
bool GetEndOfRecording() const
This is set to true if the player reaches the end of the recording without the user explicitly exitin...
Definition: tv_play.h:310
TV::kBrowseTimeout
static const uint kBrowseTimeout
Timeout for browse mode exit in msec.
Definition: tv_play.h:750
kStartTVInPlayList
@ kStartTVInPlayList
Definition: tv_play.h:112
TV::kSleepTimerDialogTimeout
static const uint kSleepTimerDialogTimeout
How long to display sleep timer dialog in msec.
Definition: tv_play.h:756
kStartTVNoFlags
@ kStartTVNoFlags
Definition: tv_play.h:111
TV::HasQueuedChannel
bool HasQueuedChannel() const
Definition: tv_play.h:333
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
EMBEDRETURNVOID
void(*)(void *, bool) EMBEDRETURNVOID
Definition: tv_play.h:58
TV::kEmbedCheckFrequency
static const uint kEmbedCheckFrequency
Definition: tv_play.h:763
osd.h
MythMediaBuffer
Definition: mythmediabuffer.h:49
TV::RunProgramGuidePtr
static EMBEDRETURNVOIDEPG RunProgramGuidePtr
function pointer for RunProgramGuide in guidegrid.cpp
Definition: tv_play.h:194
TV::s_sleepTimes
static const std::vector< SleepTimerInfo > s_sleepTimes
Definition: tv_play.h:565
TV::RunScheduleEditorPtr
static EMBEDRETURNVOIDSCHEDIT RunScheduleEditorPtr
function pointer for RunScheduleEditor in scheduleeditor.cpp
Definition: tv_play.h:196
VBIMode::None
@ None
Definition: tv.h:11
MythPlayer
Definition: mythplayer.h:83
TV::m_queuedInput
QString m_queuedInput
Input key presses queued up so far...
Definition: tv_play.h:588
AskProgramInfo::m_info
ProgramInfo * m_info
Definition: tv_play.h:131
TV::m_tvmChapterTimes
QList< long long > m_tvmChapterTimes
Definition: tv_play.h:715
mythdeque.h
TV::m_progLists
QMap< QString, ProgramList > m_progLists
Definition: tv_play.h:560
TV::kInputModeTimeout
static const uint kInputModeTimeout
Definition: tv_play.h:746
TV::kBookmarkNever
@ kBookmarkNever
Definition: tv_play.h:291
TV::kErrorRecoveryCheckFrequency
static const uint kErrorRecoveryCheckFrequency
Definition: tv_play.h:765
kPictureAttributeSupported_None
@ kPictureAttributeSupported_None
Definition: videoouttypes.h:118
RemoteEncoder
Definition: remoteencoder.h:25
Action
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:40
TV::m_ctorTime
QElapsedTimer m_ctorTime
Definition: tv_play.h:533
NoRecorderMsg
NoRecorderMsg
Type of message displayed in ShowNoRecorderDialog()
Definition: tv_play.h:103
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
TV::m_lockTimer
QElapsedTimer m_lockTimer
Definition: tv_play.h:606
kState_None
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
Definition: tv.h:58
tvbrowsehelper.h
TV::kKeyRepeatTimeout
static const uint kKeyRepeatTimeout
Seek key repeat timeout in msec.
Definition: tv_play.h:752
EMBEDRETURNVOIDFINDER
void(*)(TV *, bool, bool) EMBEDRETURNVOIDFINDER
Definition: tv_play.h:60
MythPlayerUI
Definition: mythplayerui.h:10
TV::m_dbChannelGroups
ChannelGroupList m_dbChannelGroups
Definition: tv_play.h:522
TV::m_channelGroupChannelList
ChannelInfoList m_channelGroupChannelList
Definition: tv_play.h:658
AskProgramInfo::AskProgramInfo
AskProgramInfo(QDateTime e, bool r, bool l, ProgramInfo *i)
Definition: tv_play.h:123
Command
Definition: gamesettings.cpp:227
TV::BookmarkAction
BookmarkAction
Definition: tv_play.h:289
TV::m_cutlistCompactMenu
MythTVMenu m_cutlistCompactMenu
Definition: tv_play.h:736
OSDTimeout
OSDTimeout
Definition: osd.h:56
kScheduleProgramGuide
@ kScheduleProgramGuide
Definition: tv_play.h:93
MythOSDDialogData
Definition: osd.h:65
TV::m_chanEditMap
InfoMap m_chanEditMap
Channel Editing initial map.
Definition: tv_play.h:563
TV::kSpeedChangeCheckFrequency
static const uint kSpeedChangeCheckFrequency
Definition: tv_play.h:764
TV::kPreviousSource
static const uint kPreviousSource
Timeout for entry modes in msec.
Definition: tv_play.h:743
AskProgramInfo::m_isConflicting
bool m_isConflicting
Definition: tv_play.h:130
TV::lastProgramStringList
static QStringList lastProgramStringList
stores last program info.
Definition: tv_play.h:191
videoouttypes.h
tvplaybackstate.h
EMBEDRETURNVOIDSCHEDIT
void(*)(const ProgramInfo *, void *) EMBEDRETURNVOIDSCHEDIT
Definition: tv_play.h:61
Event
Event details.
Definition: zmdefines.h:26
kPlaybackBox
@ kPlaybackBox
Definition: tv_play.h:97
kStartTVIgnoreBookmark
@ kStartTVIgnoreBookmark
Definition: tv_play.h:114
TV::setUnderNetworkControl
void setUnderNetworkControl(bool setting)
Definition: tv_play.h:287
TV::SleepTimerInfo
Definition: tv_play.cpp:1007
AskProgramInfo::m_expiry
QDateTime m_expiry
Definition: tv_play.h:126
TV::RunPlaybackBoxPtr
static EMBEDRETURNVOID RunPlaybackBoxPtr
function pointer for RunPlaybackBox in playbackbox.cpp
Definition: tv_play.h:192
TVBrowseHelper::m_dbUseChannelGroups
bool m_dbUseChannelGroups
Definition: tvbrowsehelper.h:78
kScheduledRecording
@ kScheduledRecording
Definition: tv_play.h:95
State
State
Definition: zmserver.h:64
TV::kIdleTimerDialogTimeout
static const uint kIdleTimerDialogTimeout
How long to display idle timer dialog in seconds.
Definition: tv_play.h:758
TVBrowseHelper::m_dbBrowseAllTuners
bool m_dbBrowseAllTuners
Definition: tvbrowsehelper.h:77
kNoRecorders
@ kNoRecorders
No free recorders.
Definition: tv_play.h:105
TV::m_playbackCompactMenu
MythTVMenu m_playbackCompactMenu
Definition: tv_play.h:734
GuideGrid
Definition: guidegrid.h:102
kStartTVAllowLastPlayPos
@ kStartTVAllowLastPlayPos
Definition: tv_play.h:116
TV::m_queuedChanNum
QString m_queuedChanNum
Input key presses queued up so far to form a valid ChanNum.
Definition: tv_play.h:590
TV::m_savedGuiBounds
QRect m_savedGuiBounds
Definition: tv_play.h:644
TV::kInputKeysMax
static const uint kInputKeysMax
When to start discarding early keys.
Definition: tv_play.h:741
GetState
#define GetState(a, b)
Definition: audiooutputopensles.cpp:48
TV::kSaveLastPlayPosTimeout
static const uint kSaveLastPlayPosTimeout
Definition: tv_play.h:768
Bookmark
Definition: bookmarkmanager.h:13
ChannelGroupList
std::vector< ChannelGroupItem > ChannelGroupList
Definition: channelgroup.h:31
scheduleEditTypes
scheduleEditTypes
Definition: tv_play.h:92
uint
unsigned int uint
Definition: compat.h:141
EMBEDRETURNVOIDEPG
void(*)(uint, const QString &, const QDateTime, TV *, bool, bool, int) EMBEDRETURNVOIDEPG
Definition: tv_play.h:59
TVBrowseHelper
Definition: tvbrowsehelper.h:45
kStereoscopicModeAuto
@ kStereoscopicModeAuto
Definition: videoouttypes.h:136
referencecounter.h
PictureAttribute
PictureAttribute
Definition: videoouttypes.h:103
volumebase.h
StereoscopicMode
StereoscopicMode
Definition: videoouttypes.h:134
InitKeys
static void InitKeys(void)
Definition: mythtv/programs/mythfrontend/main.cpp:1577
TV::HasQueuedInput
bool HasQueuedInput() const
Definition: tv_play.h:332
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
AskProgramInfo::m_hasLater
bool m_hasLater
Definition: tv_play.h:128
channelinfo.h
TV::kEndOfPlaybackCheckFrequency
static const uint kEndOfPlaybackCheckFrequency
Definition: tv_play.h:762
PlaybackBox
Definition: playbackbox.h:62
Channum
Definition: channelsettings.cpp:56
TV::kNextSource
static const uint kNextSource
Definition: tv_play.h:742
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
channelgroup.h
AskProgramInfo::AskProgramInfo
AskProgramInfo()=default
TV::m_lastLockSeenTime
QDateTime m_lastLockSeenTime
Definition: tv_play.h:608
mythmiscutil.h
TV::m_progListsLock
QMutex m_progListsLock
Definition: tv_play.h:559
TVState
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:50
MythTVMenuItemDisplayer::MenuItemDisplay
virtual bool MenuItemDisplay(const MythTVMenuItemContext &Context, MythOSDDialogData *Menu)=0
Clear
#define Clear(a)
Definition: audiooutputopensles.cpp:47
playercontext.h
kPlayerInUseID
const QString kPlayerInUseID
Definition: programtypes.cpp:13
AskProgramInfo::m_hasRec
bool m_hasRec
Definition: tv_play.h:127
mythtvmenu.h
Name
Definition: channelsettings.cpp:46
TV::m_tvmJumprecBackHack
QVariant m_tvmJumprecBackHack
Definition: tv_play.h:730
MythDeque< QString >
ProgInfo
Definition: programdata.h:212
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:142
AskProgramInfo::m_isInSameInputGroup
bool m_isInSameInputGroup
Definition: tv_play.h:129
TV::m_lcdCallsign
QString m_lcdCallsign
Definition: tv_play.h:637
TV::RunViewScheduledPtr
static EMBEDRETURNVOID RunViewScheduledPtr
function pointer for RunViewScheduled in viewscheduled.cpp
Definition: tv_play.h:193
MythTVMenu
Definition: mythtvmenu.h:70
decoderbase.h
TV::m_baseFilters
QString m_baseFilters
Definition: tv_play.h:504
TVBrowseHelper::TV
friend class TV
Definition: tvbrowsehelper.h:47
TV::m_lcdTitle
QString m_lcdTitle
Definition: tv_play.h:635
TV::kEndOfPlaybackFirstCheckTimer
static const uint kEndOfPlaybackFirstCheckTimer
Definition: tv_play.h:767
TV::m_channelGroupLock
QMutex m_channelGroupLock
Lock necessary when modifying channel group variables.
Definition: tv_play.h:656
PlayerContext
Definition: playercontext.h:48
TV::kInitFFRWSpeed
static const int kInitFFRWSpeed
1x, default to normal speed
Definition: tv_play.h:740
inputinfo.h
TV::m_playbackMenu
MythTVMenu m_playbackMenu
Definition: tv_play.h:733
mythtimer.h
TV::kEndOfRecPromptCheckFrequency
static const uint kEndOfRecPromptCheckFrequency
Definition: tv_play.h:766
TV::m_screenPressKeyMapLiveTV
QList< QKeyEvent > m_screenPressKeyMapLiveTV
Definition: tv_play.h:603
TV::SetInPlayList
void SetInPlayList(bool InPlayList)
Definition: tv_play.h:286
TV::m_screenPressKeyMapPlayback
QList< QKeyEvent > m_screenPressKeyMapPlayback
Definition: tv_play.h:602
MythGestureEvent
A custom event that represents a mouse gesture.
Definition: mythgesture.h:39
kCommSkipOff
@ kCommSkipOff
Definition: tv.h:132
Player
Definition: zmliveplayer.h:34
TV::kLCDTimeout
static const uint kLCDTimeout
Timeout for updating LCD info in msec.
Definition: tv_play.h:748
TV::GetAllowRerecord
bool GetAllowRerecord() const
Returns true if the user told Mythtv to allow re-recording of the show.
Definition: tv_play.h:307
TvPlayWindow
Simple screen shown while the video player is starting up.
Definition: tv_play_win.h:12
kStartTVByNetworkCommand
@ kStartTVByNetworkCommand
Definition: tv_play.h:113
kAdjustingPicture_None
@ kAdjustingPicture_None
Definition: tv.h:122
TV::m_networkControlCommands
MythDeque< QString > m_networkControlCommands
Definition: tv_play.h:661
TV::m_lcdSubtitle
QString m_lcdSubtitle
Definition: tv_play.h:636
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:61
TV::GetQueuedChanID
uint GetQueuedChanID() const
Definition: tv_play.h:339
OK
#define OK
Definition: dvbci.cpp:69
OSD
Definition: osd.h:94
MythMainWindow
Definition: mythmainwindow.h:34
ReferenceCounter
General purpose reference counter.
Definition: referencecounter.h:26
TV::RunProgramFinderPtr
static EMBEDRETURNVOIDFINDER RunProgramFinderPtr
function pointer for RunProgramFinder in progfind.cpp
Definition: tv_play.h:195
kNoCurrRec
@ kNoCurrRec
No current recordings.
Definition: tv_play.h:106
TV::GetJumpToProgram
bool GetJumpToProgram() const
This is set if the user asked MythTV to jump to the previous recording in the playlist.
Definition: tv_play.h:313
TV::m_askAllowPrograms
QMap< QString, AskProgramInfo > m_askAllowPrograms
Definition: tv_play.h:556
TV
Control TV playback.
Definition: tv_play.h:152
ChannelInfoList
std::vector< ChannelInfo > ChannelInfoList
Definition: channelinfo.h:131
AskProgramInfo
Definition: tv_play.h:119
kNoTuners
@ kNoTuners
No capture cards configured.
Definition: tv_play.h:107