summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 14:23:06 (UTC)
committer simon <simon>2002-12-02 14:23:06 (UTC)
commit6440dfbca27a1716456c081ff1b1756616afc518 (patch) (unidiff)
tree54c35f1acd1e3b06ba9b6cedbabc76dbc6a4783d
parent8179c80f459eeee815aeb279f73df754ba303198 (diff)
downloadopie-6440dfbca27a1716456c081ff1b1756616afc518.zip
opie-6440dfbca27a1716456c081ff1b1756616afc518.tar.gz
opie-6440dfbca27a1716456c081ff1b1756616afc518.tar.bz2
- use currentTab() instead of whichList()
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 7c2b007..5cdfbf2 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -378,130 +378,130 @@ void AudioWidget::skipBack() {
378 378
379void AudioWidget::stopSkip() { 379void AudioWidget::stopSkip() {
380 killTimers(); 380 killTimers();
381} 381}
382 382
383 383
384void AudioWidget::timerEvent( QTimerEvent * ) { 384void AudioWidget::timerEvent( QTimerEvent * ) {
385 if ( skipDirection == +1 ) { 385 if ( skipDirection == +1 ) {
386 mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); 386 mediaPlayerState->setPosition( mediaPlayerState->position() + 2 );
387 } else if ( skipDirection == -1 ) { 387 } else if ( skipDirection == -1 ) {
388 mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); 388 mediaPlayerState->setPosition( mediaPlayerState->position() - 2 );
389 } 389 }
390} 390}
391 391
392 392
393void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { 393void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
394 for ( int i = 0; i < numButtons; i++ ) { 394 for ( int i = 0; i < numButtons; i++ ) {
395 if ( event->state() == QMouseEvent::LeftButton ) { 395 if ( event->state() == QMouseEvent::LeftButton ) {
396 // The test to see if the mouse click is inside the button or not 396 // The test to see if the mouse click is inside the button or not
397 int x = event->pos().x() - xoff; 397 int x = event->pos().x() - xoff;
398 int y = event->pos().y() - yoff; 398 int y = event->pos().y() - yoff;
399 399
400 bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() 400 bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width()
401 && y < imgButtonMask->height() 401 && y < imgButtonMask->height()
402 && imgButtonMask->pixelIndex( x, y ) == i + 1 ); 402 && imgButtonMask->pixelIndex( x, y ) == i + 1 );
403 403
404 if ( isOnButton && !audioButtons[i].isHeld ) { 404 if ( isOnButton && !audioButtons[i].isHeld ) {
405 audioButtons[i].isHeld = TRUE; 405 audioButtons[i].isHeld = TRUE;
406 toggleButton(i); 406 toggleButton(i);
407 switch (i) { 407 switch (i) {
408 case AudioVolumeUp: 408 case AudioVolumeUp:
409 emit moreClicked(); 409 emit moreClicked();
410 return; 410 return;
411 case AudioVolumeDown: 411 case AudioVolumeDown:
412 emit lessClicked(); 412 emit lessClicked();
413 return; 413 return;
414 case AudioForward: 414 case AudioForward:
415 emit forwardClicked(); 415 emit forwardClicked();
416 return; 416 return;
417 case AudioBack: 417 case AudioBack:
418 emit backClicked(); 418 emit backClicked();
419 return; 419 return;
420 } 420 }
421 } else if ( !isOnButton && audioButtons[i].isHeld ) { 421 } else if ( !isOnButton && audioButtons[i].isHeld ) {
422 audioButtons[i].isHeld = FALSE; 422 audioButtons[i].isHeld = FALSE;
423 toggleButton(i); 423 toggleButton(i);
424 } 424 }
425 } else { 425 } else {
426 if ( audioButtons[i].isHeld ) { 426 if ( audioButtons[i].isHeld ) {
427 audioButtons[i].isHeld = FALSE; 427 audioButtons[i].isHeld = FALSE;
428 if ( !audioButtons[i].isToggle ) { 428 if ( !audioButtons[i].isToggle ) {
429 setToggleButton( i, FALSE ); 429 setToggleButton( i, FALSE );
430 } 430 }
431 qDebug("mouseEvent %d", i); 431 qDebug("mouseEvent %d", i);
432 switch (i) { 432 switch (i) {
433 case AudioPlay: 433 case AudioPlay:
434 if( mediaPlayerState->isPaused() ) { 434 if( mediaPlayerState->isPaused() ) {
435 mediaPlayerState->setPaused( FALSE ); 435 mediaPlayerState->setPaused( FALSE );
436 return; 436 return;
437 } else if( !mediaPlayerState->isPaused() ) { 437 } else if( !mediaPlayerState->isPaused() ) {
438 mediaPlayerState->setPaused( TRUE ); 438 mediaPlayerState->setPaused( TRUE );
439 return; 439 return;
440 } 440 }
441 case AudioStop: mediaPlayerState->setPlaying(FALSE); return; 441 case AudioStop: mediaPlayerState->setPlaying(FALSE); return;
442 case AudioNext: if( playList->whichList() ==0 ) mediaPlayerState->setNext(); return; 442 case AudioNext: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState->setNext(); return;
443 case AudioPrevious: if( playList->whichList() ==0 ) mediaPlayerState->setPrev(); return; 443 case AudioPrevious: if( playList->currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState->setPrev(); return;
444 case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; 444 case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return;
445 case AudioVolumeUp: emit moreReleased(); return; 445 case AudioVolumeUp: emit moreReleased(); return;
446 case AudioVolumeDown: emit lessReleased(); return; 446 case AudioVolumeDown: emit lessReleased(); return;
447 case AudioPlayList: mediaPlayerState->setList(); return; 447 case AudioPlayList: mediaPlayerState->setList(); return;
448 case AudioForward: emit forwardReleased(); return; 448 case AudioForward: emit forwardReleased(); return;
449 case AudioBack: emit backReleased(); return; 449 case AudioBack: emit backReleased(); return;
450 } 450 }
451 } 451 }
452 } 452 }
453 } 453 }
454} 454}
455 455
456 456
457void AudioWidget::mousePressEvent( QMouseEvent *event ) { 457void AudioWidget::mousePressEvent( QMouseEvent *event ) {
458 mouseMoveEvent( event ); 458 mouseMoveEvent( event );
459} 459}
460 460
461 461
462void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { 462void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) {
463 mouseMoveEvent( event ); 463 mouseMoveEvent( event );
464} 464}
465 465
466 466
467void AudioWidget::showEvent( QShowEvent* ) { 467void AudioWidget::showEvent( QShowEvent* ) {
468 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); 468 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 );
469 mouseMoveEvent( &event ); 469 mouseMoveEvent( &event );
470} 470}
471 471
472 472
473void AudioWidget::closeEvent( QCloseEvent* ) { 473void AudioWidget::closeEvent( QCloseEvent* ) {
474 mediaPlayerState->setList(); 474 mediaPlayerState->setList();
475} 475}
476 476
477 477
478void AudioWidget::paintEvent( QPaintEvent * pe ) { 478void AudioWidget::paintEvent( QPaintEvent * pe ) {
479 if ( !pe->erased() ) { 479 if ( !pe->erased() ) {
480 // Combine with background and double buffer 480 // Combine with background and double buffer
481 QPixmap pix( pe->rect().size() ); 481 QPixmap pix( pe->rect().size() );
482 QPainter p( &pix ); 482 QPainter p( &pix );
483 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); 483 p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
484 p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); 484 p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() );
485 for ( int i = 0; i < numButtons; i++ ) 485 for ( int i = 0; i < numButtons; i++ )
486 paintButton( &p, i ); 486 paintButton( &p, i );
487 QPainter p2( this ); 487 QPainter p2( this );
488 p2.drawPixmap( pe->rect().topLeft(), pix ); 488 p2.drawPixmap( pe->rect().topLeft(), pix );
489 } else { 489 } else {
490 QPainter p( this ); 490 QPainter p( this );
491 for ( int i = 0; i < numButtons; i++ ) 491 for ( int i = 0; i < numButtons; i++ )
492 paintButton( &p, i ); 492 paintButton( &p, i );
493 } 493 }
494} 494}
495 495
496void AudioWidget::keyReleaseEvent( QKeyEvent *e) { 496void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
497 switch ( e->key() ) { 497 switch ( e->key() ) {
498 ////////////////////////////// Zaurus keys 498 ////////////////////////////// Zaurus keys
499 case Key_Home: 499 case Key_Home:
500 break; 500 break;
501 case Key_F9: //activity 501 case Key_F9: //activity
502 hide(); 502 hide();
503 // qDebug("Audio F9"); 503 // qDebug("Audio F9");
504 break; 504 break;
505 case Key_F10: //contacts 505 case Key_F10: //contacts
506 break; 506 break;
507 case Key_F11: //menu 507 case Key_F11: //menu