author | harlekin <harlekin> | 2002-11-10 15:46:12 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-11-10 15:46:12 (UTC) |
commit | ee6938139a5f8f24da901ab5a41930a98af00d44 (patch) (unidiff) | |
tree | dc9c2d23efc1e9fe600206d8c10d1c0c567208b6 /noncore/multimedia/opieplayer2/videowidget.cpp | |
parent | b0b173498acde27957f8ed9297bb2ed2346eb700 (diff) | |
download | opie-ee6938139a5f8f24da901ab5a41930a98af00d44.zip opie-ee6938139a5f8f24da901ab5a41930a98af00d44.tar.gz opie-ee6938139a5f8f24da901ab5a41930a98af00d44.tar.bz2 |
better seek slider code for videowidget too
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 7d71d09..a847605 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -135,17 +135,16 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | |||
135 | slider->setMaxValue( 1 ); | 135 | slider->setMaxValue( 1 ); |
136 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | 136 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
137 | //slider->setFocusPolicy( QWidget::NoFocus ); | 137 | //slider->setFocusPolicy( QWidget::NoFocus ); |
138 | 138 | ||
139 | resizeEvent( NULL ); | 139 | resizeEvent( NULL ); |
140 | 140 | ||
141 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | ||
142 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | ||
143 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 141 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
144 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 142 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
145 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 143 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
144 | connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); | ||
146 | 145 | ||
147 | setLength( mediaPlayerState->length() ); | 146 | setLength( mediaPlayerState->length() ); |
148 | setPosition( mediaPlayerState->position() ); | 147 | setPosition( mediaPlayerState->position() ); |
149 | setFullscreen( mediaPlayerState->fullscreen() ); | 148 | setFullscreen( mediaPlayerState->fullscreen() ); |
150 | setPlaying( mediaPlayerState->playing() ); | 149 | setPlaying( mediaPlayerState->playing() ); |
151 | } | 150 | } |
@@ -385,32 +384,43 @@ void VideoWidget::makeVisible() { | |||
385 | slider->hide(); | 384 | slider->hide(); |
386 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); | 385 | videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); |
387 | } else { | 386 | } else { |
388 | showNormal(); | 387 | showNormal(); |
389 | showMaximized(); | 388 | showMaximized(); |
390 | setBackgroundPixmap( *pixBg ); | 389 | setBackgroundPixmap( *pixBg ); |
391 | if ( mediaPlayerState->seekable() ) { | ||
392 | slider->hide(); | ||
393 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | ||
394 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | ||
395 | } else { | ||
396 | slider->show(); | ||
397 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | ||
398 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | ||
399 | } | ||
400 | QWidget *d = QApplication::desktop(); | 390 | QWidget *d = QApplication::desktop(); |
401 | int w = d->width(); | 391 | int w = d->width(); |
402 | int h = d->height(); | 392 | int h = d->height(); |
403 | 393 | ||
404 | if(w>h) { | 394 | if(w>h) { |
405 | int newW=(w/2)-(246/2); //this will only work with 320x240 | 395 | int newW=(w/2)-(246/2); //this will only work with 320x240 |
406 | videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); | 396 | videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); |
407 | } else | 397 | } else { |
408 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); | 398 | videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); |
399 | } | ||
400 | } | ||
401 | } | ||
402 | |||
403 | |||
404 | void VideoWidget::setSeekable( bool isSeekable ) { | ||
409 | 405 | ||
410 | // qApp->processEvents(); | 406 | if ( !isSeekable || mediaPlayerState->fullscreen() ) { |
407 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); | ||
408 | if( !slider->isHidden()) { | ||
409 | slider->hide(); | ||
410 | } | ||
411 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | ||
412 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | ||
413 | disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | ||
414 | disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | ||
415 | } else { | ||
416 | slider->show(); | ||
417 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | ||
418 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | ||
419 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | ||
420 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | ||
411 | } | 421 | } |
412 | } | 422 | } |
413 | 423 | ||
414 | 424 | ||
415 | void VideoWidget::paintEvent( QPaintEvent * pe) { | 425 | void VideoWidget::paintEvent( QPaintEvent * pe) { |
416 | QPainter p( this ); | 426 | QPainter p( this ); |