| 501 | //----------------------------------------------------------------------------- |
| 502 | |
| 503 | void SFXSystem::deleteDevice() |
| 504 | { |
| 505 | // Make sure we have a valid device. |
| 506 | if ( !mDevice ) |
| 507 | return; |
| 508 | |
| 509 | // Put all playing sounds into virtualized playback mode. Where this fails, |
| 510 | // stop the source. |
| 511 | |
| 512 | for( U32 i = 0; i < mSounds.size(); ++ i ) |
| 513 | { |
| 514 | SFXSound* sound = mSounds[ i ]; |
| 515 | if( sound->hasVoice() && !sound->_releaseVoice() ) |
| 516 | sound->stop(); |
| 517 | } |
| 518 | |
| 519 | // Signal everyone who cares that the |
| 520 | // device is being deleted. |
| 521 | getEventSignal().trigger( SFXSystemEvent_DestroyDevice ); |
| 522 | |
| 523 | // Free the device which should delete all |
| 524 | // the active voices and buffers. |
| 525 | delete mDevice; |
| 526 | mDevice = NULL; |
| 527 | } |
| 528 | |
| 529 | //----------------------------------------------------------------------------- |
| 530 |
no test coverage detected