Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h new file mode 100644 index 0000000..e18edd1 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -0,0 +1,67 @@ | |||
1 | |||
2 | #ifndef VIDEO_WIDGET_H | ||
3 | #define VIDEO_WIDGET_H | ||
4 | |||
5 | |||
6 | #include <qwidget.h> | ||
7 | |||
8 | class QPixmap; | ||
9 | class QSlider; | ||
10 | |||
11 | enum VideoButtons { | ||
12 | VideoPrevious, | ||
13 | VideoStop, | ||
14 | VideoPlay, | ||
15 | VideoPause, | ||
16 | VideoNext, | ||
17 | VideoPlayList, | ||
18 | VideoFullscreen | ||
19 | }; | ||
20 | |||
21 | class VideoWidget : public QWidget { | ||
22 | Q_OBJECT | ||
23 | public: | ||
24 | VideoWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); | ||
25 | ~VideoWidget(); | ||
26 | |||
27 | bool playVideo(); | ||
28 | |||
29 | public slots: | ||
30 | void updateSlider( long, long ); | ||
31 | void sliderPressed( ); | ||
32 | void sliderReleased( ); | ||
33 | void setPaused( bool b) { setToggleButton( VideoPause, b ); } | ||
34 | void setPlaying( bool b) { setToggleButton( VideoPlay, b ); } | ||
35 | void setFullscreen( bool b ) { setToggleButton( VideoFullscreen, b ); } | ||
36 | void makeVisible(); | ||
37 | void setPosition( long ); | ||
38 | void setLength( long ); | ||
39 | void setView( char ); | ||
40 | |||
41 | signals: | ||
42 | void sliderMoved( long ); | ||
43 | |||
44 | protected: | ||
45 | void paintEvent( QPaintEvent *pe ); | ||
46 | void mouseMoveEvent( QMouseEvent *event ); | ||
47 | void mousePressEvent( QMouseEvent *event ); | ||
48 | void mouseReleaseEvent( QMouseEvent *event ); | ||
49 | void closeEvent( QCloseEvent *event ); | ||
50 | void keyReleaseEvent( QKeyEvent *e); | ||
51 | |||
52 | private: | ||
53 | void paintButton( QPainter *p, int i ); | ||
54 | void toggleButton( int ); | ||
55 | void setToggleButton( int, bool ); | ||
56 | |||
57 | QSlider *slider; | ||
58 | QPixmap *pixmaps[3]; | ||
59 | QImage *currentFrame; | ||
60 | int scaledWidth; | ||
61 | int scaledHeight; | ||
62 | }; | ||
63 | |||
64 | #endif // VIDEO_WIDGET_H | ||
65 | |||
66 | |||
67 | |||