summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-09-05 12:34:07 (UTC)
committer llornkcor <llornkcor>2002-09-05 12:34:07 (UTC)
commit4daacd5aa7494e02df2afd245f22fbb59f8e19d9 (patch) (unidiff)
treef832d2156302fc53d63c647a55193808f89d0912
parente2186a49cb5cbdf01b56f57818a15a760ff25b2e (diff)
downloadopie-4daacd5aa7494e02df2afd245f22fbb59f8e19d9.zip
opie-4daacd5aa7494e02df2afd245f22fbb59f8e19d9.tar.gz
opie-4daacd5aa7494e02df2afd245f22fbb59f8e19d9.tar.bz2
ignore next and prev buttons when playing from filelist, for now
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp7
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp6
2 files changed, 9 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 446fa45..7c49733 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -34,34 +34,36 @@
34#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36#include <qpe/config.h> 36#include <qpe/config.h>
37 37
38#include <qwidget.h> 38#include <qwidget.h>
39#include <qpixmap.h> 39#include <qpixmap.h>
40#include <qbutton.h> 40#include <qbutton.h>
41#include <qpainter.h> 41#include <qpainter.h>
42#include <qframe.h> 42#include <qframe.h>
43#include <qlayout.h> 43#include <qlayout.h>
44 44
45#include <stdlib.h> 45#include <stdlib.h>
46#include <stdio.h> 46#include <stdio.h>
47 47
48#include "audiowidget.h" 48#include "audiowidget.h"
49#include "mediaplayerstate.h" 49#include "mediaplayerstate.h"
50#include "playlistwidget.h"
50 51
51extern MediaPlayerState *mediaPlayerState; 52extern MediaPlayerState *mediaPlayerState;
53extern PlayListWidget *playList;
52 54
53static const int xo = -2; // movable x offset 55static const int xo = -2; // movable x offset
54static const int yo = 22; // movable y offset 56static const int yo = 22; // movable y offset
55 57
56 58
57Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) { 59Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) {
58 setFrameStyle( WinPanel | Sunken ); 60 setFrameStyle( WinPanel | Sunken );
59 setText( "No Song" ); 61 setText( "No Song" );
60} 62}
61 63
62Ticker::~Ticker() { 64Ticker::~Ticker() {
63} 65}
64 66
65void Ticker::setText( const QString& text ) { 67void Ticker::setText( const QString& text ) {
66 pos = 0; // reset it everytime the text is changed 68 pos = 0; // reset it everytime the text is changed
67 scrollText = text; 69 scrollText = text;
@@ -212,32 +214,33 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
212 214
213} 215}
214 216
215AudioWidget::~AudioWidget() { 217AudioWidget::~AudioWidget() {
216 218
217 for ( int i = 0; i < 10; i++ ) { 219 for ( int i = 0; i < 10; i++ ) {
218 delete buttonPixUp[i]; 220 delete buttonPixUp[i];
219 delete buttonPixDown[i]; 221 delete buttonPixDown[i];
220 } 222 }
221 delete pixBg; 223 delete pixBg;
222 delete imgUp; 224 delete imgUp;
223 delete imgDn; 225 delete imgDn;
224 delete imgButtonMask; 226 delete imgButtonMask;
225 for ( int i = 0; i < 10; i++ ) { 227 for ( int i = 0; i < 10; i++ ) {
226 delete masks[i]; 228 delete masks[i];
227 } 229 }
230// mediaPlayerState->setPlaying(false);
228} 231}
229 232
230namespace { 233namespace {
231 234
232QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { 235QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) {
233 QPixmap pix( img.width(), img.height() ); 236 QPixmap pix( img.width(), img.height() );
234 QPainter p( &pix ); 237 QPainter p( &pix );
235 p.drawTiledPixmap( pix.rect(), bg, offset ); 238 p.drawTiledPixmap( pix.rect(), bg, offset );
236 p.drawImage( 0, 0, img ); 239 p.drawImage( 0, 0, img );
237 return new QPixmap( pix ); 240 return new QPixmap( pix );
238} 241}
239 242
240 243
241QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { 244QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) {
242 QPixmap *pixmap = new QPixmap( pix ); 245 QPixmap *pixmap = new QPixmap( pix );
243 pixmap->setMask( mask ); 246 pixmap->setMask( mask );
@@ -456,34 +459,34 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
456 qDebug("mouseEvent %d", i); 459 qDebug("mouseEvent %d", i);
457 switch (i) { 460 switch (i) {
458 case AudioPlay: 461 case AudioPlay:
459 if( mediaPlayerState->isPaused ) { 462 if( mediaPlayerState->isPaused ) {
460// setToggleButton( i, FALSE ); 463// setToggleButton( i, FALSE );
461 mediaPlayerState->setPaused( FALSE ); 464 mediaPlayerState->setPaused( FALSE );
462 return; 465 return;
463 } else if( !mediaPlayerState->isPaused ) { 466 } else if( !mediaPlayerState->isPaused ) {
464// setToggleButton( i, TRUE ); 467// setToggleButton( i, TRUE );
465 mediaPlayerState->setPaused( TRUE ); 468 mediaPlayerState->setPaused( TRUE );
466 return; 469 return;
467 } else { 470 } else {
468 // setToggleButton( i, TRUE ); 471 // setToggleButton( i, TRUE );
469 // mediaPlayerState->setPlaying( videoButtons[i].isDown ); 472 // mediaPlayerState->setPlaying( videoButtons[i].isDown );
470 } 473 }
471 case AudioStop: mediaPlayerState->setPlaying(FALSE); return; 474 case AudioStop: mediaPlayerState->setPlaying(FALSE); return;
472 case AudioNext: mediaPlayerState->setNext(); return; 475 case AudioNext: if(playList->whichList() ==0) mediaPlayerState->setNext(); return;
473 case AudioPrevious: mediaPlayerState->setPrev(); return; 476 case AudioPrevious: if(playList->whichList() ==0) mediaPlayerState->setPrev(); return;
474 case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; 477 case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return;
475 case AudioVolumeUp: emit moreReleased(); return; 478 case AudioVolumeUp: emit moreReleased(); return;
476 case AudioVolumeDown: emit lessReleased(); return; 479 case AudioVolumeDown: emit lessReleased(); return;
477 case AudioPlayList: mediaPlayerState->setList(); return; 480 case AudioPlayList: mediaPlayerState->setList(); return;
478 case AudioForward: emit forwardReleased(); return; 481 case AudioForward: emit forwardReleased(); return;
479 case AudioBack: emit backReleased(); return; 482 case AudioBack: emit backReleased(); return;
480 } 483 }
481 } 484 }
482 } 485 }
483 } 486 }
484} 487}
485 488
486 489
487void AudioWidget::mousePressEvent( QMouseEvent *event ) { 490void AudioWidget::mousePressEvent( QMouseEvent *event ) {
488 mouseMoveEvent( event ); 491 mouseMoveEvent( event );
489} 492}
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
@@ -31,42 +31,44 @@
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
56extern MediaPlayerState *mediaPlayerState; 57extern MediaPlayerState *mediaPlayerState;
58extern PlayListWidget *playList;
57 59
58 60
59static const int xo = 2; // movable x offset 61static const int xo = 2; // movable x offset
60static const int yo = 0; // movable y offset 62static const int yo = 0; // movable y offset
61 63
62 64
63struct MediaButton { 65struct MediaButton {
64 bool isToggle, isHeld, isDown; 66 bool isToggle, isHeld, isDown;
65}; 67};
66 68
67MediaButton videoButtons[] = { 69MediaButton 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
@@ -325,34 +327,34 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
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
352void VideoWidget::mousePressEvent( QMouseEvent *event ) { 354void VideoWidget::mousePressEvent( QMouseEvent *event ) {
353 mouseMoveEvent( event ); 355 mouseMoveEvent( event );
354} 356}
355 357
356void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { 358void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) {
357 if ( mediaPlayerState->fullscreen() ) { 359 if ( mediaPlayerState->fullscreen() ) {
358 mediaPlayerState->setFullscreen( FALSE ); 360 mediaPlayerState->setFullscreen( FALSE );