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 ZMPLAYER_H 00016 #define ZMPLAYER_H 00017 00018 // myth 00019 #include <mythtv/uitypes.h> 00020 #include <mythtv/uilistbtntype.h> 00021 #include <mythtv/xmlparse.h> 00022 #include <mythtv/mythdialogs.h> 00023 00024 // gl stuff 00025 #include <GL/glx.h> 00026 #include <GL/glu.h> 00027 00028 // xlib 00029 #include <X11/Xlib.h> 00030 00031 // xv stuff 00032 #include <X11/extensions/Xvlib.h> 00033 #define RGB24 0x3 00034 00035 // zm 00036 #include "zmdefines.h" 00037 00038 class ZMPlayer : public MythThemedDialog 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 00044 ZMPlayer(vector<Event *> *eventList, int *currentEvent, MythMainWindow *parent, 00045 const QString &window_name, const QString &theme_filename, 00046 const char *name = 0); 00047 ~ZMPlayer(); 00048 00049 private slots: 00050 void updateFrame(void); 00051 void playPressed(void); 00052 void deletePressed(void); 00053 void prevPressed(void); 00054 void nextPressed(void); 00055 00056 private: 00057 void wireUpTheme(void); 00058 UITextType* getTextType(QString name); 00059 void keyPressEvent(QKeyEvent *e); 00060 void getEventInfo(void); 00061 void displayFrame(void); 00062 void displayFrameGl(void); 00063 void displayFrameXv(void); 00064 void getFrame(void); 00065 int getXvPortId(Display *dpy); 00066 00067 bool initPlayer(void); 00068 bool initPlayerGl(void); 00069 bool initPlayerXv(void); 00070 00071 void stopPlayer(void); 00072 00073 UIImageType *m_frameImage; 00074 UIImageType *m_frameFSImage; 00075 00076 UITextType *m_noEventsText; 00077 UITextType *m_eventText; 00078 UITextType *m_cameraText; 00079 UITextType *m_frameText; 00080 UITextType *m_dateText; 00081 00082 UITextButtonType *m_playButton; 00083 UITextButtonType *m_deleteButton; 00084 UITextButtonType *m_nextButton; 00085 UITextButtonType *m_prevButton; 00086 00087 int *m_currentEvent; 00088 vector<Event *> *m_eventList; 00089 00090 vector<Frame *> *m_frameList; 00091 QTimer *m_frameTimer; 00092 int m_curFrame; 00093 int m_lastFrame; 00094 00095 QString m_eventDir; 00096 bool m_paused; 00097 bool m_bFullScreen; 00098 00099 bool m_initalized; 00100 bool m_useGL; 00101 GLXContext m_cx; 00102 Display *m_dis; 00103 Window m_win; 00104 int m_screenNum; 00105 QImage m_image; 00106 QRect m_displayRect; 00107 GC m_gc; 00108 XImage *m_XImage; 00109 XvImage *m_XvImage; 00110 char *m_rgba; 00111 int m_XVport; 00112 bool m_haveXV; 00113 }; 00114 00115 #endif
1.5.5