author | harlekin <harlekin> | 2002-11-10 15:09:09 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-11-10 15:09:09 (UTC) |
commit | 91932ca42cee5568477b1e49532a0b9e4d9bcf96 (patch) (unidiff) | |
tree | f134612cf7aa15787077b0a76c34aab30d72cae3 /noncore/multimedia/opieplayer2/audiowidget.cpp | |
parent | b6b57412a12c06d07f22060b7a165d71e5eddb84 (diff) | |
download | opie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.zip opie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.tar.gz opie-91932ca42cee5568477b1e49532a0b9e4d9bcf96.tar.bz2 |
besser seekable handling
Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index a6fd334..00d516c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -192,22 +192,20 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
192 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 192 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
193 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 193 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
194 | 194 | ||
195 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 195 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
196 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 196 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
197 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 197 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
198 | // connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | ||
199 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 198 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
199 | connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); | ||
200 | 200 | ||
201 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 201 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
202 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 202 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
203 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); | 203 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); |
204 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); | 204 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); |
205 | 205 | ||
206 | |||
207 | |||
208 | // Intialise state | 206 | // Intialise state |
209 | setLength( mediaPlayerState->length() ); | 207 | setLength( mediaPlayerState->length() ); |
210 | setPosition( mediaPlayerState->position() ); | 208 | setPosition( mediaPlayerState->position() ); |
211 | setLooping( mediaPlayerState->fullscreen() ); | 209 | setLooping( mediaPlayerState->fullscreen() ); |
212 | // setPaused( mediaPlayerState->paused() ); | 210 | // setPaused( mediaPlayerState->paused() ); |
213 | setPlaying( mediaPlayerState->playing() ); | 211 | setPlaying( mediaPlayerState->playing() ); |
@@ -305,37 +303,40 @@ void AudioWidget::setLength( long max ) { | |||
305 | updateSlider( mediaPlayerState->position(), max ); | 303 | updateSlider( mediaPlayerState->position(), max ); |
306 | } | 304 | } |
307 | 305 | ||
308 | 306 | ||
309 | void AudioWidget::setView( char view ) { | 307 | void AudioWidget::setView( char view ) { |
310 | 308 | ||
311 | // this isnt working for some reason | 309 | if ( view == 'a' ) { |
310 | // startTimer( 150 ); | ||
311 | showMaximized(); | ||
312 | } else { | ||
313 | killTimers(); | ||
314 | hide(); | ||
315 | } | ||
316 | // qApp->processEvents(); | ||
317 | } | ||
318 | |||
319 | |||
320 | void AudioWidget::setSeekable( bool isSeekable ) { | ||
312 | 321 | ||
313 | if ( mediaPlayerState->streaming() ) { | 322 | if ( isSeekable ) { |
314 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); | 323 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); |
315 | if( !slider.isHidden()) { | 324 | if( !slider.isHidden()) { |
316 | slider.hide(); | 325 | slider.hide(); |
317 | } | 326 | } |
318 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 327 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
319 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 328 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
320 | } else { | 329 | } else { |
321 | // this stops the slider from being moved, thus | 330 | // this stops the slider from being moved, thus |
322 | // does not stop stream when it reaches the end | 331 | // does not stop stream when it reaches the end |
323 | slider.show(); | 332 | slider.show(); |
333 | qDebug( " CONNECT SET POSTION " ); | ||
324 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 334 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
325 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 335 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
326 | } | 336 | } |
327 | |||
328 | if ( view == 'a' ) { | ||
329 | // startTimer( 150 ); | ||
330 | showMaximized(); | ||
331 | } else { | ||
332 | killTimers(); | ||
333 | hide(); | ||
334 | } | ||
335 | // qApp->processEvents(); | ||
336 | } | 337 | } |
337 | 338 | ||
338 | 339 | ||
339 | static QString timeAsString( long length ) { | 340 | static QString timeAsString( long length ) { |
340 | int minutes = length / 60; | 341 | int minutes = length / 60; |
341 | int seconds = length % 60; | 342 | int seconds = length % 60; |