author | simon <simon> | 2002-12-09 16:39:32 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 16:39:32 (UTC) |
commit | 1bb6aa52f2db85f65f75278310c328218caeae65 (patch) (side-by-side diff) | |
tree | 1983547bac0da80bde93554038a57713feb715c1 | |
parent | 1ae041fba55e218a2523de441bec6ec3a1eecf02 (diff) | |
download | opie-1bb6aa52f2db85f65f75278310c328218caeae65.zip opie-1bb6aa52f2db85f65f75278310c328218caeae65.tar.gz opie-1bb6aa52f2db85f65f75278310c328218caeae65.tar.bz2 |
- removing duplicated code in VideoWidget
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 25 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 4 |
4 files changed, 9 insertions, 27 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index c0ebd63..7eb75e6 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -70,4 +70,8 @@ void MediaWidget::paintEvent( QPaintEvent *pe ) } +void MediaWidget::makeVisible() +{ +} + void MediaWidget::handleCommand( Command command, bool buttonDown ) { @@ -83,4 +87,5 @@ void MediaWidget::handleCommand( Command command, bool buttonDown ) case Forward: emit forwardReleased(); return; case Back: emit backReleased(); return; + case FullScreen: mediaPlayerState.setFullscreen( true ); makeVisible(); return; default: assert( false ); } diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index caae0a7..3f4c45d 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -84,4 +84,6 @@ protected: virtual void paintEvent( QPaintEvent *pe ); + virtual void makeVisible(); + void handleCommand( Command command, bool buttonDown ); diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 12316f8..cc586cc 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -278,28 +278,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { } - switch( command ) { - - case Play: { - if( mediaPlayerState.isPaused() ) { - setToggleButton( button, FALSE ); - mediaPlayerState.setPaused( FALSE ); - return; - } else if( !mediaPlayerState.isPaused() ) { - setToggleButton( button, TRUE ); - mediaPlayerState.setPaused( TRUE ); - return; - } else { - return; - } - } - - case Stop: mediaPlayerState.setPlaying( FALSE ); return; - case Next: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; - case Previous: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; - case VolumeUp: emit moreReleased(); return; - case VolumeDown: emit lessReleased(); return; - case FullScreen: mediaPlayerState.setFullscreen( TRUE ); makeVisible(); return; - default: break; - } + handleCommand( command, button.isDown ); } } diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index c3bc131..ef88186 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -58,5 +58,5 @@ public slots: void sliderReleased( ); void setFullscreen( bool b ); - void makeVisible(); + virtual void makeVisible(); void backToNormal(); void setPosition( long ); @@ -70,6 +70,4 @@ signals: void moreClicked(); void lessClicked(); - void moreReleased(); - void lessReleased(); void sliderMoved( long ); void videoResized ( const QSize &s ); |