Diffstat (limited to 'noncore/multimedia/opieplayer2/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 9 |
1 files changed, 5 insertions, 4 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 | |||
@@ -180,27 +180,24 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
180 | slider.setMinValue( 0 ); | 180 | slider.setMinValue( 0 ); |
181 | slider.setMaxValue( 1 ); | 181 | slider.setMaxValue( 1 ); |
182 | slider.setFocusPolicy( QWidget::NoFocus ); | 182 | slider.setFocusPolicy( QWidget::NoFocus ); |
183 | slider.setBackgroundPixmap( *pixBg ); | 183 | slider.setBackgroundPixmap( *pixBg ); |
184 | 184 | ||
185 | time.setFocusPolicy( QWidget::NoFocus ); | 185 | time.setFocusPolicy( QWidget::NoFocus ); |
186 | time.setAlignment( Qt::AlignCenter ); | 186 | time.setAlignment( Qt::AlignCenter ); |
187 | time.setFrame(FALSE); | 187 | time.setFrame(FALSE); |
188 | changeTextColor( &time ); | 188 | changeTextColor( &time ); |
189 | 189 | ||
190 | resizeEvent( NULL ); | 190 | resizeEvent( NULL ); |
191 | 191 | ||
192 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | ||
193 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | ||
194 | |||
195 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 192 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
196 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 193 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
197 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 194 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
198 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 195 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
199 | connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); | 196 | connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) ); |
200 | 197 | ||
201 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 198 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
202 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 199 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
203 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); | 200 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); |
204 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); | 201 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); |
205 | 202 | ||
206 | // Intialise state | 203 | // Intialise state |
@@ -310,38 +307,42 @@ if ( view == 'a' ) { | |||
310 | // startTimer( 150 ); | 307 | // startTimer( 150 ); |
311 | showMaximized(); | 308 | showMaximized(); |
312 | } else { | 309 | } else { |
313 | killTimers(); | 310 | killTimers(); |
314 | hide(); | 311 | hide(); |
315 | } | 312 | } |
316 | // qApp->processEvents(); | 313 | // qApp->processEvents(); |
317 | } | 314 | } |
318 | 315 | ||
319 | 316 | ||
320 | void AudioWidget::setSeekable( bool isSeekable ) { | 317 | void AudioWidget::setSeekable( bool isSeekable ) { |
321 | 318 | ||
322 | if ( isSeekable ) { | 319 | if ( !isSeekable ) { |
323 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); | 320 | qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); |
324 | if( !slider.isHidden()) { | 321 | if( !slider.isHidden()) { |
325 | slider.hide(); | 322 | slider.hide(); |
326 | } | 323 | } |
327 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 324 | disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
328 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 325 | disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
326 | disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | ||
327 | disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | ||
329 | } else { | 328 | } else { |
330 | // this stops the slider from being moved, thus | 329 | // this stops the slider from being moved, thus |
331 | // does not stop stream when it reaches the end | 330 | // does not stop stream when it reaches the end |
332 | slider.show(); | 331 | slider.show(); |
333 | qDebug( " CONNECT SET POSTION " ); | 332 | qDebug( " CONNECT SET POSTION " ); |
334 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 333 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
335 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 334 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
335 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | ||
336 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | ||
336 | } | 337 | } |
337 | } | 338 | } |
338 | 339 | ||
339 | 340 | ||
340 | static QString timeAsString( long length ) { | 341 | static QString timeAsString( long length ) { |
341 | int minutes = length / 60; | 342 | int minutes = length / 60; |
342 | int seconds = length % 60; | 343 | int seconds = length % 60; |
343 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); | 344 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); |
344 | } | 345 | } |
345 | 346 | ||
346 | void AudioWidget::updateSlider( long i, long max ) { | 347 | void AudioWidget::updateSlider( long i, long max ) { |
347 | 348 | ||