author | llornkcor <llornkcor> | 2002-08-15 21:18:17 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-15 21:18:17 (UTC) |
commit | 78fead876601c4218eda97ec1da95b01a70155cd (patch) (unidiff) | |
tree | edf21f7d3df75c88470fa511db1a3065a6adb9bc | |
parent | 8b6d28983e62dd26acfeb9cf7408e21f68558a16 (diff) | |
download | opie-78fead876601c4218eda97ec1da95b01a70155cd.zip opie-78fead876601c4218eda97ec1da95b01a70155cd.tar.gz opie-78fead876601c4218eda97ec1da95b01a70155cd.tar.bz2 |
fix cruft
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 26 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 3 |
2 files changed, 14 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index cc6187c..132a911 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -185,31 +185,31 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
185 | resizeEvent( NULL ); | 185 | resizeEvent( NULL ); |
186 | 186 | ||
187 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 187 | connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
188 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 188 | connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
189 | 189 | ||
190 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 190 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
191 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 191 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
192 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 192 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
193 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 193 | // connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
194 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 194 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
195 | 195 | ||
196 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 196 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
197 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 197 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
198 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); | 198 | connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) ); |
199 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); | 199 | connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) ); |
200 | 200 | ||
201 | 201 | ||
202 | 202 | ||
203 | // Intialise state | 203 | // Intialise state |
204 | setLength( mediaPlayerState->length() ); | 204 | setLength( mediaPlayerState->length() ); |
205 | setPosition( mediaPlayerState->position() ); | 205 | setPosition( mediaPlayerState->position() ); |
206 | setLooping( mediaPlayerState->fullscreen() ); | 206 | setLooping( mediaPlayerState->fullscreen() ); |
207 | setPaused( mediaPlayerState->paused() ); | 207 | // setPaused( mediaPlayerState->paused() ); |
208 | setPlaying( mediaPlayerState->playing() ); | 208 | setPlaying( mediaPlayerState->playing() ); |
209 | 209 | ||
210 | } | 210 | } |
211 | 211 | ||
212 | AudioWidget::~AudioWidget() { | 212 | AudioWidget::~AudioWidget() { |
213 | 213 | ||
214 | for ( int i = 0; i < 10; i++ ) { | 214 | for ( int i = 0; i < 10; i++ ) { |
215 | delete buttonPixUp[i]; | 215 | delete buttonPixUp[i]; |
@@ -354,16 +354,17 @@ void AudioWidget::updateSlider( long i, long max ) { | |||
354 | if ( slider.maxValue() != width ) { | 354 | if ( slider.maxValue() != width ) { |
355 | slider.setMaxValue( width ); | 355 | slider.setMaxValue( width ); |
356 | } | 356 | } |
357 | } | 357 | } |
358 | } | 358 | } |
359 | 359 | ||
360 | 360 | ||
361 | void AudioWidget::setToggleButton( int i, bool down ) { | 361 | void AudioWidget::setToggleButton( int i, bool down ) { |
362 | qDebug("setToggleButton %d", i); | ||
362 | if ( down != audioButtons[i].isDown ) { | 363 | if ( down != audioButtons[i].isDown ) { |
363 | toggleButton( i ); | 364 | toggleButton( i ); |
364 | } | 365 | } |
365 | } | 366 | } |
366 | 367 | ||
367 | 368 | ||
368 | void AudioWidget::toggleButton( int i ) { | 369 | void AudioWidget::toggleButton( int i ) { |
369 | audioButtons[i].isDown = !audioButtons[i].isDown; | 370 | audioButtons[i].isDown = !audioButtons[i].isDown; |
@@ -418,50 +419,49 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
418 | 419 | ||
419 | bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() | 420 | bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() |
420 | && y < imgButtonMask->height() | 421 | && y < imgButtonMask->height() |
421 | && imgButtonMask->pixelIndex( x, y ) == i + 1 ); | 422 | && imgButtonMask->pixelIndex( x, y ) == i + 1 ); |
422 | 423 | ||
423 | if ( isOnButton && !audioButtons[i].isHeld ) { | 424 | if ( isOnButton && !audioButtons[i].isHeld ) { |
424 | audioButtons[i].isHeld = TRUE; | 425 | audioButtons[i].isHeld = TRUE; |
425 | toggleButton(i); | 426 | toggleButton(i); |
426 | |||
427 | switch (i) { | 427 | switch (i) { |
428 | case AudioVolumeUp: | 428 | case AudioVolumeUp: |
429 | emit moreClicked(); | 429 | emit moreClicked(); |
430 | return; | 430 | return; |
431 | case AudioVolumeDown: | 431 | case AudioVolumeDown: |
432 | emit lessClicked(); | 432 | emit lessClicked(); |
433 | return; | 433 | return; |
434 | case AudioForward: | 434 | case AudioForward: |
435 | emit forwardClicked(); | 435 | emit forwardClicked(); |
436 | return; | 436 | return; |
437 | case AudioBack: | 437 | case AudioBack: |
438 | emit backClicked(); | 438 | emit backClicked(); |
439 | return; | 439 | return; |
440 | } | 440 | } |
441 | } else if ( !isOnButton && audioButtons[i].isHeld ) { | ||
442 | audioButtons[i].isHeld = FALSE; | ||
443 | toggleButton(i); | ||
444 | } | 441 | } |
442 | else if ( !isOnButton && audioButtons[i].isHeld ) { | ||
443 | audioButtons[i].isHeld = FALSE; | ||
444 | toggleButton(i); | ||
445 | } | ||
445 | } else { | 446 | } else { |
446 | if ( audioButtons[i].isHeld ) { | 447 | if ( audioButtons[i].isHeld ) { |
447 | audioButtons[i].isHeld = FALSE; | 448 | audioButtons[i].isHeld = FALSE; |
448 | if ( !audioButtons[i].isToggle ) { | 449 | if ( !audioButtons[i].isToggle ) { |
449 | setToggleButton( i, FALSE ); | 450 | setToggleButton( i, FALSE ); |
450 | qDebug("button toggled3 %d",i); | ||
451 | } | 451 | } |
452 | switch (i) { | 452 | switch (i) { |
453 | case AudioPlay: | 453 | case AudioPlay: |
454 | if( mediaPlayerState->isPaused ) { | 454 | if( mediaPlayerState->isPaused ) { |
455 | setToggleButton( i, FALSE ); | 455 | // setToggleButton( i, FALSE ); |
456 | mediaPlayerState->setPaused( FALSE ); | 456 | mediaPlayerState->setPaused( FALSE ); |
457 | return; | 457 | return; |
458 | } else if( !mediaPlayerState->isPaused ) { | 458 | } else if( !mediaPlayerState->isPaused ) { |
459 | setToggleButton( i, TRUE ); | 459 | // setToggleButton( i, TRUE ); |
460 | mediaPlayerState->setPaused( TRUE ); | 460 | mediaPlayerState->setPaused( TRUE ); |
461 | return; | 461 | return; |
462 | } else { | 462 | } else { |
463 | // setToggleButton( i, TRUE ); | 463 | // setToggleButton( i, TRUE ); |
464 | // mediaPlayerState->setPlaying( videoButtons[i].isDown ); | 464 | // mediaPlayerState->setPlaying( videoButtons[i].isDown ); |
465 | } | 465 | } |
466 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; | 466 | case AudioStop: mediaPlayerState->setPlaying(FALSE); return; |
467 | case AudioNext: mediaPlayerState->setNext(); return; | 467 | case AudioNext: mediaPlayerState->setNext(); return; |
@@ -544,26 +544,26 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) | |||
544 | } else { | 544 | } else { |
545 | // toggleButton(0); | 545 | // toggleButton(0); |
546 | mediaPlayerState->setPlaying(TRUE); | 546 | mediaPlayerState->setPlaying(TRUE); |
547 | // toggleButton(0); | 547 | // toggleButton(0); |
548 | } | 548 | } |
549 | } | 549 | } |
550 | break; | 550 | break; |
551 | case Key_Down: | 551 | case Key_Down: |
552 | toggleButton(6); | 552 | // toggleButton(6); |
553 | emit lessClicked(); | 553 | emit lessClicked(); |
554 | emit lessReleased(); | 554 | emit lessReleased(); |
555 | toggleButton(6); | 555 | // toggleButton(6); |
556 | break; | 556 | break; |
557 | case Key_Up: | 557 | case Key_Up: |
558 | toggleButton(5); | 558 | // toggleButton(5); |
559 | emit moreClicked(); | 559 | emit moreClicked(); |
560 | emit moreReleased(); | 560 | emit moreReleased(); |
561 | toggleButton(5); | 561 | // toggleButton(5); |
562 | break; | 562 | break; |
563 | case Key_Right: | 563 | case Key_Right: |
564 | // toggleButton(3); | 564 | // toggleButton(3); |
565 | mediaPlayerState->setNext(); | 565 | mediaPlayerState->setNext(); |
566 | // toggleButton(3); | 566 | // toggleButton(3); |
567 | break; | 567 | break; |
568 | case Key_Left: | 568 | case Key_Left: |
569 | // toggleButton(4); | 569 | // toggleButton(4); |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 772d1d1..e7da6c5 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -44,17 +44,16 @@ | |||
44 | #include <qlineedit.h> | 44 | #include <qlineedit.h> |
45 | 45 | ||
46 | 46 | ||
47 | class QPixmap; | 47 | class QPixmap; |
48 | 48 | ||
49 | enum AudioButtons { | 49 | enum AudioButtons { |
50 | AudioPlay=0, | 50 | AudioPlay=0, |
51 | AudioStop, | 51 | AudioStop, |
52 | AudioPause, | ||
53 | AudioNext, | 52 | AudioNext, |
54 | AudioPrevious, | 53 | AudioPrevious, |
55 | AudioVolumeUp, | 54 | AudioVolumeUp, |
56 | AudioVolumeDown, | 55 | AudioVolumeDown, |
57 | AudioLoop, | 56 | AudioLoop, |
58 | AudioPlayList, | 57 | AudioPlayList, |
59 | AudioForward, | 58 | AudioForward, |
60 | AudioBack | 59 | AudioBack |
@@ -84,17 +83,17 @@ public: | |||
84 | AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 83 | AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
85 | ~AudioWidget(); | 84 | ~AudioWidget(); |
86 | void setTickerText( const QString &text ) { songInfo.setText( text ); } | 85 | void setTickerText( const QString &text ) { songInfo.setText( text ); } |
87 | bool isStreaming; | 86 | bool isStreaming; |
88 | public slots: | 87 | public slots: |
89 | void updateSlider( long, long ); | 88 | void updateSlider( long, long ); |
90 | void sliderPressed( ); | 89 | void sliderPressed( ); |
91 | void sliderReleased( ); | 90 | void sliderReleased( ); |
92 | void setPaused( bool b) { setToggleButton( AudioPause, b ); } | 91 | // void setPaused( bool b) { setToggleButton( AudioPause, b ); } |
93 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } | 92 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } |
94 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } | 93 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } |
95 | void setPosition( long ); | 94 | void setPosition( long ); |
96 | void setLength( long ); | 95 | void setLength( long ); |
97 | void setView( char ); | 96 | void setView( char ); |
98 | 97 | ||
99 | signals: | 98 | signals: |
100 | void moreClicked(); | 99 | void moreClicked(); |