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 
24  // Overlays
25  void IsOSDVisible(bool& Visible);
26  void ChangeOSDPositionUpdates(bool Enable);
27  void ChangeOSDDebug();
28  void ChangeOSDText(const QString &Window, const InfoMap &Map, OSDTimeout Timeout);
29  void ChangeOSDDialog(const MythOSDDialogData& Data);
30  void ChangeOSDMessage(const QString& Message);
31  void DialogQuit();
32  void HideAll(bool KeepSubs = true, MythScreenType* Except = nullptr, bool DropNotification = false);
33 
34  // Audio
35  void ReinitAudio();
36  void ResetAudio();
37  void PauseAudioUntilReady();
38  void ChangeMuteState(bool CycleChannels = false);
39  void ChangeVolume(bool Direction, int Volume);
40  void ChangeUpmix(bool Enable, bool Toggle = false);
41  void ChangeAudioOffset(std::chrono::milliseconds Delta, std::chrono::milliseconds Value = -9999ms);
42 
43  // Audio and captions
44  void SetTrack(uint Type, uint TrackNo);
45  void ChangeTrack(uint Type, int Direction);
46 
47  // Captions/Interactive
48  void ChangeAllowForcedSubtitles(bool Allow);
49  void ToggleCaptions();
50  void ToggleCaptionsByType(uint Type);
51  void SetCaptionsEnabled(bool Enable, bool UpdateOSD = true);
52  void DisableCaptions(uint Mode, bool UpdateOSD = true);
53  void EnableCaptions(uint Mode, bool UpdateOSD = true);
54  void ChangeCaptionTrack(int Direction);
55 
56  void ResetCaptions();
57  void EnableTeletext(int Page = 0x100);
58  void ResetTeletext();
59  void SetTeletextPage(uint Page);
60  void HandleTeletextAction(const QString &Action, bool& Handled);
61  void RestartITV(uint Chanid, uint Cardid, bool IsLiveTV);
62  void HandleITVAction(const QString& Action, bool& Handled);
63  void AdjustSubtitleZoom(int Delta);
64  void AdjustSubtitleDelay(std::chrono::milliseconds Delta);
65 
66  // Video
67  void RequestEmbedding(bool Embed, const QRect& Rect = {}, const QStringList& Data = {});
68  void EmbedPlayback(bool Embed, const QRect& Rect = {});
69  void ResizeScreenForVideo(QSize Size = {});
70  void WindowResized(const QSize& Size);
71  void ChangeStereoOverride(StereoscopicMode Mode);
72  void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value);
73  void ToggleDetectLetterBox();
74  void ChangeAdjustFill(AdjustFillMode FillMode = kAdjustFill_Toggle);
75  void ChangeAspectOverride(AspectOverrideMode AspectMode = kAspect_Toggle);
76  void ChangeZoom(ZoomDirection Zoom);
77  void ToggleMoveBottomLine();
78  void SaveBottomLine();
79 
80  // Visualiser
81  void EnableVisualiser(bool Enable, bool Toggle = false, const QString& Name = QString());
82 
83  // Discs
84  void GoToMenu(const QString& Menu);
85  void GoToDVDProgram(bool Direction);
86 
87  // Editor
88  void EnableEdit();
89  void DisableEdit(int HowToSave);
90  void RefreshEditorState(bool CheckSaved = false);
91 
92  public slots:
93  void OverlayStateChanged(MythOverlayState OverlayState);
94  void AudioPlayerStateChanged(const MythAudioPlayerState& AudioPlayerState);
95  void AudioStateChanged(const MythAudioState& AudioState);
96  void CaptionsStateChanged(MythCaptionsState CaptionsState);
97  void VideoBoundsStateChanged(const MythVideoBoundsState& VideoBoundsState);
98  void VideoColourStateChanged(const MythVideoColourState& ColourState);
99  void VisualiserStateChanged(const MythVisualiserState& VisualiserState);
100  void EditorStateChanged(const MythEditorState& EditorState);
101 
102  protected:
103  MythOverlayState m_overlayState { };
104  MythAudioPlayerState m_audioPlayerState { };
105  MythAudioState m_audioState { };
106  MythCaptionsState m_captionsState { };
107  MythVideoBoundsState m_videoBoundsState { };
108  MythVideoColourState m_videoColourState { };
109  MythVisualiserState m_visualiserState { };
110  MythEditorState m_editorState { };
111 };
112 
113 #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:44
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:140
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:47
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