Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
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 @@ -109,13 +109,13 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye QImage imgMask = button.mask.convertToImage(); uchar **dest = buttonMask.jumpTable(); for ( int y = 0; y < imgUp.height(); y++ ) { uchar *line = dest[y]; for ( int x = 0; x < imgUp.width(); x++ ) if ( !qRed( imgMask.pixel( x, y ) ) ) - line[x] = i + 1; + line[x] = button.command + 1; } } buttons.push_back( button ); } @@ -244,28 +244,30 @@ void VideoWidget::updateSlider( long i, long max ) { } void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { for ( unsigned int i = 0; i < buttons.size(); i++ ) { Button &button = buttons[ i ]; + Command command = button.command; if ( event->state() == QMouseEvent::LeftButton ) { // 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 ); if ( isOnButton && !button.isHeld ) { button.isHeld = TRUE; toggleButton( button ); - switch (i) { - case VideoVolUp: + switch ( command ) { + case VolumeUp: emit moreClicked(); return; - case VideoVolDown: + case VolumeDown: emit lessClicked(); return; + default: break; } } else if ( !isOnButton && button.isHeld ) { button.isHeld = FALSE; toggleButton( button ); } } else { @@ -273,15 +275,15 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { if ( button.isHeld ) { button.isHeld = FALSE; if ( button.type != ToggleButton ) { setToggleButton( button, FALSE ); } - switch(i) { + switch( command ) { - case VideoPlay: { + case Play: { if( mediaPlayerState.isPaused() ) { setToggleButton( button, FALSE ); mediaPlayerState.setPaused( FALSE ); return; } else if( !mediaPlayerState.isPaused() ) { setToggleButton( button, TRUE ); @@ -289,18 +291,19 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { return; } else { return; } } - 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; } } } } } @@ -424,14 +427,14 @@ void VideoWidget::keyReleaseEvent( QKeyEvent *e) { XineVideoWidget* VideoWidget::vidWidget() { return videoFrame; } void VideoWidget::setFullscreen ( bool b ) { - setToggleButton( buttons[ VideoFullscreen ], b ); + setToggleButton( FullScreen, b ); } void VideoWidget::setPlaying( bool b) { - setToggleButton( buttons[ VideoPlay ], b ); + setToggleButton( Play, b ); } |