| 442 | //----------------------------------------------------------------------------- |
| 443 | |
| 444 | void SFXSound::_updateStatus() |
| 445 | { |
| 446 | // If we have a voice, use its status. |
| 447 | |
| 448 | if( mVoice ) |
| 449 | { |
| 450 | SFXStatus voiceStatus = mVoice->getStatus(); |
| 451 | |
| 452 | // Filter out SFXStatusBlocked. |
| 453 | |
| 454 | if( voiceStatus == SFXStatusBlocked ) |
| 455 | _setStatus( SFXStatusPlaying ); |
| 456 | else |
| 457 | _setStatus( voiceStatus ); |
| 458 | |
| 459 | return; |
| 460 | } |
| 461 | |
| 462 | // If we're not in a playing state or we're a looping |
| 463 | // sound then we don't need to calculate the status. |
| 464 | |
| 465 | if( isLooping() || mStatus != SFXStatusPlaying ) |
| 466 | return; |
| 467 | |
| 468 | // If we're playing and don't have a voice we |
| 469 | // need to decide if the sound is done playing |
| 470 | // to ensure proper virtualization of the sound. |
| 471 | |
| 472 | if( mPlayTimer.getPosition() > mDuration ) |
| 473 | { |
| 474 | _stop(); |
| 475 | _setStatus( SFXStatusStopped ); |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | //----------------------------------------------------------------------------- |
| 480 |
nothing calls this directly
no test coverage detected