summaryrefslogtreecommitdiff
path: root/noncore
authorllornkcor <llornkcor>2002-08-03 11:26:12 (UTC)
committer llornkcor <llornkcor>2002-08-03 11:26:12 (UTC)
commit3b1ab71b7bfe42310661764e1089200290c7b817 (patch) (unidiff)
tree361ad970ec2f4c06bd7d9cc1a94b45040539f844 /noncore
parent7d4b246bc728b73e9d38e110619222dd89c1fd1c (diff)
downloadopie-3b1ab71b7bfe42310661764e1089200290c7b817.zip
opie-3b1ab71b7bfe42310661764e1089200290c7b817.tar.gz
opie-3b1ab71b7bfe42310661764e1089200290c7b817.tar.bz2
initial fx for time readout
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp23
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp22
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
@@ -100,3 +100,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
100 setCaption( tr("OpiePlayer") ); 100 setCaption( tr("OpiePlayer") );
101 101
102 Config cfg("OpiePlayer"); 102 Config cfg("OpiePlayer");
@@ -253,3 +253,3 @@ void AudioWidget::sliderReleased() {
253void AudioWidget::setPosition( long i ) { 253void AudioWidget::setPosition( long i ) {
254 // qDebug("set position %d",i); 254 qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i);
255 updateSlider( i, mediaPlayerState->length() ); 255 updateSlider( i, mediaPlayerState->length() );
@@ -264,7 +264,12 @@ void AudioWidget::setLength( long max ) {
264void AudioWidget::setView( char view ) { 264void AudioWidget::setView( char view ) {
265 if (mediaPlayerState->streaming() ) { 265 slider.show();
266 if( !slider.isHidden()) slider.hide(); 266
267 disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 267// this isnt working for some reason
268 disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 268
269 } else { 269// if ( mediaPlayerState->streaming() ) {
270// qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>");
271// if( !slider.isHidden()) slider.hide();
272// disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
273// disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
274// } else {
270 // this stops the slider from being moved, thus 275 // this stops the slider from being moved, thus
@@ -274,3 +279,3 @@ void AudioWidget::setView( char view ) {
274 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 279 connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
275 } 280// }
276 281
@@ -294,3 +299,5 @@ static QString timeAsString( long length ) {
294void AudioWidget::updateSlider( long i, long max ) { 299void AudioWidget::updateSlider( long i, long max ) {
300
295 time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); 301 time.setText( timeAsString( i ) + " / " + timeAsString( max ) );
302
296 if ( max == 0 ) { 303 if ( max == 0 ) {
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
@@ -73,6 +73,24 @@ void MediaPlayer::setPlaying( bool play ) {
73 } 73 }
74
75 xineControl->play( currentFile->file() );
74 76
75 audioUI->setTickerText( currentFile->file( ) ); 77 xineControl->length();
78 long seconds = mediaPlayerState->length();//
79 QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
80 qDebug(time);
76 81
77 xineControl->play( currentFile->file() ); 82 QString tickerText;
83 if( currentFile->file().left(4) == "http" )
84 tickerText= tr( " File: " ) + currentFile->name();
85 else
86 tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time;
87
88// QString fileInfo = mediaPlayerState->curDecoder()->fileInfo();
89
90// if ( !fileInfo.isEmpty() )
91// tickerText += ", " + fileInfo;
92// audioUI->setTickerText( tickerText + "." );
93
94 audioUI->setTickerText( currentFile->file( ) );
95
78} 96}