-
Notifications
You must be signed in to change notification settings - Fork 341
/
mythplayercaptionsui.h
86 lines (73 loc) · 2.77 KB
/
mythplayercaptionsui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef MYTHPLAYERCAPTIONSUI_H
#define MYTHPLAYERCAPTIONSUI_H
// MythTV
#include "mythcaptionsoverlay.h"
#include "mythplayeraudioui.h"
class MTV_PUBLIC MythPlayerCaptionsUI : public MythPlayerAudioUI
{
Q_OBJECT
signals:
void CaptionsStateChanged(MythCaptionsState& CaptionsState);
void ResizeForInteractiveTV(const QRect& Rect);
void SetInteractiveStream(const QString& Stream);
void SetInteractiveStreamPos(long Position);
void PlayInteractiveStream(bool Play);
public:
MythPlayerCaptionsUI(MythMainWindow* MainWindow, TV* Tv, PlayerContext* Context, PlayerFlags Flags);
~MythPlayerCaptionsUI() override;
uint GetCaptionMode() const override;
bool HasTextSubtitles();
bool GetCaptionsEnabled() const;
// N.B. These methods handle audio tracks as well. Fix.
QStringList GetTracks(uint Type);
uint GetTrackCount(uint Type);
int GetTrack(uint Type);
bool SetAudioByComponentTag(int Tag);
bool SetVideoByComponentTag(int Tag);
long GetStreamPos();
long GetStreamMaxPos();
InteractiveTV* GetInteractiveTV() override;
protected slots:
void TracksChanged(uint TrackType);
void SetAllowForcedSubtitles(bool Allow);
void ToggleCaptions();
void ToggleCaptionsByType(uint Type);
void SetCaptionsEnabled(bool Enable, bool UpdateOSD = true);
virtual void DisableCaptions(uint Mode, bool UpdateOSD = true);
virtual void EnableCaptions(uint Mode, bool UpdateOSD = true);
virtual void SetTrack(uint Type, uint TrackNo);
void ChangeCaptionTrack(int Direction);
void ChangeTrack(uint Type, int Direction);
void ResetCaptions();
void EnableTeletext(int Page = 0x100);
void ResetTeletext();
void SetTeletextPage(uint Page);
void HandleTeletextAction(const QString &Action, bool& Handled);
void ITVHandleAction(const QString& Action, bool& Handled);
void ITVRestart(uint Chanid, uint Cardid, bool IsLiveTV);
void AdjustSubtitleZoom(int Delta);
void AdjustSubtitleDelay(int Delta);
private slots:
void SetStream(const QString& Stream);
long SetStreamPos(long Position);
void StreamPlay(bool Playing = true);
protected:
double SafeFPS();
void DoDisableForcedSubtitles();
void DoEnableForcedSubtitles();
MythCaptionsOverlay m_captionsOverlay;
MythCaptionsState m_captionsState { };
bool m_textDesired { false };
uint m_lastTextDisplayMode { kDisplayNone };
uint m_lastValidTextDisplayMode { kDisplayNone };
InteractiveTV *m_interactiveTV { nullptr };
QMutex m_itvLock { };
bool m_itvEnabled { false };
bool m_itvVisible { false };
QString m_newStream { };
private:
void DisableTeletext();
bool HasCaptionTrack(uint Mode);
uint NextCaptionTrack(uint Mode);
};
#endif