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:
105  MythAudioPlayerState m_audioPlayerState { };
107  MythCaptionsState m_captionsState { };
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
TVPlaybackState::m_overlayState
MythOverlayState m_overlayState
Definition: tvplaybackstate.h:104
Mode
Mode
Definition: synaesthesia.h:23
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:416
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:55
MythOSDDialogData
Definition: osd.h:64
AspectOverrideMode
AspectOverrideMode
Definition: videoouttypes.h:60
TVPlaybackState::m_visualiserState
MythVisualiserState m_visualiserState
Definition: tvplaybackstate.h:110
TVPlaybackState::m_videoBoundsState
MythVideoBoundsState m_videoBoundsState
Definition: tvplaybackstate.h:108
uint
unsigned int uint
Definition: compat.h:81
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:54
Name
Definition: channelsettings.cpp:71
AdjustFillMode
AdjustFillMode
Definition: videoouttypes.h:71
TVPlaybackState::m_editorState
MythEditorState m_editorState
Definition: tvplaybackstate.h:111
TVPlaybackState::m_audioState
MythAudioState m_audioState
Definition: tvplaybackstate.h:106
MythAudioState
A simple wrapper around audio state used to signal changes in the current state.
Definition: mythplayerstate.h:47
TVPlaybackState::m_videoColourState
MythVideoColourState m_videoColourState
Definition: tvplaybackstate.h:109
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