00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ZMLIVEPLAYER_H
00016 #define ZMLIVEPLAYER_H
00017
00018
00019 #include <mythtv/uitypes.h>
00020 #include <mythtv/uilistbtntype.h>
00021 #include <mythtv/xmlparse.h>
00022 #include <mythtv/mythdialogs.h>
00023
00024
00025 #include <GL/glx.h>
00026 #include <GL/glu.h>
00027
00028
00029 #include <X11/Xlib.h>
00030
00031
00032 #include <X11/extensions/Xvlib.h>
00033 #define RGB24 0x3
00034
00035
00036 #include "zmdefines.h"
00037
00038 class Player
00039 {
00040 public:
00041 Player(void);
00042 ~Player(void);
00043
00044 bool startPlayer(Monitor *mon, Window winID);
00045 void stopPlaying(void);
00046 void updateScreen(const uchar* buffer);
00047 void setMonitor(Monitor *mon, Window winID);
00048 Monitor *getMonitor(void) { return &m_monitor; }
00049 void setDisplayRect(QRect displayRect) { m_displayRect = displayRect; }
00050
00051 private:
00052 void getMonitorList(void);
00053 bool startPlayerGL(Monitor *mon, Window winID);
00054 bool startPlayerXv(Monitor *mon, Window winID);
00055 void updateScreenGL(const uchar* buffer);
00056 void updateScreenXv(const uchar* buffer);
00057 int getXvPortId(Display *dpy);
00058
00059 Monitor m_monitor;
00060 bool m_initalized;
00061 GLXContext m_cx;
00062 Display *m_dis;
00063 Window m_win;
00064 int m_screenNum;
00065
00066 QRect m_displayRect;
00067 bool m_useGL;
00068 GC m_gc;
00069 XImage *m_XImage;
00070 XvImage *m_XvImage;
00071 char *m_rgba;
00072 int m_XVport;
00073 bool m_haveXV;
00074 };
00075
00076 class ZMLivePlayer : public MythThemedDialog
00077 {
00078 Q_OBJECT
00079
00080 public:
00081
00082 ZMLivePlayer(int monitorID, int eventID, MythMainWindow *parent,
00083 const QString &window_name, const QString &theme_filename,
00084 const char *name = 0);
00085 ~ZMLivePlayer();
00086
00087 void setMonitorLayout(int layout, bool restore = false);
00088
00089 private slots:
00090 void updateFrame(void);
00091 void updateMonitorStatus(void);
00092 void initMonitorLayout(void);
00093 void receivedLiveFrame(int minitorID, QString& status, const uchar* buffer, int frameSize);
00094 void getMonitorList(void);
00095
00096 private:
00097 void wireUpTheme(void);
00098 UITextType* getTextType(QString name);
00099 void keyPressEvent(QKeyEvent *e);
00100 void stopPlayers(void);
00101 void changePlayerMonitor(int playerNo);
00102
00103 QTimer *m_frameTimer;
00104 QTimer *m_statusTimer;
00105 bool m_paused;
00106 int m_eventID;
00107 int m_monitorID;
00108 int m_monitorLayout;
00109 int m_monitorCount;
00110
00111 vector<Player *> *m_players;
00112 vector<Monitor *> *m_monitors;
00113
00114 fontProp *m_idleFont;
00115 fontProp *m_alarmFont;
00116 fontProp *m_alertFont;
00117 };
00118
00119 #endif