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

Method loadSound

Engine/source/T3D/assets/SoundAsset.cpp:216–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216bool SoundAsset::loadSound()
217{
218 if (mSoundPath)
219 {
220 if (!Torque::FS::IsFile(mSoundPath))
221 {
222 Con::errorf("SoundAsset::initializeAsset: Attempted to load file %s but it was not valid!", mSoundFile);
223 mLoadedState = BadFileReference;
224 mSFXProfile.setDescription(NULL);
225 mSFXProfile.setSoundFileName(StringTable->insert(StringTable->EmptyString()));
226 mSFXProfile.setPreload(false);
227 return false;
228 }
229 else
230 {// = new SFXProfile(mProfileDesc, mSoundFile, mPreload);
231 if (mProfileDesc.mSourceGroup == NULL)
232 mProfileDesc.mSourceGroup = dynamic_cast<SFXSource*>(Sim::findObject("AudioChannelMaster"));
233 mSFXProfile.setDescription(&mProfileDesc);
234 mSFXProfile.setSoundFileName(mSoundPath);
235 mSFXProfile.setPreload(mPreload);
236
237 //give it a nudge to preload if required
238 mSFXProfile.getBuffer();
239 }
240
241 }
242 mChangeSignal.trigger();
243 mLoadedState = Ok;
244 return true;
245}
246
247void SoundAsset::setSoundFile(const char* pSoundFile)
248{

Callers

nothing calls this directly

Calls 10

IsFileFunction · 0.85
setSoundFileNameMethod · 0.80
EmptyStringMethod · 0.80
setPreloadMethod · 0.80
errorfFunction · 0.50
findObjectFunction · 0.50
setDescriptionMethod · 0.45
insertMethod · 0.45
getBufferMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected