MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _updateStatus

Method _updateStatus

Engine/source/sfx/sfxSound.cpp:444–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442//-----------------------------------------------------------------------------
443
444void 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

Callers

nothing calls this directly

Calls 2

getStatusMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected