Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index ffda2e4..8e3a365 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -23,58 +23,60 @@ | |||
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <qpe/qpeapplication.h> | 34 | #include <qpe/qpeapplication.h> |
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | #include <qpe/mediaplayerplugininterface.h> | 36 | #include <qpe/mediaplayerplugininterface.h> |
37 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
38 | 38 | ||
39 | 39 | ||
40 | #include <qwidget.h> | 40 | #include <qwidget.h> |
41 | #include <qpainter.h> | 41 | #include <qpainter.h> |
42 | #include <qpixmap.h> | 42 | #include <qpixmap.h> |
43 | #include <qslider.h> | 43 | #include <qslider.h> |
44 | #include <qdrawutil.h> | 44 | #include <qdrawutil.h> |
45 | #include "videowidget.h" | 45 | #include "videowidget.h" |
46 | #include "mediaplayerstate.h" | 46 | #include "mediaplayerstate.h" |
47 | #include "playlistwidget.h" | ||
47 | 48 | ||
48 | 49 | ||
49 | #ifdef Q_WS_QWS | 50 | #ifdef Q_WS_QWS |
50 | # define USE_DIRECT_PAINTER | 51 | # define USE_DIRECT_PAINTER |
51 | # include <qdirectpainter_qws.h> | 52 | # include <qdirectpainter_qws.h> |
52 | # include <qgfxraster_qws.h> | 53 | # include <qgfxraster_qws.h> |
53 | #endif | 54 | #endif |
54 | 55 | ||
55 | 56 | ||
56 | extern MediaPlayerState *mediaPlayerState; | 57 | extern MediaPlayerState *mediaPlayerState; |
58 | extern PlayListWidget *playList; | ||
57 | 59 | ||
58 | 60 | ||
59 | static const int xo = 2; // movable x offset | 61 | static const int xo = 2; // movable x offset |
60 | static const int yo = 0; // movable y offset | 62 | static const int yo = 0; // movable y offset |
61 | 63 | ||
62 | 64 | ||
63 | struct MediaButton { | 65 | struct MediaButton { |
64 | bool isToggle, isHeld, isDown; | 66 | bool isToggle, isHeld, isDown; |
65 | }; | 67 | }; |
66 | 68 | ||
67 | MediaButton videoButtons[] = { | 69 | MediaButton videoButtons[] = { |
68 | { FALSE, FALSE, FALSE }, // stop | 70 | { FALSE, FALSE, FALSE }, // stop |
69 | { TRUE, FALSE, FALSE }, // play | 71 | { TRUE, FALSE, FALSE }, // play |
70 | { FALSE, FALSE, FALSE }, // previous | 72 | { FALSE, FALSE, FALSE }, // previous |
71 | { FALSE, FALSE, FALSE }, // next | 73 | { FALSE, FALSE, FALSE }, // next |
72 | { FALSE, FALSE, FALSE }, // volUp | 74 | { FALSE, FALSE, FALSE }, // volUp |
73 | { FALSE, FALSE, FALSE }, // volDown | 75 | { FALSE, FALSE, FALSE }, // volDown |
74 | { TRUE, FALSE, FALSE } // fullscreen | 76 | { TRUE, FALSE, FALSE } // fullscreen |
75 | }; | 77 | }; |
76 | 78 | ||
77 | const char *skinV_mask_file_names[7] = { | 79 | const char *skinV_mask_file_names[7] = { |
78 | "stop","play","back","fwd","up","down","full" | 80 | "stop","play","back","fwd","up","down","full" |
79 | }; | 81 | }; |
80 | 82 | ||
@@ -317,50 +319,50 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
317 | 319 | ||
318 | if ( videoButtons[i].isHeld ) { | 320 | if ( videoButtons[i].isHeld ) { |
319 | videoButtons[i].isHeld = FALSE; | 321 | videoButtons[i].isHeld = FALSE; |
320 | if ( !videoButtons[i].isToggle ) { | 322 | if ( !videoButtons[i].isToggle ) { |
321 | setToggleButton( i, FALSE ); | 323 | setToggleButton( i, FALSE ); |
322 | } | 324 | } |
323 | 325 | ||
324 | switch(i) { | 326 | switch(i) { |
325 | 327 | ||
326 | case VideoPlay: { | 328 | case VideoPlay: { |
327 | if( mediaPlayerState->isPaused ) { | 329 | if( mediaPlayerState->isPaused ) { |
328 | setToggleButton( i, FALSE ); | 330 | setToggleButton( i, FALSE ); |
329 | mediaPlayerState->setPaused( FALSE ); | 331 | mediaPlayerState->setPaused( FALSE ); |
330 | return; | 332 | return; |
331 | } else if( !mediaPlayerState->isPaused ) { | 333 | } else if( !mediaPlayerState->isPaused ) { |
332 | setToggleButton( i, TRUE ); | 334 | setToggleButton( i, TRUE ); |
333 | mediaPlayerState->setPaused( TRUE ); | 335 | mediaPlayerState->setPaused( TRUE ); |
334 | return; | 336 | return; |
335 | } else { | 337 | } else { |
336 | return; | 338 | return; |
337 | } | 339 | } |
338 | } | 340 | } |
339 | 341 | ||
340 | case VideoStop: mediaPlayerState->setPlaying( FALSE ); return; | 342 | case VideoStop: mediaPlayerState->setPlaying( FALSE ); return; |
341 | case VideoNext: mediaPlayerState->setNext(); return; | 343 | case VideoNext: if(playList->whichList() ==0) mediaPlayerState->setNext(); return; |
342 | case VideoPrevious: mediaPlayerState->setPrev(); return; | 344 | case VideoPrevious: if(playList->whichList() ==0) mediaPlayerState->setPrev(); return; |
343 | case VideoVolUp: emit moreReleased(); return; | 345 | case VideoVolUp: emit moreReleased(); return; |
344 | case VideoVolDown: emit lessReleased(); return; | 346 | case VideoVolDown: emit lessReleased(); return; |
345 | case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; | 347 | case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; |
346 | } | 348 | } |
347 | } | 349 | } |
348 | } | 350 | } |
349 | } | 351 | } |
350 | } | 352 | } |
351 | 353 | ||
352 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { | 354 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { |
353 | mouseMoveEvent( event ); | 355 | mouseMoveEvent( event ); |
354 | } | 356 | } |
355 | 357 | ||
356 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { | 358 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { |
357 | if ( mediaPlayerState->fullscreen() ) { | 359 | if ( mediaPlayerState->fullscreen() ) { |
358 | mediaPlayerState->setFullscreen( FALSE ); | 360 | mediaPlayerState->setFullscreen( FALSE ); |
359 | makeVisible(); | 361 | makeVisible(); |
360 | } | 362 | } |
361 | mouseMoveEvent( event ); | 363 | mouseMoveEvent( event ); |
362 | } | 364 | } |
363 | 365 | ||
364 | void VideoWidget::showEvent( QShowEvent* ) { | 366 | void VideoWidget::showEvent( QShowEvent* ) { |
365 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 367 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
366 | mouseMoveEvent( &event ); | 368 | mouseMoveEvent( &event ); |