author | llornkcor <llornkcor> | 2002-08-14 00:04:55 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-14 00:04:55 (UTC) |
commit | 29ffa9119abaf753b165c5c241b22938eeaef301 (patch) (unidiff) | |
tree | 89ae13f40e3939dcccb711bbb0a225b857db0a30 | |
parent | 05a272a0dc03c37f143546aa5cde228bd3ba79bb (diff) | |
download | opie-29ffa9119abaf753b165c5c241b22938eeaef301.zip opie-29ffa9119abaf753b165c5c241b22938eeaef301.tar.gz opie-29ffa9119abaf753b165c5c241b22938eeaef301.tar.bz2 |
fullscreen working
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 33153d4..b4e69b5 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -124,49 +124,49 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | |||
124 | setBackgroundPixmap( *pixBg ); | 124 | setBackgroundPixmap( *pixBg ); |
125 | 125 | ||
126 | slider = new QSlider( Qt::Horizontal, this ); | 126 | slider = new QSlider( Qt::Horizontal, this ); |
127 | slider->setMinValue( 0 ); | 127 | slider->setMinValue( 0 ); |
128 | slider->setMaxValue( 1 ); | 128 | slider->setMaxValue( 1 ); |
129 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | 129 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
130 | slider->setFocusPolicy( QWidget::NoFocus ); | 130 | slider->setFocusPolicy( QWidget::NoFocus ); |
131 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); | 131 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); |
132 | 132 | ||
133 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 133 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
134 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 134 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
135 | 135 | ||
136 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 136 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
137 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 137 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
138 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 138 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
139 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 139 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
140 | 140 | ||
141 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 141 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
142 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 142 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
143 | 143 | ||
144 | setLength( mediaPlayerState->length() ); | 144 | setLength( mediaPlayerState->length() ); |
145 | setPosition( mediaPlayerState->position() ); | 145 | setPosition( mediaPlayerState->position() ); |
146 | 146 | ||
147 | ////////////////////////// FIXME | 147 | ////////////////////////// FIXME |
148 | // setFullscreen( mediaPlayerState->fullscreen() ); | 148 | setFullscreen( mediaPlayerState->fullscreen() ); |
149 | setPaused( mediaPlayerState->paused() ); | 149 | setPaused( mediaPlayerState->paused() ); |
150 | setPlaying( mediaPlayerState->playing() ); | 150 | setPlaying( mediaPlayerState->playing() ); |
151 | qDebug("finished videowidget"); | 151 | qDebug("finished videowidget"); |
152 | } | 152 | } |
153 | 153 | ||
154 | 154 | ||
155 | VideoWidget::~VideoWidget() { | 155 | VideoWidget::~VideoWidget() { |
156 | mediaPlayerState->setPlaying( FALSE ); | 156 | mediaPlayerState->setPlaying( FALSE ); |
157 | for ( int i = 0; i < 7; i++ ) { | 157 | for ( int i = 0; i < 7; i++ ) { |
158 | delete buttonPixUp[i]; | 158 | delete buttonPixUp[i]; |
159 | delete buttonPixDown[i]; | 159 | delete buttonPixDown[i]; |
160 | } | 160 | } |
161 | 161 | ||
162 | delete pixBg; | 162 | delete pixBg; |
163 | delete imgUp; | 163 | delete imgUp; |
164 | delete imgDn; | 164 | delete imgDn; |
165 | delete imgButtonMask; | 165 | delete imgButtonMask; |
166 | for ( int i = 0; i < 7; i++ ) { | 166 | for ( int i = 0; i < 7; i++ ) { |
167 | delete masks[i]; | 167 | delete masks[i]; |
168 | } | 168 | } |
169 | 169 | ||
170 | } | 170 | } |
171 | 171 | ||
172 | QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 172 | QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
@@ -375,48 +375,49 @@ void VideoWidget::mousePressEvent( QMouseEvent *event ) { | |||
375 | } | 375 | } |
376 | 376 | ||
377 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { | 377 | void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { |
378 | if ( mediaPlayerState->fullscreen() ) { | 378 | if ( mediaPlayerState->fullscreen() ) { |
379 | mediaPlayerState->setFullscreen( FALSE ); | 379 | mediaPlayerState->setFullscreen( FALSE ); |
380 | makeVisible(); | 380 | makeVisible(); |
381 | 381 | ||
382 | mouseMoveEvent( event ); | 382 | mouseMoveEvent( event ); |
383 | } | 383 | } |
384 | } | 384 | } |
385 | 385 | ||
386 | 386 | ||
387 | void VideoWidget::makeVisible() { | 387 | void VideoWidget::makeVisible() { |
388 | if ( mediaPlayerState->fullscreen() ) { | 388 | if ( mediaPlayerState->fullscreen() ) { |
389 | setBackgroundMode( QWidget::NoBackground ); | 389 | setBackgroundMode( QWidget::NoBackground ); |
390 | showFullScreen(); | 390 | showFullScreen(); |
391 | resize( qApp->desktop()->size() ); | 391 | resize( qApp->desktop()->size() ); |
392 | slider->hide(); | 392 | slider->hide(); |
393 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 393 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
394 | } else { | 394 | } else { |
395 | showNormal(); | 395 | showNormal(); |
396 | showMaximized(); | 396 | showMaximized(); |
397 | slider->show(); | 397 | slider->show(); |
398 | videoFrame->setGeometry( QRect( 10, 20, 220, 160 ) ); | 398 | videoFrame->setGeometry( QRect( 10, 20, 220, 160 ) ); |
399 | qApp->processEvents(); | ||
399 | } | 400 | } |
400 | } | 401 | } |
401 | 402 | ||
402 | 403 | ||
403 | void VideoWidget::paintEvent( QPaintEvent * pe) { | 404 | void VideoWidget::paintEvent( QPaintEvent * pe) { |
404 | QPainter p( this ); | 405 | QPainter p( this ); |
405 | 406 | ||
406 | if ( mediaPlayerState->fullscreen() ) { | 407 | if ( mediaPlayerState->fullscreen() ) { |
407 | // Clear the background | 408 | // Clear the background |
408 | p.setBrush( QBrush( Qt::black ) ); | 409 | p.setBrush( QBrush( Qt::black ) ); |
409 | // videoFrame->setGeometry( QRect( 0, 0 , 240 ,320 ) ); | 410 | // videoFrame->setGeometry( QRect( 0, 0 , 240 ,320 ) ); |
410 | 411 | ||
411 | } else { | 412 | } else { |
412 | 413 | ||
413 | // videoFrame->setGeometry( QRect( 0, 15 , 240 ,170 ) ); | 414 | // videoFrame->setGeometry( QRect( 0, 15 , 240 ,170 ) ); |
414 | // draw the buttons | 415 | // draw the buttons |
415 | 416 | ||
416 | if ( !pe->erased() ) { | 417 | if ( !pe->erased() ) { |
417 | // Combine with background and double buffer | 418 | // Combine with background and double buffer |
418 | QPixmap pix( pe->rect().size() ); | 419 | QPixmap pix( pe->rect().size() ); |
419 | QPainter p( &pix ); | 420 | QPainter p( &pix ); |
420 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 421 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
421 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); | 422 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); |
422 | for ( int i = 0; i < numVButtons; i++ ) | 423 | for ( int i = 0; i < numVButtons; i++ ) |