author | harlekin <harlekin> | 2002-08-16 16:54:31 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-16 16:54:31 (UTC) |
commit | bc53cd5b0218ca10b6e88bb03a558230b7781cf7 (patch) (unidiff) | |
tree | 8a089ca404f55f0e16bb81de3b98ce51f1c10496 | |
parent | fec49e4f9f8d016e335eaca1630f4108801cc3ce (diff) | |
download | opie-bc53cd5b0218ca10b6e88bb03a558230b7781cf7.zip opie-bc53cd5b0218ca10b6e88bb03a558230b7781cf7.tar.gz opie-bc53cd5b0218ca10b6e88bb03a558230b7781cf7.tar.bz2 |
forgot something
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 956789f..6f3842f 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -320,130 +320,134 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
320 | switch(i) { | 320 | switch(i) { |
321 | 321 | ||
322 | case VideoPlay: { | 322 | case VideoPlay: { |
323 | if( mediaPlayerState->isPaused ) { | 323 | if( mediaPlayerState->isPaused ) { |
324 | setToggleButton( i, FALSE ); | 324 | setToggleButton( i, FALSE ); |
325 | mediaPlayerState->setPaused( FALSE ); | 325 | mediaPlayerState->setPaused( FALSE ); |
326 | return; | 326 | return; |
327 | } else if( !mediaPlayerState->isPaused ) { | 327 | } else if( !mediaPlayerState->isPaused ) { |
328 | setToggleButton( i, TRUE ); | 328 | setToggleButton( i, TRUE ); |
329 | mediaPlayerState->setPaused( TRUE ); | 329 | mediaPlayerState->setPaused( TRUE ); |
330 | return; | 330 | return; |
331 | } else { | 331 | } else { |
332 | return; | 332 | return; |
333 | } | 333 | } |
334 | } | 334 | } |
335 | 335 | ||
336 | case VideoStop: mediaPlayerState->setPlaying( FALSE ); return; | 336 | case VideoStop: mediaPlayerState->setPlaying( FALSE ); return; |
337 | case VideoNext: mediaPlayerState->setNext(); return; | 337 | case VideoNext: mediaPlayerState->setNext(); return; |
338 | case VideoPrevious: mediaPlayerState->setPrev(); return; | 338 | case VideoPrevious: mediaPlayerState->setPrev(); return; |
339 | case VideoVolUp: emit moreReleased(); return; | 339 | case VideoVolUp: emit moreReleased(); return; |
340 | case VideoVolDown: emit lessReleased(); return; | 340 | case VideoVolDown: emit lessReleased(); return; |
341 | case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; | 341 | case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; |
342 | } | 342 | } |
343 | } | 343 | } |
344 | } | 344 | } |
345 | } | 345 | } |
346 | } | 346 | } |
347 | 347 | ||
348 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { | 348 | void VideoWidget::mousePressEvent( QMouseEvent *event ) { |
349 | mouseMoveEvent( event ); | 349 | mouseMoveEvent( event ); |
350 | } | 350 | } |
351 | 351 | ||
352 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { | 352 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { |
353 | if ( mediaPlayerState->fullscreen() ) { | 353 | if ( mediaPlayerState->fullscreen() ) { |
354 | mediaPlayerState->setFullscreen( FALSE ); | 354 | mediaPlayerState->setFullscreen( FALSE ); |
355 | makeVisible(); | 355 | makeVisible(); |
356 | } | 356 | } |
357 | mouseMoveEvent( event ); | 357 | mouseMoveEvent( event ); |
358 | } | 358 | } |
359 | 359 | ||
360 | void VideoWidget::showEvent( QShowEvent* ) { | 360 | void VideoWidget::showEvent( QShowEvent* ) { |
361 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); | 361 | QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); |
362 | mouseMoveEvent( &event ); | 362 | mouseMoveEvent( &event ); |
363 | } | 363 | } |
364 | 364 | ||
365 | 365 | ||
366 | void VideoWidget::backToNormal() { | 366 | void VideoWidget::backToNormal() { |
367 | mediaPlayerState->setFullscreen( FALSE ); | 367 | mediaPlayerState->setFullscreen( FALSE ); |
368 | makeVisible(); | 368 | makeVisible(); |
369 | } | 369 | } |
370 | 370 | ||
371 | void VideoWidget::makeVisible() { | 371 | void VideoWidget::makeVisible() { |
372 | if ( mediaPlayerState->fullscreen() ) { | 372 | if ( mediaPlayerState->fullscreen() ) { |
373 | setBackgroundMode( QWidget::NoBackground ); | 373 | setBackgroundMode( QWidget::NoBackground ); |
374 | showFullScreen(); | 374 | showFullScreen(); |
375 | resize( qApp->desktop()->size() ); | 375 | resize( qApp->desktop()->size() ); |
376 | slider->hide(); | 376 | slider->hide(); |
377 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 377 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
378 | 378 | ||
379 | } else { | 379 | } else { |
380 | showMaximized(); | 380 | showMaximized(); |
381 | setBackgroundPixmap( *pixBg ); | 381 | setBackgroundPixmap( *pixBg ); |
382 | if ( mediaPlayerState->streaming() ) { | 382 | if ( mediaPlayerState->streaming() ) { |
383 | slider->hide(); | 383 | slider->hide(); |
384 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | ||
385 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | ||
384 | } else { | 386 | } else { |
385 | slider->show(); | 387 | slider->show(); |
388 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | ||
389 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | ||
386 | } | 390 | } |
387 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); | 391 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); |
388 | qApp->processEvents(); | 392 | qApp->processEvents(); |
389 | } | 393 | } |
390 | } | 394 | } |
391 | 395 | ||
392 | 396 | ||
393 | void VideoWidget::paintEvent( QPaintEvent * pe) { | 397 | void VideoWidget::paintEvent( QPaintEvent * pe) { |
394 | QPainter p( this ); | 398 | QPainter p( this ); |
395 | 399 | ||
396 | if ( mediaPlayerState->fullscreen() ) { | 400 | if ( mediaPlayerState->fullscreen() ) { |
397 | // Clear the background | 401 | // Clear the background |
398 | p.setBrush( QBrush( Qt::black ) ); | 402 | p.setBrush( QBrush( Qt::black ) ); |
399 | } else { | 403 | } else { |
400 | if ( !pe->erased() ) { | 404 | if ( !pe->erased() ) { |
401 | // Combine with background and double buffer | 405 | // Combine with background and double buffer |
402 | QPixmap pix( pe->rect().size() ); | 406 | QPixmap pix( pe->rect().size() ); |
403 | QPainter p( &pix ); | 407 | QPainter p( &pix ); |
404 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 408 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
405 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); | 409 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); |
406 | for ( int i = 0; i < numVButtons; i++ ) { | 410 | for ( int i = 0; i < numVButtons; i++ ) { |
407 | paintButton( &p, i ); | 411 | paintButton( &p, i ); |
408 | } | 412 | } |
409 | QPainter p2( this ); | 413 | QPainter p2( this ); |
410 | p2.drawPixmap( pe->rect().topLeft(), pix ); | 414 | p2.drawPixmap( pe->rect().topLeft(), pix ); |
411 | } else { | 415 | } else { |
412 | QPainter p( this ); | 416 | QPainter p( this ); |
413 | for ( int i = 0; i < numVButtons; i++ ) | 417 | for ( int i = 0; i < numVButtons; i++ ) |
414 | paintButton( &p, i ); | 418 | paintButton( &p, i ); |
415 | } | 419 | } |
416 | slider->repaint( TRUE ); | 420 | slider->repaint( TRUE ); |
417 | } | 421 | } |
418 | } | 422 | } |
419 | 423 | ||
420 | 424 | ||
421 | void VideoWidget::closeEvent( QCloseEvent* ) { | 425 | void VideoWidget::closeEvent( QCloseEvent* ) { |
422 | mediaPlayerState->setList(); | 426 | mediaPlayerState->setList(); |
423 | } | 427 | } |
424 | 428 | ||
425 | 429 | ||
426 | 430 | ||
427 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) { | 431 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) { |
428 | switch ( e->key() ) { | 432 | switch ( e->key() ) { |
429 | ////////////////////////////// Zaurus keys | 433 | ////////////////////////////// Zaurus keys |
430 | case Key_Home: | 434 | case Key_Home: |
431 | break; | 435 | break; |
432 | case Key_F9: //activity | 436 | case Key_F9: //activity |
433 | break; | 437 | break; |
434 | case Key_F10: //contacts | 438 | case Key_F10: //contacts |
435 | // hide(); | 439 | // hide(); |
436 | break; | 440 | break; |
437 | case Key_F11: //menu | 441 | case Key_F11: //menu |
438 | break; | 442 | break; |
439 | case Key_F12: //home | 443 | case Key_F12: //home |
440 | break; | 444 | break; |
441 | case Key_F13: //mail | 445 | case Key_F13: //mail |
442 | break; | 446 | break; |
443 | case Key_Space: { | 447 | case Key_Space: { |
444 | if(mediaPlayerState->playing()) { | 448 | if(mediaPlayerState->playing()) { |
445 | mediaPlayerState->setPlaying(FALSE); | 449 | mediaPlayerState->setPlaying(FALSE); |
446 | } else { | 450 | } else { |
447 | mediaPlayerState->setPlaying(TRUE); | 451 | mediaPlayerState->setPlaying(TRUE); |
448 | } | 452 | } |
449 | } | 453 | } |