-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 9 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 36 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 2 |
5 files changed, 30 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 00d516c..de91a59 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -184,19 +184,16 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : time.setFocusPolicy( QWidget::NoFocus ); time.setAlignment( Qt::AlignCenter ); time.setFrame(FALSE); changeTextColor( &time ); resizeEvent( NULL ); - connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); - connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); - connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); @@ -314,30 +311,34 @@ if ( view == 'a' ) { hide(); } // qApp->processEvents(); } void AudioWidget::setSeekable( bool isSeekable ) { - if ( isSeekable ) { + if ( !isSeekable ) { qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); if( !slider.isHidden()) { slider.hide(); } disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); + disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); + disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); } else { // this stops the slider from being moved, thus // does not stop stream when it reaches the end slider.show(); qDebug( " CONNECT SET POSTION " ); connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); + connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); + connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); } } static QString timeAsString( long length ) { int minutes = length / 60; int seconds = length % 60; return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 09dc19b..bcd941e 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -84,17 +84,16 @@ class AudioWidget : public QWidget { public: AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); ~AudioWidget(); void setTickerText( const QString &text ) { songInfo.setText( text ); } public slots: void updateSlider( long, long ); void sliderPressed( ); void sliderReleased( ); -// void setPaused( bool b) { setToggleButton( AudioPause, b ); } void setLooping( bool b) { setToggleButton( AudioLoop, b ); } void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } void setPosition( long ); void setLength( long ); void setSeekable( bool ); void setView( char ); signals: 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 @@ -133,21 +133,20 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { slider = new QSlider( Qt::Horizontal, this ); slider->setMinValue( 0 ); slider->setMaxValue( 1 ); slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); //slider->setFocusPolicy( QWidget::NoFocus ); resizeEvent( NULL ); - connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); - connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); + connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); setLength( mediaPlayerState->length() ); setPosition( mediaPlayerState->position() ); setFullscreen( mediaPlayerState->fullscreen() ); setPlaying( mediaPlayerState->playing() ); } @@ -383,36 +382,47 @@ void VideoWidget::makeVisible() { showFullScreen(); resize( qApp->desktop()->size() ); slider->hide(); videoFrame-> setGeometry ( 0, 0, width ( ), height ( )); } else { showNormal(); showMaximized(); setBackgroundPixmap( *pixBg ); - if ( mediaPlayerState->seekable() ) { - slider->hide(); - disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); - disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); - } else { - slider->show(); - connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); - connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); - } QWidget *d = QApplication::desktop(); int w = d->width(); int h = d->height(); if(w>h) { int newW=(w/2)-(246/2); //this will only work with 320x240 videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) ); - } else + } else { videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) ); + } + } +} + + +void VideoWidget::setSeekable( bool isSeekable ) { -// qApp->processEvents(); + if ( !isSeekable || mediaPlayerState->fullscreen() ) { + qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); + if( !slider->isHidden()) { + slider->hide(); + } + disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); + disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); + disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); + disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); + } else { + slider->show(); + connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); + connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); + connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); + connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); } } void VideoWidget::paintEvent( QPaintEvent * pe) { QPainter p( this ); if ( mediaPlayerState->fullscreen() ) { diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 990fa5f..fd02805 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -64,16 +64,17 @@ public slots: void sliderPressed( ); void sliderReleased( ); void setPlaying( bool b); void setFullscreen( bool b ); void makeVisible(); void backToNormal(); void setPosition( long ); void setLength( long ); + void setSeekable( bool ); void setView( char ); signals: void moreClicked(); void lessClicked(); void moreReleased(); void lessReleased(); void sliderMoved( long ); diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 65ac127..c46994a 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -94,17 +94,17 @@ void XineControl::play( const QString& fileName ) { hasAudioChannel = TRUE; } else { whichGui = 'v'; qDebug("HAS VIDEO"); libXine->setShowVideo( true ); hasVideoChannel = TRUE; } // determine if slider is shown - mediaPlayerState->setIsSeekable( !libXine->isSeekable() ); + mediaPlayerState->setIsSeekable( libXine->isSeekable() ); // which gui (video / audio) mediaPlayerState->setView( whichGui ); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) if ( !disabledSuspendScreenSaver ) { disabledSuspendScreenSaver = TRUE; // Stop the screen from blanking and power saving state |