00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef VIDEO_WIDGET_H
00021 #define VIDEO_WIDGET_H
00022
00023
00024 #include <qwidget.h>
00025
00026 class QPixmap;
00027 class QSlider;
00028
00029
00030 enum VideoButtons {
00031 VideoStop,
00032 VideoPlay,
00033
00034 VideoPrevious,
00035 VideoNext,
00036 VideoVolUp,
00037 VideoVolDown,
00038
00039 VideoFullscreen
00040 };
00041
00042 class VideoWidget : public QWidget {
00043 Q_OBJECT
00044 public:
00045 VideoWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
00046 ~VideoWidget();
00047
00048 bool playVideo();
00049
00050 public slots:
00051 void updateSlider( long, long );
00052 void sliderPressed( );
00053 void sliderReleased( );
00054
00055 void setPlaying( bool b) { setToggleButton( VideoPlay, b ); }
00056 void setFullscreen( bool b ) { setToggleButton( VideoFullscreen, b ); }
00057 void makeVisible();
00058 void setPosition( long );
00059 void setLength( long );
00060 void setView( char );
00061
00062 signals:
00063 void moreClicked();
00064 void lessClicked();
00065 void moreReleased();
00066 void lessReleased();
00067 void sliderMoved( long );
00068
00069 protected:
00070 void resizeEvent( QResizeEvent * );
00071 void paintEvent( QPaintEvent *pe );
00072 void mouseMoveEvent( QMouseEvent *event );
00073 void mousePressEvent( QMouseEvent *event );
00074 void mouseReleaseEvent( QMouseEvent *event );
00075 void closeEvent( QCloseEvent *event );
00076 void keyReleaseEvent( QKeyEvent *e);
00077
00078 private:
00079 QPixmap *pixBg;
00080 QImage *imgUp;
00081 QImage *imgDn;
00082 QImage *imgButtonMask;
00083 QBitmap *masks[7];
00084 QString backgroundPix;
00085 QPixmap *buttonPixUp[7];
00086 QPixmap *buttonPixDown[7];
00087 QString skin;
00088 QSlider *slider;
00089 QPixmap *pixmaps[3];
00090 QImage *currentFrame;
00091 int xoff, yoff;
00092 int scaledWidth;
00093 int scaledHeight;
00094
00095 void paintButton( QPainter *p, int i );
00096 void toggleButton( int );
00097 void setToggleButton( int, bool );
00098
00099 };
00100
00101
00102 #endif // VIDEO_WIDGET_H
00103
00104
00105