Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 303834a..23f4329 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -248,13 +248,13 @@ void AudioWidget::sliderReleased() { | |||
248 | return; | 248 | return; |
249 | long val = long((double)slider.value() * mediaPlayerState->length() / slider.width()); | 249 | long val = long((double)slider.value() * mediaPlayerState->length() / slider.width()); |
250 | mediaPlayerState->setPosition( val ); | 250 | mediaPlayerState->setPosition( val ); |
251 | } | 251 | } |
252 | 252 | ||
253 | void AudioWidget::setPosition( long i ) { | 253 | void 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() ); |
256 | } | 256 | } |
257 | 257 | ||
258 | 258 | ||
259 | void AudioWidget::setLength( long max ) { | 259 | void AudioWidget::setLength( long max ) { |
260 | updateSlider( mediaPlayerState->position(), max ); | 260 | updateSlider( mediaPlayerState->position(), max ); |
@@ -287,22 +287,22 @@ void AudioWidget::setView( char view ) { | |||
287 | hide(); | 287 | hide(); |
288 | } | 288 | } |
289 | } | 289 | } |
290 | 290 | ||
291 | 291 | ||
292 | static QString timeAsString( long length ) { | 292 | static QString timeAsString( long length ) { |
293 | length /= 44100; | ||
294 | int minutes = length / 60; | 293 | int minutes = length / 60; |
295 | int seconds = length % 60; | 294 | int seconds = length % 60; |
296 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); | 295 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); |
297 | } | 296 | } |
298 | 297 | ||
299 | void AudioWidget::updateSlider( long i, long max ) { | 298 | void AudioWidget::updateSlider( long i, long max ) { |
300 | 299 | ||
301 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); | 300 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); |
302 | 301 | // qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ; | |
302 | |||
303 | if ( max == 0 ) { | 303 | if ( max == 0 ) { |
304 | return; | 304 | return; |
305 | } | 305 | } |
306 | // Will flicker too much if we don't do this | 306 | // Will flicker too much if we don't do this |
307 | // Scale to something reasonable | 307 | // Scale to something reasonable |
308 | int width = slider.width(); | 308 | int width = slider.width(); |