

Definition at line 13 of file ResSoundPack.h.
Public Member Functions | |
| virtual const char * | getName () const |
| void | addSound (const std::string &name, const Path &file) |
| Store sound under this name. | |
Static Public Member Functions | |
| static Mix_Chunk * | loadSound (const Path &file) |
| Load unshared sound from file. | |
Protected Member Functions | |
| virtual void | unloadRes (Mix_Chunk *res) |
|
||||||||||||
|
Store sound under this name. Nothing is stored when sound cannot be loaded. Definition at line 46 of file ResSoundPack.cpp. 00047 {
00048 Mix_Chunk *chunk = loadSound(file);
00049 if (chunk) {
00050 addRes(name, chunk);
00051 }
00052 }
|
|
|
Implements INamed. Definition at line 17 of file ResSoundPack.h. 00017 { return "sound_pack"; }
|
|
|
Load unshared sound from file.
Definition at line 26 of file ResSoundPack.cpp. 00027 {
00028 Mix_Chunk *chunk = NULL;
00029 //TODO: ask SoundAgent to load this sound
00030 if (OptionAgent::agent()->getAsBool("sound", true)) {
00031 chunk = Mix_LoadWAV(file.getNative().c_str());
00032 if (NULL == chunk) {
00033 LOG_WARNING(ExInfo("cannot load sound")
00034 .addInfo("path", file.getNative())
00035 .addInfo("MixError", Mix_GetError()));
00036 }
00037 }
00038 return chunk;
00039 }
|
|
|
Implements ResourcePack< Mix_Chunk * >. Definition at line 16 of file ResSoundPack.cpp. 00017 {
00018 Mix_FreeChunk(res);
00019 }
|
1.4.2