//------------------------------------------------------------------------ void CItem::StopSound(tSoundID id) { if(id == INVALID_SOUNDID) return; bool synchSound = false; IEntitySoundProxy *pSoundProxy = GetSoundProxy(false); if(pSoundProxy) { for(TInstanceActionMap::iterator it = m_instanceActions.begin(); it != m_instanceActions.end(); ++it) { SInstanceAction &action = it->second; for(int i=0; i<2; i++) { if(action.sound[i].id == id) { pSoundProxy->SetStaticSound(id, false); action.sound[i].id = INVALID_SOUNDID; synchSound = action.sound[i].synch; break; } } } if(synchSound) pSoundProxy->StopSound(id, ESoundStopMode_OnSyncPoint); else pSoundProxy->StopSound(id); } }
//------------------------------------------------------------------------ void CItem::StopSound(tSoundID id) { if (id == INVALID_SOUNDID) return; bool synchSound = false; IEntitySoundProxy *pSoundProxy = GetSoundProxy(false); if (pSoundProxy) { if(synchSound) pSoundProxy->StopSound(id, ESoundStopMode_OnSyncPoint); else pSoundProxy->StopSound(id); } }
//------------------------------------------------------------------------ void CItem::ReleaseStaticSound(SInstanceAudio *sound) { if (sound->id != INVALID_SOUNDID) { IEntitySoundProxy *pSoundProxy = GetSoundProxy(false); if (pSoundProxy) { pSoundProxy->SetStaticSound(sound->id, false); if(sound->synch) pSoundProxy->StopSound(sound->id,ESoundStopMode_OnSyncPoint); else pSoundProxy->StopSound(sound->id); sound->id = INVALID_SOUNDID; #ifndef ITEM_USE_SHAREDSTRING sound->static_name.resize(0); #else sound->static_name.reset(); #endif } } }