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 | |||
@@ -161,79 +161,79 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
161 | 161 | ||
162 | } | 162 | } |
163 | 163 | ||
164 | for ( int i = 0; i < 10; i++ ) { | 164 | for ( int i = 0; i < 10; i++ ) { |
165 | buttonPixUp[i] = NULL; | 165 | buttonPixUp[i] = NULL; |
166 | buttonPixDown[i] = NULL; | 166 | buttonPixDown[i] = NULL; |
167 | } | 167 | } |
168 | 168 | ||
169 | setBackgroundPixmap( *pixBg ); | 169 | setBackgroundPixmap( *pixBg ); |
170 | 170 | ||
171 | songInfo.setFocusPolicy( QWidget::NoFocus ); | 171 | songInfo.setFocusPolicy( QWidget::NoFocus ); |
172 | changeTextColor( &songInfo ); | 172 | changeTextColor( &songInfo ); |
173 | 173 | ||
174 | slider.setFixedHeight( 20 ); | 174 | slider.setFixedHeight( 20 ); |
175 | slider.setMinValue( 0 ); | 175 | slider.setMinValue( 0 ); |
176 | slider.setMaxValue( 1 ); | 176 | slider.setMaxValue( 1 ); |
177 | slider.setFocusPolicy( QWidget::NoFocus ); | 177 | slider.setFocusPolicy( QWidget::NoFocus ); |
178 | slider.setBackgroundPixmap( *pixBg ); | 178 | slider.setBackgroundPixmap( *pixBg ); |
179 | 179 | ||
180 | time.setFocusPolicy( QWidget::NoFocus ); | 180 | time.setFocusPolicy( QWidget::NoFocus ); |
181 | time.setAlignment( Qt::AlignCenter ); | 181 | time.setAlignment( Qt::AlignCenter ); |
182 | time.setFrame(FALSE); | 182 | time.setFrame(FALSE); |
183 | changeTextColor( &time ); | 183 | changeTextColor( &time ); |
184 | 184 | ||
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]; |
216 | delete buttonPixDown[i]; | 216 | delete buttonPixDown[i]; |
217 | } | 217 | } |
218 | delete pixBg; | 218 | delete pixBg; |
219 | delete imgUp; | 219 | delete imgUp; |
220 | delete imgDn; | 220 | delete imgDn; |
221 | delete imgButtonMask; | 221 | delete imgButtonMask; |
222 | for ( int i = 0; i < 10; i++ ) { | 222 | for ( int i = 0; i < 10; i++ ) { |
223 | delete masks[i]; | 223 | delete masks[i]; |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 227 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
228 | QPixmap pix( img.width(), img.height() ); | 228 | QPixmap pix( img.width(), img.height() ); |
229 | QPainter p( &pix ); | 229 | QPainter p( &pix ); |
230 | p.drawTiledPixmap( pix.rect(), bg, offset ); | 230 | p.drawTiledPixmap( pix.rect(), bg, offset ); |
231 | p.drawImage( 0, 0, img ); | 231 | p.drawImage( 0, 0, img ); |
232 | return new QPixmap( pix ); | 232 | return new QPixmap( pix ); |
233 | } | 233 | } |
234 | 234 | ||
235 | 235 | ||
236 | QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) | 236 | QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) |
237 | { | 237 | { |
238 | QPixmap *pixmap = new QPixmap( pix ); | 238 | QPixmap *pixmap = new QPixmap( pix ); |
239 | pixmap->setMask( mask ); | 239 | pixmap->setMask( mask ); |
@@ -330,162 +330,162 @@ void AudioWidget::setView( char view ) { | |||
330 | 330 | ||
331 | static QString timeAsString( long length ) { | 331 | static QString timeAsString( long length ) { |
332 | int minutes = length / 60; | 332 | int minutes = length / 60; |
333 | int seconds = length % 60; | 333 | int seconds = length % 60; |
334 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); | 334 | return QString("%1:%2%3").arg( minutes ).arg( seconds / 10 ).arg( seconds % 10 ); |
335 | } | 335 | } |
336 | 336 | ||
337 | void AudioWidget::updateSlider( long i, long max ) { | 337 | void AudioWidget::updateSlider( long i, long max ) { |
338 | 338 | ||
339 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); | 339 | time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); |
340 | // qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ; | 340 | // qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ; |
341 | 341 | ||
342 | if ( max == 0 ) { | 342 | if ( max == 0 ) { |
343 | return; | 343 | return; |
344 | } | 344 | } |
345 | // Will flicker too much if we don't do this | 345 | // Will flicker too much if we don't do this |
346 | // Scale to something reasonable | 346 | // Scale to something reasonable |
347 | int width = slider.width(); | 347 | int width = slider.width(); |
348 | int val = int((double)i * width / max); | 348 | int val = int((double)i * width / max); |
349 | if ( !audioSliderBeingMoved ) { | 349 | if ( !audioSliderBeingMoved ) { |
350 | if ( slider.value() != val ) { | 350 | if ( slider.value() != val ) { |
351 | slider.setValue( val ); | 351 | slider.setValue( val ); |
352 | } | 352 | } |
353 | 353 | ||
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; |
370 | QPainter p(this); | 371 | QPainter p(this); |
371 | paintButton ( &p, i ); | 372 | paintButton ( &p, i ); |
372 | } | 373 | } |
373 | 374 | ||
374 | 375 | ||
375 | void AudioWidget::paintButton( QPainter *p, int i ) { | 376 | void AudioWidget::paintButton( QPainter *p, int i ) { |
376 | if ( audioButtons[i].isDown ) { | 377 | if ( audioButtons[i].isDown ) { |
377 | p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); | 378 | p->drawPixmap( xoff, yoff, *buttonPixDown[i] ); |
378 | } else { | 379 | } else { |
379 | p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); | 380 | p->drawPixmap( xoff, yoff, *buttonPixUp[i] ); |
380 | } | 381 | } |
381 | } | 382 | } |
382 | 383 | ||
383 | 384 | ||
384 | void AudioWidget::skipFor() { | 385 | void AudioWidget::skipFor() { |
385 | skipDirection = +1; | 386 | skipDirection = +1; |
386 | startTimer( 50 ); | 387 | startTimer( 50 ); |
387 | mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); | 388 | mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); |
388 | } | 389 | } |
389 | 390 | ||
390 | void AudioWidget::skipBack() { | 391 | void AudioWidget::skipBack() { |
391 | skipDirection = -1; | 392 | skipDirection = -1; |
392 | startTimer( 50 ); | 393 | startTimer( 50 ); |
393 | mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); | 394 | mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); |
394 | } | 395 | } |
395 | 396 | ||
396 | 397 | ||
397 | 398 | ||
398 | void AudioWidget::stopSkip() { | 399 | void AudioWidget::stopSkip() { |
399 | killTimers(); | 400 | killTimers(); |
400 | } | 401 | } |
401 | 402 | ||
402 | 403 | ||
403 | void AudioWidget::timerEvent( QTimerEvent * ) { | 404 | void AudioWidget::timerEvent( QTimerEvent * ) { |
404 | if ( skipDirection == +1 ) { | 405 | if ( skipDirection == +1 ) { |
405 | mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); | 406 | mediaPlayerState->setPosition( mediaPlayerState->position() + 2 ); |
406 | } else if ( skipDirection == -1 ) { | 407 | } else if ( skipDirection == -1 ) { |
407 | mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); | 408 | mediaPlayerState->setPosition( mediaPlayerState->position() - 2 ); |
408 | } | 409 | } |
409 | } | 410 | } |
410 | 411 | ||
411 | 412 | ||
412 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | 413 | void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { |
413 | for ( int i = 0; i < numButtons; i++ ) { | 414 | for ( int i = 0; i < numButtons; i++ ) { |
414 | if ( event->state() == QMouseEvent::LeftButton ) { | 415 | if ( event->state() == QMouseEvent::LeftButton ) { |
415 | // The test to see if the mouse click is inside the button or not | 416 | // The test to see if the mouse click is inside the button or not |
416 | int x = event->pos().x() - xoff; | 417 | int x = event->pos().x() - xoff; |
417 | int y = event->pos().y() - yoff; | 418 | int y = event->pos().y() - yoff; |
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; |
468 | case AudioPrevious: mediaPlayerState->setPrev(); return; | 468 | case AudioPrevious: mediaPlayerState->setPrev(); return; |
469 | case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; | 469 | case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; |
470 | case AudioVolumeUp: emit moreReleased(); return; | 470 | case AudioVolumeUp: emit moreReleased(); return; |
471 | case AudioVolumeDown: emit lessReleased(); return; | 471 | case AudioVolumeDown: emit lessReleased(); return; |
472 | case AudioPlayList: mediaPlayerState->setList(); return; | 472 | case AudioPlayList: mediaPlayerState->setList(); return; |
473 | case AudioForward: emit forwardReleased(); return; | 473 | case AudioForward: emit forwardReleased(); return; |
474 | case AudioBack: emit backReleased(); return; | 474 | case AudioBack: emit backReleased(); return; |
475 | } | 475 | } |
476 | } | 476 | } |
477 | } | 477 | } |
478 | } | 478 | } |
479 | } | 479 | } |
480 | 480 | ||
481 | 481 | ||
482 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { | 482 | void AudioWidget::mousePressEvent( QMouseEvent *event ) { |
483 | mouseMoveEvent( event ); | 483 | mouseMoveEvent( event ); |
484 | } | 484 | } |
485 | 485 | ||
486 | 486 | ||
487 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { | 487 | void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { |
488 | mouseMoveEvent( event ); | 488 | mouseMoveEvent( event ); |
489 | } | 489 | } |
490 | 490 | ||
491 | 491 | ||
@@ -520,58 +520,58 @@ void AudioWidget::paintEvent( QPaintEvent * pe) { | |||
520 | 520 | ||
521 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) | 521 | void AudioWidget::keyReleaseEvent( QKeyEvent *e) |
522 | { | 522 | { |
523 | switch ( e->key() ) { | 523 | switch ( e->key() ) { |
524 | ////////////////////////////// Zaurus keys | 524 | ////////////////////////////// Zaurus keys |
525 | case Key_Home: | 525 | case Key_Home: |
526 | break; | 526 | break; |
527 | case Key_F9: //activity | 527 | case Key_F9: //activity |
528 | hide(); | 528 | hide(); |
529 | // qDebug("Audio F9"); | 529 | // qDebug("Audio F9"); |
530 | break; | 530 | break; |
531 | case Key_F10: //contacts | 531 | case Key_F10: //contacts |
532 | break; | 532 | break; |
533 | case Key_F11: //menu | 533 | case Key_F11: //menu |
534 | break; | 534 | break; |
535 | case Key_F12: //home | 535 | case Key_F12: //home |
536 | break; | 536 | break; |
537 | case Key_F13: //mail | 537 | case Key_F13: //mail |
538 | break; | 538 | break; |
539 | case Key_Space: { | 539 | case Key_Space: { |
540 | if(mediaPlayerState->playing()) { | 540 | if(mediaPlayerState->playing()) { |
541 | // toggleButton(1); | 541 | // toggleButton(1); |
542 | mediaPlayerState->setPlaying(FALSE); | 542 | mediaPlayerState->setPlaying(FALSE); |
543 | // toggleButton(1); | 543 | // toggleButton(1); |
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); |
570 | mediaPlayerState->setPrev(); | 570 | mediaPlayerState->setPrev(); |
571 | // toggleButton(4); | 571 | // toggleButton(4); |
572 | break; | 572 | break; |
573 | case Key_Escape: | 573 | case Key_Escape: |
574 | break; | 574 | break; |
575 | 575 | ||
576 | }; | 576 | }; |
577 | } | 577 | } |
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 | |||
@@ -20,105 +20,104 @@ | |||
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef AUDIO_WIDGET_H | 34 | #ifndef AUDIO_WIDGET_H |
35 | #define AUDIO_WIDGET_H | 35 | #define AUDIO_WIDGET_H |
36 | 36 | ||
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include <qpainter.h> | 38 | #include <qpainter.h> |
39 | #include <qdrawutil.h> | 39 | #include <qdrawutil.h> |
40 | #include <qpixmap.h> | 40 | #include <qpixmap.h> |
41 | #include <qstring.h> | 41 | #include <qstring.h> |
42 | #include <qslider.h> | 42 | #include <qslider.h> |
43 | #include <qframe.h> | 43 | #include <qframe.h> |
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 |
61 | }; | 60 | }; |
62 | 61 | ||
63 | 62 | ||
64 | class Ticker : public QFrame { | 63 | class Ticker : public QFrame { |
65 | Q_OBJECT | 64 | Q_OBJECT |
66 | 65 | ||
67 | public: | 66 | public: |
68 | Ticker( QWidget* parent=0 ); | 67 | Ticker( QWidget* parent=0 ); |
69 | ~Ticker(); | 68 | ~Ticker(); |
70 | void setText( const QString& text ) ; | 69 | void setText( const QString& text ) ; |
71 | 70 | ||
72 | protected: | 71 | protected: |
73 | void timerEvent( QTimerEvent * ); | 72 | void timerEvent( QTimerEvent * ); |
74 | void drawContents( QPainter *p ); | 73 | void drawContents( QPainter *p ); |
75 | private: | 74 | private: |
76 | QString scrollText; | 75 | QString scrollText; |
77 | int pos, pixelLen; | 76 | int pos, pixelLen; |
78 | }; | 77 | }; |
79 | 78 | ||
80 | 79 | ||
81 | class AudioWidget : public QWidget { | 80 | class AudioWidget : public QWidget { |
82 | Q_OBJECT | 81 | Q_OBJECT |
83 | public: | 82 | 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(); |
101 | void lessClicked(); | 100 | void lessClicked(); |
102 | void moreReleased(); | 101 | void moreReleased(); |
103 | void lessReleased(); | 102 | void lessReleased(); |
104 | void forwardClicked(); | 103 | void forwardClicked(); |
105 | void backClicked(); | 104 | void backClicked(); |
106 | void forwardReleased(); | 105 | void forwardReleased(); |
107 | void backReleased(); | 106 | void backReleased(); |
108 | void sliderMoved(long); | 107 | void sliderMoved(long); |
109 | 108 | ||
110 | protected: | 109 | protected: |
111 | void doBlank(); | 110 | void doBlank(); |
112 | void doUnblank(); | 111 | void doUnblank(); |
113 | void paintEvent( QPaintEvent *pe ); | 112 | void paintEvent( QPaintEvent *pe ); |
114 | void showEvent( QShowEvent *se ); | 113 | void showEvent( QShowEvent *se ); |
115 | void resizeEvent( QResizeEvent *re ); | 114 | void resizeEvent( QResizeEvent *re ); |
116 | void mouseMoveEvent( QMouseEvent *event ); | 115 | void mouseMoveEvent( QMouseEvent *event ); |
117 | void mousePressEvent( QMouseEvent *event ); | 116 | void mousePressEvent( QMouseEvent *event ); |
118 | void mouseReleaseEvent( QMouseEvent *event ); | 117 | void mouseReleaseEvent( QMouseEvent *event ); |
119 | void timerEvent( QTimerEvent *event ); | 118 | void timerEvent( QTimerEvent *event ); |
120 | void closeEvent( QCloseEvent *event ); | 119 | void closeEvent( QCloseEvent *event ); |
121 | void keyReleaseEvent( QKeyEvent *e); | 120 | void keyReleaseEvent( QKeyEvent *e); |
122 | private slots: | 121 | private slots: |
123 | void skipFor(); | 122 | void skipFor(); |
124 | void skipBack(); | 123 | void skipBack(); |