MythTV  master
mythplayercaptionsui.h
Go to the documentation of this file.
1 #ifndef MYTHPLAYERCAPTIONSUI_H
2 #define MYTHPLAYERCAPTIONSUI_H
3 
4 // MythTV
5 #include "mythcaptionsoverlay.h"
6 #include "mythplayeraudioui.h"
7 
9 {
10  Q_OBJECT
11 
12  signals:
13  void CaptionsStateChanged(MythCaptionsState& CaptionsState);
14  void ResizeForInteractiveTV(const QRect& Rect);
15  void SetInteractiveStream(const QString& Stream);
16  void SetInteractiveStreamPos(std::chrono::milliseconds Position);
17  void PlayInteractiveStream(bool Play);
18  void EnableSubtitles(bool Enable);
19 
20  public:
21  MythPlayerCaptionsUI(MythMainWindow* MainWindow, TV* Tv, PlayerContext* Context, PlayerFlags Flags);
22  ~MythPlayerCaptionsUI() override;
23 
24  // N.B. These methods handle audio tracks as well. Fix.
25  QStringList GetTracks(uint Type);
26  uint GetTrackCount(uint Type);
27  int GetTrack(uint Type);
28 
29  bool SetAudioByComponentTag(int Tag);
30  bool SetVideoByComponentTag(int Tag);
31  std::chrono::milliseconds GetStreamPos();
32  std::chrono::milliseconds GetStreamMaxPos();
33  InteractiveTV* GetInteractiveTV() override;
34 
35  protected slots:
36  void InitialiseState() override;
37  void TracksChanged(uint TrackType);
38  void SetAllowForcedSubtitles(bool Allow);
39  void ToggleCaptions();
40  void ToggleCaptionsByType(uint Type);
41  void SetCaptionsEnabled(bool Enable, bool UpdateOSD = true);
42  virtual void DisableCaptions(uint Mode, bool UpdateOSD = true);
43  virtual void EnableCaptions(uint Mode, bool UpdateOSD = true);
44  virtual void SetTrack(uint Type, uint TrackNo);
45  void ChangeCaptionTrack(int Direction);
46  void ChangeTrack(uint Type, int Direction);
47  void ResetCaptions();
48  void EnableTeletext(int Page = 0x100);
49  void ResetTeletext();
50  void SetTeletextPage(uint Page);
51  void HandleTeletextAction(const QString &Action, bool& Handled);
52  void ITVHandleAction(const QString& Action, bool& Handled);
53  void ITVRestart(uint Chanid, uint Cardid, bool IsLiveTV);
54  void AdjustSubtitleZoom(int Delta);
55  void AdjustSubtitleDelay(std::chrono::milliseconds Delta);
56 
57  private slots:
58  void ExternalSubtitlesUpdated();
59  void SetStream(const QString& Stream);
60  void SetStreamPos(std::chrono::milliseconds Position);
61  void StreamPlay(bool Playing = true);
62 
63  protected:
64  double SafeFPS();
65  void DoDisableForcedSubtitles();
66  void DoEnableForcedSubtitles();
67  void LoadExternalSubtitles();
68 
70  MythCaptionsState m_captionsState { };
71  bool m_textDesired { false };
72  uint m_lastTextDisplayMode { kDisplayNone };
73  uint m_lastValidTextDisplayMode { kDisplayNone };
74  InteractiveTV *m_interactiveTV { nullptr };
75  QMutex m_itvLock;
76  bool m_itvEnabled { false };
77  bool m_itvVisible { false };
78  QString m_newStream;
79 
80  private:
81  void DisableTeletext();
82  bool HasCaptionTrack(uint Mode);
83  uint NextCaptionTrack(uint Mode);
84 };
85 
86 #endif
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
MythPlayerCaptionsUI::m_newStream
QString m_newStream
Definition: mythplayercaptionsui.h:78
MythPlayer::GetInteractiveTV
virtual InteractiveTV * GetInteractiveTV()
Definition: mythplayer.h:165
Mode
Mode
Definition: synaesthesia.h:23
mythplayeraudioui.h
MythPlayerCaptionsUI
Definition: mythplayercaptionsui.h:8
MythPlayerCaptionsUI::m_itvLock
QMutex m_itvLock
Definition: mythplayercaptionsui.h:75
MythCaptionsOverlay
Definition: mythcaptionsoverlay.h:17
TrackType
TrackType
Track types.
Definition: decoderbase.h:26
PlayerFlags
PlayerFlags
Definition: mythplayer.h:64
MythPlayerAudioUI
Acts as the interface between the UI and the underlying AudioPlayer object.
Definition: mythplayeraudioui.h:9
Action
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:40
MythPlayerAudioUI::InitialiseState
void InitialiseState() override
Initialise audio and signal initial state.
Definition: mythplayeraudioui.cpp:62
MythPlayerCaptionsUI::m_captionsOverlay
MythCaptionsOverlay m_captionsOverlay
Definition: mythplayercaptionsui.h:69
uint
unsigned int uint
Definition: compat.h:81
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
mythcaptionsoverlay.h
PlayerContext
Definition: playercontext.h:49
InteractiveTV
This is the interface between an MHEG engine and a MythTV TV object.
Definition: interactivetv.h:15
MythCaptionsState
Definition: mythplayerstate.h:65
MythMainWindow
Definition: mythmainwindow.h:28
TV
Control TV playback.
Definition: tv_play.h:152