| 214 | } |
| 215 | |
| 216 | bool 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 | |
| 247 | void SoundAsset::setSoundFile(const char* pSoundFile) |
| 248 | { |
nothing calls this directly
no test coverage detected