Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 6e2e03e..7838229 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -67,32 +67,32 @@ const char * const skinV_mask_file_names[7] = { VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ) { setCaption( tr("OpiePlayer - Video") ); Button defaultButton; defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false; Button toggleButton; toggleButton.isToggle = true; toggleButton.isHeld = toggleButton.isDown = false; - videoButtons.reserve( 7 ); - videoButtons.push_back( defaultButton ); // stop - videoButtons.push_back( toggleButton ); // play - videoButtons.push_back( defaultButton ); // previous - videoButtons.push_back( defaultButton ); // next - videoButtons.push_back( defaultButton ); // volUp - videoButtons.push_back( defaultButton ); // volDown - videoButtons.push_back( toggleButton ); //fullscreen + buttons.reserve( 7 ); + buttons.push_back( defaultButton ); // stop + buttons.push_back( toggleButton ); // play + buttons.push_back( defaultButton ); // previous + buttons.push_back( defaultButton ); // next + buttons.push_back( defaultButton ); // volUp + buttons.push_back( defaultButton ); // volDown + buttons.push_back( toggleButton ); //fullscreen videoFrame = new XineVideoWidget ( this, "Video frame" ); connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); connect ( videoFrame, SIGNAL( clicked () ), this, SLOT ( backToNormal() ) ); Config cfg("OpiePlayer"); cfg.setGroup("Options"); skin = cfg.readEntry("Skin","default"); QString skinPath = "opieplayer2/skins/" + skin; pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); @@ -249,76 +249,76 @@ void VideoWidget::updateSlider( long i, long max ) { int val = int((double)i * width / max); if ( !mediaPlayerState.isFullscreen() && !videoSliderBeingMoved ) { if ( slider->value() != val ) { slider->setValue( val ); } if ( slider->maxValue() != width ) { slider->setMaxValue( width ); } } } void VideoWidget::setToggleButton( int i, bool down ) { - if ( down != videoButtons[i].isDown ) { + if ( down != buttons[i].isDown ) { toggleButton( i ); } } void VideoWidget::toggleButton( int i ) { - videoButtons[i].isDown = !videoButtons[i].isDown; + buttons[i].isDown = !buttons[i].isDown; QPainter p(this); paintButton ( &p, i ); } void VideoWidget::paintButton( QPainter *p, int i ) { - if ( videoButtons[i].isDown ) { + if ( buttons[i].isDown ) { p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); } else { p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); } } void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { - for ( unsigned int i = 0; i < videoButtons.size(); i++ ) { + for ( unsigned int i = 0; i < buttons.size(); i++ ) { if ( event->state() == QMouseEvent::LeftButton ) { // The test to see if the mouse click is inside the button or not int x = event->pos().x() - xoff; int y = event->pos().y() - yoff; bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask.width() && y < imgButtonMask.height() && imgButtonMask.pixelIndex( x, y ) == i + 1 ); - if ( isOnButton && !videoButtons[i].isHeld ) { - videoButtons[i].isHeld = TRUE; + if ( isOnButton && !buttons[i].isHeld ) { + buttons[i].isHeld = TRUE; toggleButton(i); switch (i) { case VideoVolUp: emit moreClicked(); return; case VideoVolDown: emit lessClicked(); return; } - } else if ( !isOnButton && videoButtons[i].isHeld ) { - videoButtons[i].isHeld = FALSE; + } else if ( !isOnButton && buttons[i].isHeld ) { + buttons[i].isHeld = FALSE; toggleButton(i); } } else { - if ( videoButtons[i].isHeld ) { - videoButtons[i].isHeld = FALSE; - if ( !videoButtons[i].isToggle ) { + if ( buttons[i].isHeld ) { + buttons[i].isHeld = FALSE; + if ( !buttons[i].isToggle ) { setToggleButton( i, FALSE ); } switch(i) { case VideoPlay: { if( mediaPlayerState.isPaused() ) { setToggleButton( i, FALSE ); mediaPlayerState.setPaused( FALSE ); return; } else if( !mediaPlayerState.isPaused() ) { setToggleButton( i, TRUE ); @@ -417,32 +417,32 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { QPainter p( this ); if ( mediaPlayerState.isFullscreen() ) { // Clear the background p.setBrush( QBrush( Qt::black ) ); } else { if ( !pe->erased() ) { // Combine with background and double buffer QPixmap pix( pe->rect().size() ); QPainter p( &pix ); p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); - for ( unsigned int i = 0; i < videoButtons.size(); i++ ) { + for ( unsigned int i = 0; i < buttons.size(); i++ ) { paintButton( &p, i ); } QPainter p2( this ); p2.drawPixmap( pe->rect().topLeft(), pix ); } else { QPainter p( this ); - for ( unsigned int i = 0; i < videoButtons.size(); i++ ) + for ( unsigned int i = 0; i < buttons.size(); i++ ) paintButton( &p, i ); } //slider->repaint( TRUE ); } } void VideoWidget::keyReleaseEvent( QKeyEvent *e) { switch ( e->key() ) { ////////////////////////////// Zaurus keys case Key_Home: break; |