-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index a4e6b6e..9b88299 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -148,97 +148,97 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { setPaused( mediaPlayerState->paused() ); setPlaying( mediaPlayerState->playing() ); qDebug("finished videowidget"); } VideoWidget::~VideoWidget() { for ( int i = 0; i < 7; i++ ) { delete buttonPixUp[i]; delete buttonPixDown[i]; } delete pixBg; delete imgUp; delete imgDn; delete imgButtonMask; for ( int i = 0; i < 7; i++ ) { delete masks[i]; } } QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { QPixmap pix( img.width(), img.height() ); QPainter p( &pix ); p.drawTiledPixmap( pix.rect(), bg, offset ); p.drawImage( 0, 0, img ); return new QPixmap( pix ); } QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) { QPixmap *pixmap = new QPixmap( pix ); pixmap->setMask( mask ); return pixmap; } void VideoWidget::resizeEvent( QResizeEvent * ) { int h = height(); int w = width(); int Vh = 160; //videoFrame->height(); int Vw = 220; //videoFrame->width(); // songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) ); slider->setFixedWidth( w - 110 ); slider->setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); slider->setBackgroundOrigin( QWidget::ParentOrigin ); slider->setFocusPolicy( QWidget::NoFocus ); -make slider->setBackgroundPixmap( *pixBg ); + slider->setBackgroundPixmap( *pixBg ); // time.setGeometry( QRect( w - 85, h - 30, 70, 20 ) ); xoff = 0;// ( imgUp->width() ) / 2; yoff = 180;//(( Vh - imgUp->height() ) / 2) - 10; QPoint p( xoff, yoff ); QPixmap *pixUp = combineVImageWithBackground( *imgUp, *pixBg, p ); QPixmap *pixDn = combineVImageWithBackground( *imgDn, *pixBg, p ); for ( int i = 0; i < 7; i++ ) { if ( !masks[i]->isNull() ) { delete buttonPixUp[i]; delete buttonPixDown[i]; buttonPixUp[i] = maskVPixToMask( *pixUp, *masks[i] ); buttonPixDown[i] = maskVPixToMask( *pixDn, *masks[i] ); } } delete pixUp; delete pixDn; } static bool videoSliderBeingMoved = FALSE; void VideoWidget::sliderPressed() { videoSliderBeingMoved = TRUE; } void VideoWidget::sliderReleased() { videoSliderBeingMoved = FALSE; if ( slider->width() == 0 ) { return; } long val = long((double)slider->value() * mediaPlayerState->length() / slider->width()); mediaPlayerState->setPosition( val ); } void VideoWidget::setPosition( long i ) { updateSlider( i, mediaPlayerState->length() ); } void VideoWidget::setLength( long max ) { updateSlider( mediaPlayerState->position(), max ); } void VideoWidget::setView( char view ) { |