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  void tracksChanged(uint TrackType) override;
36 
37  protected slots:
38  void InitialiseState() override;
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(std::chrono::milliseconds Delta);
57 
58  private slots:
59  void ExternalSubtitlesUpdated();
60  void SetStream(const QString& Stream);
61  void SetStreamPos(std::chrono::milliseconds 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
MythPlayerCaptionsUI::m_newStream
QString m_newStream
Definition: mythplayercaptionsui.h:79
MythPlayer::GetInteractiveTV
virtual InteractiveTV * GetInteractiveTV()
Definition: mythplayer.h:163
mythplayeraudioui.h
MythPlayerCaptionsUI
Definition: mythplayercaptionsui.h:8
MythPlayerCaptionsUI::m_itvLock
QMutex m_itvLock
Definition: mythplayercaptionsui.h:76
MythCaptionsOverlay
Definition: mythcaptionsoverlay.h:17
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:70
MythPlayer::tracksChanged
virtual void tracksChanged([[maybe_unused]] uint TrackType)
Definition: mythplayer.h:206
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
mythcaptionsoverlay.h
PlayerContext
Definition: playercontext.h:49
TrackType
TrackType
Track types.
Definition: decoderbase.h:27
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
Mode
Mode
Definition: synaesthesia.h:23
uint
unsigned int uint
Definition: freesurround.h:24
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
TV
Control TV playback.
Definition: tv_play.h:154