author | llornkcor <llornkcor> | 2002-08-15 19:20:49 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-15 19:20:49 (UTC) |
commit | f568b83e0ef16a0e3b46d41b2cfaa5fdda9d1d45 (patch) (unidiff) | |
tree | b813e08e89f295b36ffe5ac7981a07e163063090 | |
parent | c28cefd69ab4f1edb66248ae2651dafc6f7e2fcc (diff) | |
download | opie-f568b83e0ef16a0e3b46d41b2cfaa5fdda9d1d45.zip opie-f568b83e0ef16a0e3b46d41b2cfaa5fdda9d1d45.tar.gz opie-f568b83e0ef16a0e3b46d41b2cfaa5fdda9d1d45.tar.bz2 |
new mask size/position. still needs non static
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 8fe572f..238770b 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -96,17 +96,17 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | |||
96 | imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); | 96 | imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); |
97 | 97 | ||
98 | imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); | 98 | imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); |
99 | imgButtonMask->fill( 0 ); | 99 | imgButtonMask->fill( 0 ); |
100 | 100 | ||
101 | for ( int i = 0; i < 7; i++ ) { | 101 | for ( int i = 0; i < 7; i++ ) { |
102 | QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png"; | 102 | QString filename = QString(getenv("OPIEDIR")) + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png"; |
103 | masks[i] = new QBitmap( filename ); | 103 | masks[i] = new QBitmap( filename ); |
104 | qDebug(filename); | 104 | |
105 | if ( !masks[i]->isNull() ) { | 105 | if ( !masks[i]->isNull() ) { |
106 | QImage imgMask = masks[i]->convertToImage(); | 106 | QImage imgMask = masks[i]->convertToImage(); |
107 | uchar **dest = imgButtonMask->jumpTable(); | 107 | uchar **dest = imgButtonMask->jumpTable(); |
108 | for ( int y = 0; y < imgUp->height(); y++ ) { | 108 | for ( int y = 0; y < imgUp->height(); y++ ) { |
109 | uchar *line = dest[y]; | 109 | uchar *line = dest[y]; |
110 | for ( int x = 0; x < imgUp->width(); x++ ) { | 110 | for ( int x = 0; x < imgUp->width(); x++ ) { |
111 | if ( !qRed( imgMask.pixel( x, y ) ) ) | 111 | if ( !qRed( imgMask.pixel( x, y ) ) ) |
112 | line[x] = i + 1; | 112 | line[x] = i + 1; |
@@ -174,32 +174,28 @@ QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) { | |||
174 | pixmap->setMask( mask ); | 174 | pixmap->setMask( mask ); |
175 | return pixmap; | 175 | return pixmap; |
176 | } | 176 | } |
177 | 177 | ||
178 | void VideoWidget::resizeEvent( QResizeEvent * ) { | 178 | void VideoWidget::resizeEvent( QResizeEvent * ) { |
179 | int h = height(); | 179 | int h = height(); |
180 | int w = width(); | 180 | int w = width(); |
181 | int Vh = 160; | 181 | int Vh = 160; |
182 | //videoFrame->height(); | ||
183 | int Vw = 220; | 182 | int Vw = 220; |
184 | //videoFrame->width(); | ||
185 | |||
186 | 183 | ||
187 | slider->setFixedWidth( w - 20 ); | 184 | slider->setFixedWidth( w - 20 ); |
188 | slider->setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); | 185 | slider->setGeometry( QRect( 15, h - 30, w - 90, 20 ) ); |
189 | slider->setBackgroundOrigin( QWidget::ParentOrigin ); | 186 | slider->setBackgroundOrigin( QWidget::ParentOrigin ); |
190 | slider->setFocusPolicy( QWidget::NoFocus ); | 187 | slider->setFocusPolicy( QWidget::NoFocus ); |
191 | slider->setBackgroundPixmap( *pixBg ); | 188 | slider->setBackgroundPixmap( *pixBg ); |
192 | 189 | ||
193 | xoff = 0;// ( imgUp->width() ) / 2; | 190 | xoff = 0;// ( imgUp->width() ) / 2; |
194 | yoff = 180;//(( Vh - imgUp->height() ) / 2) - 10; | 191 | yoff = 185;//(( Vh - imgUp->height() ) / 2) - 10; |
195 | QPoint p( xoff, yoff ); | 192 | QPoint p( xoff, yoff ); |
196 | 193 | ||
197 | |||
198 | QPixmap *pixUp = combineVImageWithBackground( *imgUp, *pixBg, p ); | 194 | QPixmap *pixUp = combineVImageWithBackground( *imgUp, *pixBg, p ); |
199 | QPixmap *pixDn = combineVImageWithBackground( *imgDn, *pixBg, p ); | 195 | QPixmap *pixDn = combineVImageWithBackground( *imgDn, *pixBg, p ); |
200 | 196 | ||
201 | for ( int i = 0; i < 7; i++ ) { | 197 | for ( int i = 0; i < 7; i++ ) { |
202 | if ( !masks[i]->isNull() ) { | 198 | if ( !masks[i]->isNull() ) { |
203 | delete buttonPixUp[i]; | 199 | delete buttonPixUp[i]; |
204 | delete buttonPixDown[i]; | 200 | delete buttonPixDown[i]; |
205 | buttonPixUp[i] = maskVPixToMask( *pixUp, *masks[i] ); | 201 | buttonPixUp[i] = maskVPixToMask( *pixUp, *masks[i] ); |
@@ -454,24 +450,24 @@ void VideoWidget::keyReleaseEvent( QKeyEvent *e) { | |||
454 | mediaPlayerState->setPlaying(FALSE); | 450 | mediaPlayerState->setPlaying(FALSE); |
455 | } else { | 451 | } else { |
456 | mediaPlayerState->setPlaying(TRUE); | 452 | mediaPlayerState->setPlaying(TRUE); |
457 | } | 453 | } |
458 | } | 454 | } |
459 | break; | 455 | break; |
460 | case Key_Down: | 456 | case Key_Down: |
461 | // toggleButton(6); | 457 | // toggleButton(6); |
462 | // emit lessClicked(); | 458 | emit lessClicked(); |
463 | // emit lessReleased(); | 459 | emit lessReleased(); |
464 | // toggleButton(6); | 460 | // toggleButton(6); |
465 | break; | 461 | break; |
466 | case Key_Up: | 462 | case Key_Up: |
467 | // toggleButton(5); | 463 | // toggleButton(5); |
468 | // emit moreClicked(); | 464 | emit moreClicked(); |
469 | // emit moreReleased(); | 465 | emit moreReleased(); |
470 | // toggleButton(5); | 466 | // toggleButton(5); |
471 | break; | 467 | break; |
472 | case Key_Right: | 468 | case Key_Right: |
473 | mediaPlayerState->setNext(); | 469 | mediaPlayerState->setNext(); |
474 | break; | 470 | break; |
475 | case Key_Left: | 471 | case Key_Left: |
476 | mediaPlayerState->setPrev(); | 472 | mediaPlayerState->setPrev(); |
477 | break; | 473 | break; |