MythTV  master
tvplaybackstate.h
Go to the documentation of this file.
1 #ifndef TVPLAYBACKSTATE_H
2 #define TVPLAYBACKSTATE_H
3 
4 // Qt
5 #include <QRect>
6 #include <QObject>
7 
8 // MythTV
9 #include "osd.h"
10 #include "mythplayerstate.h"
11 
12 class MTV_PUBLIC TVPlaybackState : public QObject
13 {
14  Q_OBJECT
15 
16  public:
17  TVPlaybackState() = default;
18 
19  signals:
20  // General
21  void InitialisePlayerState();
22  void UpdateBookmark(bool Clear = false);
23  void UpdateLastPlayPosition(uint64_t frame);
24 
25  // Overlays
26  void IsOSDVisible(bool& Visible);
27  void ChangeOSDPositionUpdates(bool Enable);
28  void ChangeOSDDebug();
29  void ChangeOSDText(const QString &Window, const InfoMap &Map, OSDTimeout Timeout);
30  void ChangeOSDDialog(const MythOSDDialogData& Data);
31  void ChangeOSDMessage(const QString& Message);
32  void DialogQuit();
33  void HideAll(bool KeepSubs = true, MythScreenType* Except = nullptr, bool DropNotification = false);
34 
35  // Audio
36  void ReinitAudio();
37  void ResetAudio();
38  void PauseAudioUntilReady();
39  void ChangeMuteState(bool CycleChannels = false);
40  void ChangeVolume(bool Direction, int Volume);
41  void ChangeUpmix(bool Enable, bool Toggle = false);
42  void ChangeAudioOffset(std::chrono::milliseconds Delta, std::chrono::milliseconds Value = -9999ms);
43 
44  // Audio and captions
45  void SetTrack(uint Type, uint TrackNo);
46  void ChangeTrack(uint Type, int Direction);
47 
48  // Captions/Interactive
49  void ChangeAllowForcedSubtitles(bool Allow);
50  void ToggleCaptions();
51  void ToggleCaptionsByType(uint Type);
52  void SetCaptionsEnabled(bool Enable, bool UpdateOSD = true);
53  void DisableCaptions(uint Mode, bool UpdateOSD = true);
54  void EnableCaptions(uint Mode, bool UpdateOSD = true);
55  void ChangeCaptionTrack(int Direction);
56 
57  void ResetCaptions();
58  void EnableTeletext(int Page = 0x100);
59  void ResetTeletext();
60  void SetTeletextPage(uint Page);
61  void HandleTeletextAction(const QString &Action, bool& Handled);
62  void RestartITV(uint Chanid, uint Cardid, bool IsLiveTV);
63  void HandleITVAction(const QString& Action, bool& Handled);
64  void AdjustSubtitleZoom(int Delta);
65  void AdjustSubtitleDelay(std::chrono::milliseconds Delta);
66 
67  // Video
68  void RequestEmbedding(bool Embed, const QRect& Rect = {}, const QStringList& Data = {});
69  void EmbedPlayback(bool Embed, const QRect& Rect = {});
70  void ResizeScreenForVideo(QSize Size = {});
71  void WindowResized(const QSize& Size);
72  void ChangeStereoOverride(StereoscopicMode Mode);
73  void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value);
74  void ToggleDetectLetterBox();
75  void ChangeAdjustFill(AdjustFillMode FillMode = kAdjustFill_Toggle);
76  void ChangeAspectOverride(AspectOverrideMode AspectMode = kAspect_Toggle);
77  void ChangeZoom(ZoomDirection Zoom);
78  void ToggleMoveBottomLine();
79  void SaveBottomLine();
80 
81  // Visualiser
82  void EnableVisualiser(bool Enable, bool Toggle = false, const QString& Name = QString());
83 
84  // Discs
85  void GoToMenu(const QString& Menu);
86  void GoToDVDProgram(bool Direction);
87 
88  // Editor
89  void EnableEdit();
90  void DisableEdit(int HowToSave);
91  void RefreshEditorState(bool CheckSaved = false);
92 
93  public slots:
94  void OverlayStateChanged(MythOverlayState OverlayState);
95  void AudioPlayerStateChanged(const MythAudioPlayerState& AudioPlayerState);
96  void AudioStateChanged(const MythAudioState& AudioState);
97  void CaptionsStateChanged(MythCaptionsState CaptionsState);
98  void VideoBoundsStateChanged(const MythVideoBoundsState& VideoBoundsState);
99  void VideoColourStateChanged(const MythVideoColourState& ColourState);
100  void VisualiserStateChanged(const MythVisualiserState& VisualiserState);
101  void EditorStateChanged(const MythEditorState& EditorState);
102 
103  protected:
104  MythOverlayState m_overlayState { };
105  MythAudioPlayerState m_audioPlayerState { };
106  MythAudioState m_audioState { };
107  MythCaptionsState m_captionsState { };
108  MythVideoBoundsState m_videoBoundsState { };
109  MythVideoColourState m_videoColourState { };
110  MythVisualiserState m_visualiserState { };
111  MythEditorState m_editorState { };
112 };
113 
114 #endif
kAspect_Toggle
@ kAspect_Toggle
Definition: videoouttypes.h:62
TVPlaybackState
Tracks current playback state, as signalled by the player, and requests changes to the current state.
Definition: tvplaybackstate.h:12
kAdjustFill_Toggle
@ kAdjustFill_Toggle
Definition: videoouttypes.h:73
mythplayerstate.h
MythEditorState
Definition: mythplayerstate.h:144
osd.h
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
Visible
Definition: channelsettings.cpp:391
Action
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:40
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MythVideoColourState
Definition: mythplayerstate.h:114
OSDTimeout
OSDTimeout
Definition: osd.h:56
MythOSDDialogData
Definition: osd.h:65
AspectOverrideMode
AspectOverrideMode
Definition: videoouttypes.h:60
uint
unsigned int uint
Definition: compat.h:144
PictureAttribute
PictureAttribute
Definition: videoouttypes.h:103
StereoscopicMode
StereoscopicMode
Definition: videoouttypes.h:134
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
Clear
#define Clear(a)
Definition: audiooutputopensles.cpp:46
Name
Definition: channelsettings.cpp:46
AdjustFillMode
AdjustFillMode
Definition: videoouttypes.h:71
MythAudioState
A simple wrapper around audio state used to signal changes in the current state.
Definition: mythplayerstate.h:47
MythOverlayState
A simpler than simple wrapper around OSD state.
Definition: mythplayerstate.h:19
MythVisualiserState
Definition: mythplayerstate.h:128
MythCaptionsState
Definition: mythplayerstate.h:65
ZoomDirection
ZoomDirection
Definition: videoouttypes.h:42
MythVideoBoundsState
Definition: mythplayerstate.h:96
MythAudioPlayerState
Definition: mythplayerstate.h:31