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) = default;
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
56};
57
59{
60 Q_OBJECT
61
62 public:
63 explicit ZMLivePlayer(MythScreenStack *parent, bool isMiniPlayer = false);
64 ~ZMLivePlayer() override;
65
66 bool Create(void) override; // MythScreenType
67 bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
68 void customEvent(QEvent *event) override; // MythUIType
69
70 void ShowMenu() override; // MythScreenType
71
72 void setMonitorLayout(int layout, bool restore = false);
73
74 protected slots:
75 void updateFrame(void);
76 bool initMonitorLayout(int layout);
77
78 protected:
79 MythUIType* GetMythUIType(const QString &name, bool optional = false);
80 bool hideAll();
81 void stopPlayers(void);
82 void changePlayerMonitor(int playerNo);
83 void changeView(void);
84
85 QTimer *m_frameTimer {nullptr};
86 bool m_paused {false};
89
90 std::vector<Player *> *m_players {nullptr};
91
92 bool m_isMiniPlayer {false};
94};
95
96#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)
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:55
~Player(void)=default
bool m_isMiniPlayer
Definition: zmliveplayer.h:92
QTimer * m_frameTimer
Definition: zmliveplayer.h:85
MythUIType * GetMythUIType(const QString &name, bool optional=false)
int m_monitorCount
Definition: zmliveplayer.h:88
~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:87
bool Create(void) override
std::vector< Player * > * m_players
Definition: zmliveplayer.h:90
void changeView(void)
void setMonitorLayout(int layout, bool restore=false)
int m_alarmMonitor
Definition: zmliveplayer.h:93
void changePlayerMonitor(int playerNo)
void ShowMenu() override
void customEvent(QEvent *event) override
void updateFrame(void)