summaryrefslogtreecommitdiff
path: root/noncore/multimedia
authorsimon <simon>2002-12-09 16:39:32 (UTC)
committer simon <simon>2002-12-09 16:39:32 (UTC)
commit1bb6aa52f2db85f65f75278310c328218caeae65 (patch) (side-by-side diff)
tree1983547bac0da80bde93554038a57713feb715c1 /noncore/multimedia
parent1ae041fba55e218a2523de441bec6ec3a1eecf02 (diff)
downloadopie-1bb6aa52f2db85f65f75278310c328218caeae65.zip
opie-1bb6aa52f2db85f65f75278310c328218caeae65.tar.gz
opie-1bb6aa52f2db85f65f75278310c328218caeae65.tar.bz2
- removing duplicated code in VideoWidget
Diffstat (limited to 'noncore/multimedia') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.cpp5
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp25
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.h4
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 )
}
}
+void MediaWidget::makeVisible()
+{
+}
+
void MediaWidget::handleCommand( Command command, bool buttonDown )
{
switch ( command ) {
@@ -82,6 +86,7 @@ void MediaWidget::handleCommand( Command command, bool buttonDown )
case PlayList: mediaPlayerState.setList(); return;
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
@@ -83,6 +83,8 @@ protected:
virtual void paintEvent( QPaintEvent *pe );
+ virtual void makeVisible();
+
void handleCommand( Command command, bool buttonDown );
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 ) {
setToggleButton( button, FALSE );
}
- 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
@@ -57,7 +57,7 @@ public slots:
void sliderPressed( );
void sliderReleased( );
void setFullscreen( bool b );
- void makeVisible();
+ virtual void makeVisible();
void backToNormal();
void setPosition( long );
@@ -69,8 +69,6 @@ public:
signals:
void moreClicked();
void lessClicked();
- void moreReleased();
- void lessReleased();
void sliderMoved( long );
void videoResized ( const QSize &s );