MythTV master
zmliveplayer.h
Go to the documentation of this file.
1/* ============================================================
2 * This program is free software; you can redistribute it
3 * and/or modify it under the terms of the GNU General
4 * Public License as published bythe Free Software Foundation;
5 * either version 2, or (at your option)
6 * any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * ============================================================ */
14
15#ifndef ZMLIVEPLAYER_H
16#define ZMLIVEPLAYER_H
17
18// c++
19#include <vector>
20
21// qt
22//#include <QKeyEvent>
23#include <QObject>
24
25// mythtv
30
31// mythzoneminder
32#include "zmdefines.h"
33
34class Player
35{
36 public:
37 Player(void) = default;
38 ~Player(void);
39
40 void updateFrame(const uchar* buffer);
41 void updateStatus(void);
42 void updateCamera();
43
44 void setMonitor(const Monitor *mon);
45 void setWidgets(MythUIImage *image, MythUIText *status,
46 MythUIText *camera);
47
48 Monitor *getMonitor(void) { return &m_monitor; }
49
50 private:
54
55 uchar *m_rgba {nullptr};
56
58};
59
61{
62 Q_OBJECT
63
64 public:
65 explicit ZMLivePlayer(MythScreenStack *parent, bool isMiniPlayer = false);
66 ~ZMLivePlayer() override;
67
68 bool Create(void) override; // MythScreenType
69 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
70 void customEvent(QEvent *event) override; // MythUIType
71
72 void ShowMenu() override; // MythScreenType
73
74 void setMonitorLayout(int layout, bool restore = false);
75
76 protected slots:
77 void updateFrame(void);
78 bool initMonitorLayout(int layout);
79
80 protected:
81 MythUIType* GetMythUIType(const QString &name, bool optional = false);
82 bool hideAll();
83 void stopPlayers(void);
84 void changePlayerMonitor(int playerNo);
85 void changeView(void);
86
87 QTimer *m_frameTimer {nullptr};
88 bool m_paused {false};
91
92 std::vector<Player *> *m_players {nullptr};
93
94 bool m_isMiniPlayer {false};
96};
97
98#endif
Screen in which all other widgets are contained and rendered.
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:98
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
The base class on which all widgets and screens are based.
Definition: mythuitype.h:86
Monitor * getMonitor(void)
Definition: zmliveplayer.h:48
MythUIImage * m_frameImage
Definition: zmliveplayer.h:51
MythUIText * m_statusText
Definition: zmliveplayer.h:52
void updateFrame(const uchar *buffer)
~Player(void)
void updateStatus(void)
void setWidgets(MythUIImage *image, MythUIText *status, MythUIText *camera)
MythUIText * m_cameraText
Definition: zmliveplayer.h:53
void setMonitor(const Monitor *mon)
void updateCamera()
Player(void)=default
Monitor m_monitor
Definition: zmliveplayer.h:57
uchar * m_rgba
Definition: zmliveplayer.h:55
bool m_isMiniPlayer
Definition: zmliveplayer.h:94
QTimer * m_frameTimer
Definition: zmliveplayer.h:87
MythUIType * GetMythUIType(const QString &name, bool optional=false)
int m_monitorCount
Definition: zmliveplayer.h:90
~ZMLivePlayer() override
bool initMonitorLayout(int layout)
ZMLivePlayer(MythScreenStack *parent, bool isMiniPlayer=false)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void stopPlayers(void)
int m_monitorLayout
Definition: zmliveplayer.h:89
bool Create(void) override
std::vector< Player * > * m_players
Definition: zmliveplayer.h:92
void changeView(void)
void setMonitorLayout(int layout, bool restore=false)
int m_alarmMonitor
Definition: zmliveplayer.h:95
void changePlayerMonitor(int playerNo)
void ShowMenu() override
void customEvent(QEvent *event) override
void updateFrame(void)