summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp13
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h1
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.cpp10
-rw-r--r--noncore/multimedia/opieplayer2/xinevideowidget.h1
5 files changed, 19 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 93819f2..22afe19 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -68,13 +68,13 @@ void MediaPlayer::play() {
68 mediaPlayerState->setPlaying( FALSE ); 68 mediaPlayerState->setPlaying( FALSE );
69 mediaPlayerState->setPlaying( TRUE ); 69 mediaPlayerState->setPlaying( TRUE );
70} 70}
71 71
72void MediaPlayer::setPlaying( bool play ) { 72void MediaPlayer::setPlaying( bool play ) {
73 if ( !play ) { 73 if ( !play ) {
74 //mediaPlayerState->setPaused( TRUE ); 74 // mediaPlayerState->setPaused( FALSE );
75 return; 75 return;
76 } 76 }
77 77
78 if ( mediaPlayerState->paused() ) { 78 if ( mediaPlayerState->paused() ) {
79 mediaPlayerState->setPaused( FALSE ); 79 mediaPlayerState->setPaused( FALSE );
80 return; 80 return;
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 238770b..c2080e6 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -81,13 +81,15 @@ static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton));
81 81
82VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : 82VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
83QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { 83QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
84 setCaption( tr("OpiePlayer - Video") ); 84 setCaption( tr("OpiePlayer - Video") );
85 85
86 videoFrame = new XineVideoWidget ( this, "Video frame" ); 86 videoFrame = new XineVideoWidget ( this, "Video frame" );
87
87 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); 88 connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & )));
89 connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) );
88 90
89 Config cfg("OpiePlayer"); 91 Config cfg("OpiePlayer");
90 cfg.setGroup("Options"); 92 cfg.setGroup("Options");
91 skin = cfg.readEntry("Skin","default"); 93 skin = cfg.readEntry("Skin","default");
92 94
93 QString skinPath = "opieplayer2/skins/" + skin; 95 QString skinPath = "opieplayer2/skins/" + skin;
@@ -340,14 +342,13 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
340 return; 342 return;
341 } else if( !mediaPlayerState->isPaused ) { 343 } else if( !mediaPlayerState->isPaused ) {
342 setToggleButton( i, TRUE ); 344 setToggleButton( i, TRUE );
343 mediaPlayerState->setPaused( TRUE ); 345 mediaPlayerState->setPaused( TRUE );
344 return; 346 return;
345 } else { 347 } else {
346 // setToggleButton( i, TRUE ); 348 return;
347 // mediaPlayerState->setPlaying( videoButtons[i].isDown );
348 } 349 }
349 } 350 }
350 351
351 case VideoStop: mediaPlayerState->setPlaying( FALSE ); return; 352 case VideoStop: mediaPlayerState->setPlaying( FALSE ); return;
352 case VideoNext: mediaPlayerState->setNext(); return; 353 case VideoNext: mediaPlayerState->setNext(); return;
353 case VideoPrevious: mediaPlayerState->setPrev(); return; 354 case VideoPrevious: mediaPlayerState->setPrev(); return;
@@ -375,24 +376,30 @@ void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) {
375void VideoWidget::showEvent( QShowEvent* ) { 376void VideoWidget::showEvent( QShowEvent* ) {
376 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); 377 QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 );
377 mouseMoveEvent( &event ); 378 mouseMoveEvent( &event );
378} 379}
379 380
380 381
382 void VideoWidget::backToNormal() {
383 mediaPlayerState->setFullscreen( FALSE );
384 makeVisible();
385 }
386
381void VideoWidget::makeVisible() { 387void VideoWidget::makeVisible() {
382 if ( mediaPlayerState->fullscreen() ) { 388 if ( mediaPlayerState->fullscreen() ) {
383 setBackgroundMode( QWidget::NoBackground ); 389 setBackgroundMode( QWidget::NoBackground );
384 showFullScreen(); 390 showFullScreen();
385 resize( qApp->desktop()->size() ); 391 resize( qApp->desktop()->size() );
386 slider->hide(); 392 slider->hide();
387 videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); 393 videoFrame-> setGeometry ( 0, 0, width ( ), height ( ));
394
388 } else { 395 } else {
389 showNormal(); 396 showNormal();
390 showMaximized(); 397 showMaximized();
391 slider->show(); 398 slider->show();
392 videoFrame->setGeometry( QRect( 10, 20, 220, 160 ) ); 399 videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) );
393 qApp->processEvents(); 400 qApp->processEvents();
394 } 401 }
395} 402}
396 403
397 404
398void VideoWidget::paintEvent( QPaintEvent * pe) { 405void VideoWidget::paintEvent( QPaintEvent * pe) {
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h
index b35558b..990fa5f 100644
--- a/noncore/multimedia/opieplayer2/videowidget.h
+++ b/noncore/multimedia/opieplayer2/videowidget.h
@@ -63,12 +63,13 @@ public slots:
63 void updateSlider( long, long ); 63 void updateSlider( long, long );
64 void sliderPressed( ); 64 void sliderPressed( );
65 void sliderReleased( ); 65 void sliderReleased( );
66 void setPlaying( bool b); 66 void setPlaying( bool b);
67 void setFullscreen( bool b ); 67 void setFullscreen( bool b );
68 void makeVisible(); 68 void makeVisible();
69 void backToNormal();
69 void setPosition( long ); 70 void setPosition( long );
70 void setLength( long ); 71 void setLength( long );
71 void setView( char ); 72 void setView( char );
72 73
73signals: 74signals:
74 void moreClicked(); 75 void moreClicked();
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
index d65006b..3e28e54 100644
--- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp
+++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp
@@ -246,23 +246,25 @@ void XineVideoWidget::resizeEvent ( QResizeEvent * )
246 246
247void XineVideoWidget::mousePressEvent ( QMouseEvent *me ) 247void XineVideoWidget::mousePressEvent ( QMouseEvent *me )
248{ 248{
249 QWidget *p = parentWidget ( ); 249 QWidget *p = parentWidget ( );
250 250
251 if ( p ) { 251 if ( p ) {
252 QMouseEvent pme ( QEvent::MouseButtonPress, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); 252 // QMouseEvent pme ( QEvent::MouseButtonPress, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( ));
253 253
254 QApplication::sendEvent ( p, &pme ); 254 // QApplication::sendEvent ( p, &pme );
255 // emit clicked();
255 } 256 }
256} 257}
257 258
258void XineVideoWidget::mouseReleaseEvent ( QMouseEvent *me ) 259void XineVideoWidget::mouseReleaseEvent ( QMouseEvent *me )
259{ 260{
260 QWidget *p = parentWidget ( ); 261 QWidget *p = parentWidget ( );
261 262
262 if ( p ) { 263 if ( p ) {
263 QMouseEvent pme ( QEvent::MouseButtonRelease, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); 264 // QMouseEvent pme ( QEvent::MouseButtonRelease, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( ));
264 265
265 QApplication::sendEvent ( p, &pme ); 266 // QApplication::sendEvent ( p, &pme );
267 emit clicked();
266 } 268 }
267} 269}
268 270
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.h b/noncore/multimedia/opieplayer2/xinevideowidget.h
index 2fc627d..c5101da 100644
--- a/noncore/multimedia/opieplayer2/xinevideowidget.h
+++ b/noncore/multimedia/opieplayer2/xinevideowidget.h
@@ -53,12 +53,13 @@ protected:
53 void resizeEvent ( QResizeEvent *r ); 53 void resizeEvent ( QResizeEvent *r );
54 54
55 void mousePressEvent ( QMouseEvent *e ); 55 void mousePressEvent ( QMouseEvent *e );
56 void mouseReleaseEvent ( QMouseEvent *e ); 56 void mouseReleaseEvent ( QMouseEvent *e );
57 57
58signals: 58signals:
59 void clicked();
59 void videoResized ( const QSize &s ); 60 void videoResized ( const QSize &s );
60 61
61private: 62private:
62 QRect m_lastframe; 63 QRect m_lastframe;
63 QRect m_thisframe; 64 QRect m_thisframe;
64 65