-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 9 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 33 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 11 |
5 files changed, 30 insertions, 28 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 092e5ce..9b276b5 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -61,3 +61,3 @@ public slots: void sliderReleased( ); - void setLooping( bool b) { setToggleButton( buttons[ Loop ], b ); } + void setLooping( bool b) { setToggleButton( Loop, b ); } void setPosition( long ); @@ -67,3 +67,3 @@ public: virtual void setLength( long ); - virtual void setPlaying( bool b) { setToggleButton( buttons[ Play ], b ); } + virtual void setPlaying( bool b) { setToggleButton( Play, b ); } virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 7891a7e..c0ebd63 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -117,2 +117,11 @@ void MediaWidget::paintButton( QPainter &p, const Button &button ) +void MediaWidget::setToggleButton( Command command, bool down ) +{ + for ( ButtonVector::iterator it = buttons.begin(); it != buttons.end(); ++it ) + if ( it->command == command ) { + setToggleButton( *it, down ); + return; + } +} + void MediaWidget::setToggleButton( Button &button, bool down ) diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 3bf01b6..caae0a7 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h @@ -94,2 +94,3 @@ protected: void setToggleButton( Button &button, bool down ); + void setToggleButton( Command command, bool down ); void toggleButton( Button &button ); diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 4867ef1..06f6cd2 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -114,3 +114,3 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye if ( !qRed( imgMask.pixel( x, y ) ) ) - line[x] = i + 1; + line[x] = button.command + 1; } @@ -249,2 +249,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { Button &button = buttons[ i ]; + Command command = button.command; @@ -252,3 +253,3 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { // The test to see if the mouse click is inside the button or not - bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); + bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command ); @@ -258,9 +259,10 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - switch (i) { - case VideoVolUp: + switch ( command ) { + case VolumeUp: emit moreClicked(); return; - case VideoVolDown: + case VolumeDown: emit lessClicked(); return; + default: break; } @@ -278,5 +280,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - switch(i) { + switch( command ) { - case VideoPlay: { + case Play: { if( mediaPlayerState.isPaused() ) { @@ -294,8 +296,9 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - case VideoStop: mediaPlayerState.setPlaying( FALSE ); return; - case VideoNext: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setNext(); return; - case VideoPrevious: if( playList.currentTab() == PlayListWidget::CurrentPlayList ) mediaPlayerState.setPrev(); return; - case VideoVolUp: emit moreReleased(); return; - case VideoVolDown: emit lessReleased(); return; - case VideoFullscreen: mediaPlayerState.setFullscreen( TRUE ); makeVisible(); 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; } @@ -429,3 +432,3 @@ XineVideoWidget* VideoWidget::vidWidget() { void VideoWidget::setFullscreen ( bool b ) { - setToggleButton( buttons[ VideoFullscreen ], b ); + setToggleButton( FullScreen, b ); } @@ -434,3 +437,3 @@ void VideoWidget::setFullscreen ( bool b ) { void VideoWidget::setPlaying( bool b) { - setToggleButton( buttons[ VideoPlay ], b ); + setToggleButton( Play, b ); } diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 915e9cc..c3bc131 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -46,13 +46,2 @@ class QSlider; -enum VideoButtons { - VideoPlay = 0, - VideoStop, -// VideoPause, - VideoNext, - VideoPrevious, - VideoVolUp, - VideoVolDown, - VideoFullscreen -}; - class VideoWidget : public MediaWidget { |