author | simon <simon> | 2002-12-09 00:02:49 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 00:02:49 (UTC) |
commit | 373051a9f8e624e57bac83bb09af1840fef14b4c (patch) (unidiff) | |
tree | 8061ea742db5d311607e48dc2b033f971a0a4042 | |
parent | 9c2b4d917af88b6051a3bc4273d6a50d124f65dd (diff) | |
download | opie-373051a9f8e624e57bac83bb09af1840fef14b4c.zip opie-373051a9f8e624e57bac83bb09af1840fef14b4c.tar.gz opie-373051a9f8e624e57bac83bb09af1840fef14b4c.tar.bz2 |
- Key_Space triggers togglePaused()
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 2a158a8..8f34736 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -419,87 +419,79 @@ void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { | |||
419 | mouseMoveEvent( event ); | 419 | mouseMoveEvent( event ); |
420 | } | 420 | } |
421 | 421 | ||
422 | 422 | ||
423 | void AudioWidget::showEvent( QShowEvent* ) { | 423 | void AudioWidget::showEvent( QShowEvent* ) { |
424 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 424 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
425 | mouseMoveEvent( &event ); | 425 | mouseMoveEvent( &event ); |
426 | } | 426 | } |
427 | 427 | ||
428 | 428 | ||
429 | void AudioWidget::paintEvent( QPaintEvent * pe ) { | 429 | void AudioWidget::paintEvent( QPaintEvent * pe ) { |
430 | if ( !pe->erased() ) { | 430 | if ( !pe->erased() ) { |
431 | // Combine with background and double buffer | 431 | // Combine with background and double buffer |
432 | QPixmap pix( pe->rect().size() ); | 432 | QPixmap pix( pe->rect().size() ); |
433 | QPainter p( &pix ); | 433 | QPainter p( &pix ); |
434 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 434 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
435 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); | 435 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); |
436 | for ( unsigned int i = 0; i < buttons.size(); i++ ) | 436 | for ( unsigned int i = 0; i < buttons.size(); i++ ) |
437 | paintButton( p, i ); | 437 | paintButton( p, i ); |
438 | QPainter p2( this ); | 438 | QPainter p2( this ); |
439 | p2.drawPixmap( pe->rect().topLeft(), pix ); | 439 | p2.drawPixmap( pe->rect().topLeft(), pix ); |
440 | } else { | 440 | } else { |
441 | QPainter p( this ); | 441 | QPainter p( this ); |
442 | for ( unsigned int i = 0; i < buttons.size(); i++ ) | 442 | for ( unsigned int i = 0; i < buttons.size(); i++ ) |
443 | paintButton( p, i ); | 443 | paintButton( p, i ); |
444 | } | 444 | } |
445 | } | 445 | } |
446 | 446 | ||
447 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { | 447 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) { |
448 | switch ( e->key() ) { | 448 | switch ( e->key() ) { |
449 | ////////////////////////////// Zaurus keys | 449 | ////////////////////////////// Zaurus keys |
450 | case Key_Home: | 450 | case Key_Home: |
451 | break; | 451 | break; |
452 | case Key_F9: //activity | 452 | case Key_F9: //activity |
453 | hide(); | 453 | hide(); |
454 | // qDebug("Audio F9"); | 454 | // qDebug("Audio F9"); |
455 | break; | 455 | break; |
456 | case Key_F10: //contacts | 456 | case Key_F10: //contacts |
457 | break; | 457 | break; |
458 | case Key_F11: //menu | 458 | case Key_F11: //menu |
459 | mediaPlayerState.toggleBlank(); | 459 | mediaPlayerState.toggleBlank(); |
460 | break; | 460 | break; |
461 | case Key_F12: //home | 461 | case Key_F12: //home |
462 | break; | 462 | break; |
463 | case Key_F13: //mail | 463 | case Key_F13: //mail |
464 | mediaPlayerState.toggleBlank(); | 464 | mediaPlayerState.toggleBlank(); |
465 | break; | 465 | break; |
466 | case Key_Space: { | 466 | case Key_Space: { |
467 | if(mediaPlayerState.isPlaying()) { | 467 | mediaPlayerState.togglePaused(); |
468 | // toggleButton(1); | ||
469 | mediaPlayerState.setPlaying(FALSE); | ||
470 | // toggleButton(1); | ||
471 | } else { | ||
472 | // toggleButton(0); | ||
473 | mediaPlayerState.setPlaying(TRUE); | ||
474 | // toggleButton(0); | ||
475 | } | ||
476 | } | 468 | } |
477 | break; | 469 | break; |
478 | case Key_Down: | 470 | case Key_Down: |
479 | // toggleButton(6); | 471 | // toggleButton(6); |
480 | emit lessClicked(); | 472 | emit lessClicked(); |
481 | emit lessReleased(); | 473 | emit lessReleased(); |
482 | // toggleButton(6); | 474 | // toggleButton(6); |
483 | break; | 475 | break; |
484 | case Key_Up: | 476 | case Key_Up: |
485 | // toggleButton(5); | 477 | // toggleButton(5); |
486 | emit moreClicked(); | 478 | emit moreClicked(); |
487 | emit moreReleased(); | 479 | emit moreReleased(); |
488 | // toggleButton(5); | 480 | // toggleButton(5); |
489 | break; | 481 | break; |
490 | case Key_Right: | 482 | case Key_Right: |
491 | // toggleButton(3); | 483 | // toggleButton(3); |
492 | mediaPlayerState.setNext(); | 484 | mediaPlayerState.setNext(); |
493 | // toggleButton(3); | 485 | // toggleButton(3); |
494 | break; | 486 | break; |
495 | case Key_Left: | 487 | case Key_Left: |
496 | // toggleButton(4); | 488 | // toggleButton(4); |
497 | mediaPlayerState.setPrev(); | 489 | mediaPlayerState.setPrev(); |
498 | // toggleButton(4); | 490 | // toggleButton(4); |
499 | break; | 491 | break; |
500 | case Key_Escape: { | 492 | case Key_Escape: { |
501 | } | 493 | } |
502 | break; | 494 | break; |
503 | 495 | ||
504 | }; | 496 | }; |
505 | } | 497 | } |