00001 /* ============================================================ 00002 * This program is free software; you can redistribute it 00003 * and/or modify it under the terms of the GNU General 00004 * Public License as published bythe Free Software Foundation; 00005 * either version 2, or (at your option) 00006 * any later version. 00007 * 00008 * This program is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 * GNU General Public License for more details. 00012 * 00013 * ============================================================ */ 00014 00015 #ifndef ZMLIVEPLAYER_H 00016 #define ZMLIVEPLAYER_H 00017 00018 // c++ 00019 #include <vector> 00020 using namespace std; 00021 00022 // qt 00023 //#include <QKeyEvent> 00024 00025 // mythtv 00026 #include <mythscreentype.h> 00027 #include <mythuiimage.h> 00028 #include <mythuitext.h> 00029 00030 // mythzoneminder 00031 #include "zmdefines.h" 00032 00033 class Player 00034 { 00035 public: 00036 Player(void); 00037 ~Player(void); 00038 00039 void updateFrame(const uchar* buffer); 00040 void updateStatus(void); 00041 void updateCamera(); 00042 00043 void setMonitor(Monitor *mon); 00044 void setWidgets(MythUIImage *image, MythUIText *status, 00045 MythUIText *camera); 00046 00047 Monitor *getMonitor(void) { return &m_monitor; } 00048 00049 private: 00050 void getMonitorList(void); 00051 00052 MythUIImage *m_frameImage; 00053 MythUIText *m_statusText; 00054 MythUIText *m_cameraText; 00055 00056 MythImage *m_image; 00057 00058 uchar *m_rgba; 00059 00060 Monitor m_monitor; 00061 }; 00062 00063 class ZMLivePlayer : public MythScreenType 00064 { 00065 Q_OBJECT 00066 00067 public: 00068 ZMLivePlayer(MythScreenStack *parent); 00069 ~ZMLivePlayer(); 00070 00071 bool Create(void); 00072 00073 bool keyPressEvent(QKeyEvent *); 00074 00075 void setMonitorLayout(int layout, bool restore = false); 00076 00077 private slots: 00078 void updateFrame(void); 00079 bool initMonitorLayout(void); 00080 void getMonitorList(void); 00081 00082 private: 00083 MythUIType* GetMythUIType(const QString &name, bool optional = false); 00084 bool hideAll(); 00085 void stopPlayers(void); 00086 void changePlayerMonitor(int playerNo); 00087 00088 QTimer *m_frameTimer; 00089 bool m_paused; 00090 int m_monitorLayout; 00091 int m_monitorCount; 00092 00093 vector<Player *> *m_players; 00094 vector<Monitor *> *m_monitors; 00095 }; 00096 00097 #endif
1.6.3