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(long Position);
17  void PlayInteractiveStream(bool Play);
18 
19  public:
20  MythPlayerCaptionsUI(MythMainWindow* MainWindow, TV* Tv, PlayerContext* Context, PlayerFlags Flags);
21  ~MythPlayerCaptionsUI() override;
22 
23  uint GetCaptionMode() const override;
24 
25  // N.B. These methods handle audio tracks as well. Fix.
26  QStringList GetTracks(uint Type);
27  uint GetTrackCount(uint Type);
28  int GetTrack(uint Type);
29 
30  bool SetAudioByComponentTag(int Tag);
31  bool SetVideoByComponentTag(int Tag);
32  long GetStreamPos();
33  long GetStreamMaxPos();
34  InteractiveTV* GetInteractiveTV() override;
35 
36  protected slots:
37  void InitialiseState() override;
38  void TracksChanged(uint TrackType);
39  void SetAllowForcedSubtitles(bool Allow);
40  void ToggleCaptions();
41  void ToggleCaptionsByType(uint Type);
42  void SetCaptionsEnabled(bool Enable, bool UpdateOSD = true);
43  virtual void DisableCaptions(uint Mode, bool UpdateOSD = true);
44  virtual void EnableCaptions(uint Mode, bool UpdateOSD = true);
45  virtual void SetTrack(uint Type, uint TrackNo);
46  void ChangeCaptionTrack(int Direction);
47  void ChangeTrack(uint Type, int Direction);
48  void ResetCaptions();
49  void EnableTeletext(int Page = 0x100);
50  void ResetTeletext();
51  void SetTeletextPage(uint Page);
52  void HandleTeletextAction(const QString &Action, bool& Handled);
53  void ITVHandleAction(const QString& Action, bool& Handled);
54  void ITVRestart(uint Chanid, uint Cardid, bool IsLiveTV);
55  void AdjustSubtitleZoom(int Delta);
56  void AdjustSubtitleDelay(int Delta);
57 
58  private slots:
59  void ExternalSubtitlesUpdated();
60  void SetStream(const QString& Stream);
61  long SetStreamPos(long Position);
62  void StreamPlay(bool Playing = true);
63 
64  protected:
65  double SafeFPS();
66  void DoDisableForcedSubtitles();
67  void DoEnableForcedSubtitles();
68  void LoadExternalSubtitles();
69 
71  MythCaptionsState m_captionsState { };
72  bool m_textDesired { false };
73  uint m_lastTextDisplayMode { kDisplayNone };
74  uint m_lastValidTextDisplayMode { kDisplayNone };
75  InteractiveTV *m_interactiveTV { nullptr };
76  QMutex m_itvLock { };
77  bool m_itvEnabled { false };
78  bool m_itvVisible { false };
79  QString m_newStream { };
80 
81  private:
82  void DisableTeletext();
83  bool HasCaptionTrack(uint Mode);
84  uint NextCaptionTrack(uint Mode);
85 };
86 
87 #endif
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
MythPlayer::GetInteractiveTV
virtual InteractiveTV * GetInteractiveTV()
Definition: mythplayer.h:163
mythplayeraudioui.h
MythPlayerCaptionsUI
Definition: mythplayercaptionsui.h:8
MythCaptionsOverlay
Definition: mythcaptionsoverlay.h:17
TrackType
TrackType
Track types.
Definition: decoderbase.h:26
PlayerFlags
PlayerFlags
Definition: mythplayer.h:62
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:60
MythPlayerCaptionsUI::m_captionsOverlay
MythCaptionsOverlay m_captionsOverlay
Definition: mythplayercaptionsui.h:70
uint
unsigned int uint
Definition: compat.h:141
MythPlayer::GetCaptionMode
virtual uint GetCaptionMode() const
Definition: mythplayer.h:193
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
mythcaptionsoverlay.h
PlayerContext
Definition: playercontext.h:48
InteractiveTV
This is the interface between an MHEG engine and a MythTV TV object.
Definition: interactivetv.h:15
MythCaptionsState
Definition: mythplayerstate.h:64
MythMainWindow
Definition: mythmainwindow.h:34
TV
Control TV playback.
Definition: tv_play.h:152