author | llornkcor <llornkcor> | 2002-08-03 11:26:12 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-03 11:26:12 (UTC) |
commit | 3b1ab71b7bfe42310661764e1089200290c7b817 (patch) (side-by-side diff) | |
tree | 361ad970ec2f4c06bd7d9cc1a94b45040539f844 | |
parent | 7d4b246bc728b73e9d38e110619222dd89c1fd1c (diff) | |
download | opie-3b1ab71b7bfe42310661764e1089200290c7b817.zip opie-3b1ab71b7bfe42310661764e1089200290c7b817.tar.gz opie-3b1ab71b7bfe42310661764e1089200290c7b817.tar.bz2 |
initial fx for time readout
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 23 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 22 |
2 files changed, 35 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 300a5c8..303834a 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -99,5 +99,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { setCaption( tr("OpiePlayer") ); - + Config cfg("OpiePlayer"); cfg.setGroup("AudioWidget"); @@ -252,5 +252,5 @@ void AudioWidget::sliderReleased() { void AudioWidget::setPosition( long i ) { - // qDebug("set position %d",i); + qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); updateSlider( i, mediaPlayerState->length() ); } @@ -263,9 +263,14 @@ void AudioWidget::setLength( long max ) { void AudioWidget::setView( char view ) { - if (mediaPlayerState->streaming() ) { - if( !slider.isHidden()) slider.hide(); - disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); - disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); - } else { + slider.show(); + +// this isnt working for some reason + +// if ( mediaPlayerState->streaming() ) { +// 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) ) ); +// } else { // this stops the slider from being moved, thus // does not stop stream when it reaches the end @@ -273,5 +278,5 @@ void AudioWidget::setView( char view ) { connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); - } +// } if ( view == 'a' ) { @@ -293,5 +298,7 @@ static QString timeAsString( long length ) { void AudioWidget::updateSlider( long i, long max ) { + time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); + if ( max == 0 ) { return; diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 13cc4ed..5411a64 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -72,8 +72,26 @@ void MediaPlayer::setPlaying( bool play ) { currentFile = playListCurrent; } + + xineControl->play( currentFile->file() ); - audioUI->setTickerText( currentFile->file( ) ); + xineControl->length(); + long seconds = mediaPlayerState->length();// + QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); + qDebug(time); - xineControl->play( currentFile->file() ); + QString tickerText; + if( currentFile->file().left(4) == "http" ) + tickerText= tr( " File: " ) + currentFile->name(); + else + tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; + +// QString fileInfo = mediaPlayerState->curDecoder()->fileInfo(); + +// if ( !fileInfo.isEmpty() ) +// tickerText += ", " + fileInfo; +// audioUI->setTickerText( tickerText + "." ); + + audioUI->setTickerText( currentFile->file( ) ); + } |