-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 6f3842f..ddb4d74 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -332,96 +332,97 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
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 | showNormal(); | ||
380 | showMaximized(); | 381 | showMaximized(); |
381 | setBackgroundPixmap( *pixBg ); | 382 | setBackgroundPixmap( *pixBg ); |
382 | if ( mediaPlayerState->streaming() ) { | 383 | if ( mediaPlayerState->streaming() ) { |
383 | slider->hide(); | 384 | slider->hide(); |
384 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 385 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
385 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 386 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
386 | } else { | 387 | } else { |
387 | slider->show(); | 388 | slider->show(); |
388 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 389 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
389 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 390 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
390 | } | 391 | } |
391 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); | 392 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); |
392 | qApp->processEvents(); | 393 | qApp->processEvents(); |
393 | } | 394 | } |
394 | } | 395 | } |
395 | 396 | ||
396 | 397 | ||
397 | void VideoWidget::paintEvent( QPaintEvent * pe) { | 398 | void VideoWidget::paintEvent( QPaintEvent * pe) { |
398 | QPainter p( this ); | 399 | QPainter p( this ); |
399 | 400 | ||
400 | if ( mediaPlayerState->fullscreen() ) { | 401 | if ( mediaPlayerState->fullscreen() ) { |
401 | // Clear the background | 402 | // Clear the background |
402 | p.setBrush( QBrush( Qt::black ) ); | 403 | p.setBrush( QBrush( Qt::black ) ); |
403 | } else { | 404 | } else { |
404 | if ( !pe->erased() ) { | 405 | if ( !pe->erased() ) { |
405 | // Combine with background and double buffer | 406 | // Combine with background and double buffer |
406 | QPixmap pix( pe->rect().size() ); | 407 | QPixmap pix( pe->rect().size() ); |
407 | QPainter p( &pix ); | 408 | QPainter p( &pix ); |
408 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 409 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
409 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); | 410 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); |
410 | for ( int i = 0; i < numVButtons; i++ ) { | 411 | for ( int i = 0; i < numVButtons; i++ ) { |
411 | paintButton( &p, i ); | 412 | paintButton( &p, i ); |
412 | } | 413 | } |
413 | QPainter p2( this ); | 414 | QPainter p2( this ); |
414 | p2.drawPixmap( pe->rect().topLeft(), pix ); | 415 | p2.drawPixmap( pe->rect().topLeft(), pix ); |
415 | } else { | 416 | } else { |
416 | QPainter p( this ); | 417 | QPainter p( this ); |
417 | for ( int i = 0; i < numVButtons; i++ ) | 418 | for ( int i = 0; i < numVButtons; i++ ) |
418 | paintButton( &p, i ); | 419 | paintButton( &p, i ); |
419 | } | 420 | } |
420 | slider->repaint( TRUE ); | 421 | slider->repaint( TRUE ); |
421 | } | 422 | } |
422 | } | 423 | } |
423 | 424 | ||
424 | 425 | ||
425 | void VideoWidget::closeEvent( QCloseEvent* ) { | 426 | void VideoWidget::closeEvent( QCloseEvent* ) { |
426 | mediaPlayerState->setList(); | 427 | mediaPlayerState->setList(); |
427 | } | 428 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 8fd2743..c03ea16 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -26,96 +26,97 @@ | |||
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 | 34 | ||
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qpe/qcopenvelope_qws.h> | 36 | #include <qpe/qcopenvelope_qws.h> |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #include "xinecontrol.h" | 38 | #include "xinecontrol.h" |
39 | #include "mediaplayerstate.h" | 39 | #include "mediaplayerstate.h" |
40 | #include "videowidget.h" | 40 | #include "videowidget.h" |
41 | 41 | ||
42 | extern MediaPlayerState *mediaPlayerState; | 42 | extern MediaPlayerState *mediaPlayerState; |
43 | extern VideoWidget *videoUI; | 43 | extern VideoWidget *videoUI; |
44 | XineControl::XineControl( QObject *parent, const char *name ) | 44 | XineControl::XineControl( QObject *parent, const char *name ) |
45 | : QObject( parent, name ) { | 45 | : QObject( parent, name ) { |
46 | libXine = new XINE::Lib(videoUI->vidWidget() ); | 46 | libXine = new XINE::Lib(videoUI->vidWidget() ); |
47 | 47 | ||
48 | connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ))); | 48 | connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ))); |
49 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 49 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
50 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); | 50 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); |
51 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 51 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
52 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 52 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
53 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | 53 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); |
54 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); | 54 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |
55 | 55 | ||
56 | disabledSuspendScreenSaver = FALSE; | 56 | disabledSuspendScreenSaver = FALSE; |
57 | } | 57 | } |
58 | 58 | ||
59 | XineControl::~XineControl() { | 59 | XineControl::~XineControl() { |
60 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 60 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
61 | if ( disabledSuspendScreenSaver ) { | 61 | if ( disabledSuspendScreenSaver ) { |
62 | disabledSuspendScreenSaver = FALSE; | 62 | disabledSuspendScreenSaver = FALSE; |
63 | // Re-enable the suspend mode | 63 | // Re-enable the suspend mode |
64 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 64 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
65 | } | 65 | } |
66 | #endif | 66 | #endif |
67 | delete libXine; | 67 | delete libXine; |
68 | } | 68 | } |
69 | 69 | ||
70 | void XineControl::play( const QString& fileName ) { | 70 | void XineControl::play( const QString& fileName ) { |
71 | hasVideoChannel=FALSE; | 71 | hasVideoChannel=FALSE; |
72 | hasAudioChannel=FALSE; | 72 | hasAudioChannel=FALSE; |
73 | m_fileName = fileName; | 73 | m_fileName = fileName; |
74 | qDebug("<<FILENAME: " + fileName + ">>>>"); | ||
74 | libXine->play( fileName ); | 75 | libXine->play( fileName ); |
75 | mediaPlayerState->setPlaying( true ); | 76 | mediaPlayerState->setPlaying( true ); |
76 | // default to audio view until we know how to handle video | 77 | // default to audio view until we know how to handle video |
77 | // MediaDetect mdetect; | 78 | // MediaDetect mdetect; |
78 | char whichGui = mdetect.videoOrAudio( fileName ); | 79 | char whichGui = mdetect.videoOrAudio( fileName ); |
79 | if (whichGui == 'f') { | 80 | if (whichGui == 'f') { |
80 | qDebug("Nicht erkannter Dateityp"); | 81 | qDebug("Nicht erkannter Dateityp"); |
81 | return; | 82 | return; |
82 | } | 83 | } |
83 | 84 | ||
84 | if (whichGui == 'a') { | 85 | if (whichGui == 'a') { |
85 | libXine->setShowVideo( false ); | 86 | libXine->setShowVideo( false ); |
86 | hasAudioChannel=TRUE; | 87 | hasAudioChannel=TRUE; |
87 | } else { | 88 | } else { |
88 | libXine->setShowVideo( true ); | 89 | libXine->setShowVideo( true ); |
89 | hasVideoChannel=TRUE; | 90 | hasVideoChannel=TRUE; |
90 | } | 91 | } |
91 | 92 | ||
92 | // determine if slider is shown | 93 | // determine if slider is shown |
93 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); | 94 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); |
94 | mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); | 95 | mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); |
95 | // which gui (video / audio) | 96 | // which gui (video / audio) |
96 | mediaPlayerState->setView( whichGui ); | 97 | mediaPlayerState->setView( whichGui ); |
97 | 98 | ||
98 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 99 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
99 | if ( !disabledSuspendScreenSaver ) { | 100 | if ( !disabledSuspendScreenSaver ) { |
100 | disabledSuspendScreenSaver = TRUE; | 101 | disabledSuspendScreenSaver = TRUE; |
101 | // Stop the screen from blanking and power saving state | 102 | // Stop the screen from blanking and power saving state |
102 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) | 103 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) |
103 | << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); | 104 | << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); |
104 | } | 105 | } |
105 | #endif | 106 | #endif |
106 | 107 | ||
107 | length(); | 108 | length(); |
108 | position(); | 109 | position(); |
109 | } | 110 | } |
110 | 111 | ||
111 | void XineControl::nextMedia() { | 112 | void XineControl::nextMedia() { |
112 | mediaPlayerState->setNext(); | 113 | mediaPlayerState->setNext(); |
113 | } | 114 | } |
114 | 115 | ||
115 | void XineControl::stop( bool isSet ) { | 116 | void XineControl::stop( bool isSet ) { |
116 | if ( !isSet) { | 117 | if ( !isSet) { |
117 | libXine->stop( ); | 118 | libXine->stop( ); |
118 | mediaPlayerState->setList(); | 119 | mediaPlayerState->setList(); |
119 | // mediaPlayerState->setPlaying( false ); | 120 | // mediaPlayerState->setPlaying( false ); |
120 | 121 | ||
121 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 122 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |