author | simon <simon> | 2002-12-09 16:39:32 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 16:39:32 (UTC) |
commit | 1bb6aa52f2db85f65f75278310c328218caeae65 (patch) (unidiff) | |
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 | |||
@@ -69,6 +69,10 @@ void MediaWidget::paintEvent( QPaintEvent *pe ) | |||
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | void MediaWidget::makeVisible() | ||
73 | { | ||
74 | } | ||
75 | |||
72 | void MediaWidget::handleCommand( Command command, bool buttonDown ) | 76 | void MediaWidget::handleCommand( Command command, bool buttonDown ) |
73 | { | 77 | { |
74 | switch ( command ) { | 78 | switch ( command ) { |
@@ -82,6 +86,7 @@ void MediaWidget::handleCommand( Command command, bool buttonDown ) | |||
82 | case PlayList: mediaPlayerState.setList(); return; | 86 | case PlayList: mediaPlayerState.setList(); return; |
83 | case Forward: emit forwardReleased(); return; | 87 | case Forward: emit forwardReleased(); return; |
84 | case Back: emit backReleased(); return; | 88 | case Back: emit backReleased(); return; |
89 | case FullScreen: mediaPlayerState.setFullscreen( true ); makeVisible(); return; | ||
85 | default: assert( false ); | 90 | default: assert( false ); |
86 | } | 91 | } |
87 | } | 92 | } |
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 | |||
@@ -83,6 +83,8 @@ protected: | |||
83 | 83 | ||
84 | virtual void paintEvent( QPaintEvent *pe ); | 84 | virtual void paintEvent( QPaintEvent *pe ); |
85 | 85 | ||
86 | virtual void makeVisible(); | ||
87 | |||
86 | void handleCommand( Command command, bool buttonDown ); | 88 | void handleCommand( Command command, bool buttonDown ); |
87 | 89 | ||
88 | bool isOverButton( const QPoint &position, int buttonId ) const; | 90 | bool isOverButton( const QPoint &position, int buttonId ) const; |
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 | |||
@@ -277,30 +277,7 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
277 | setToggleButton( button, FALSE ); | 277 | setToggleButton( button, FALSE ); |
278 | } | 278 | } |
279 | 279 | ||
280 | switch( command ) { | 280 | handleCommand( command, button.isDown ); |
281 | |||
282 | case Play: { | ||
283 | if( mediaPlayerState.isPaused() ) { | ||
284 | setToggleButton( button, FALSE ); | ||
285 | mediaPlayerState.setPaused( FALSE ); | ||
286 | return; | ||
287 | } else if( !mediaPlayerState.isPaused() ) { | ||
288 | setToggleButton( button, TRUE ); | ||
289 | mediaPlayerState.setPaused( TRUE ); | ||
290 | return; | ||
291 | } else { | ||
292 | return; | ||
293 | } | ||
294 | } | ||
295 | |||
296 | case Stop: mediaPlayerState.setPlaying( FALSE ); return; | ||
297 | case Next: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; | ||
298 | case Previous: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; | ||
299 | case VolumeUp: emit moreReleased(); return; | ||
300 | case VolumeDown: emit lessReleased(); return; | ||
301 | case FullScreen: mediaPlayerState.setFullscreen( TRUE ); makeVisible(); return; | ||
302 | default: break; | ||
303 | } | ||
304 | } | 281 | } |
305 | } | 282 | } |
306 | } | 283 | } |
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 | |||
@@ -57,7 +57,7 @@ public slots: | |||
57 | void sliderPressed( ); | 57 | void sliderPressed( ); |
58 | void sliderReleased( ); | 58 | void sliderReleased( ); |
59 | void setFullscreen( bool b ); | 59 | void setFullscreen( bool b ); |
60 | void makeVisible(); | 60 | virtual void makeVisible(); |
61 | void backToNormal(); | 61 | void backToNormal(); |
62 | void setPosition( long ); | 62 | void setPosition( long ); |
63 | 63 | ||
@@ -69,8 +69,6 @@ public: | |||
69 | signals: | 69 | signals: |
70 | void moreClicked(); | 70 | void moreClicked(); |
71 | void lessClicked(); | 71 | void lessClicked(); |
72 | void moreReleased(); | ||
73 | void lessReleased(); | ||
74 | void sliderMoved( long ); | 72 | void sliderMoved( long ); |
75 | void videoResized ( const QSize &s ); | 73 | void videoResized ( const QSize &s ); |
76 | 74 | ||