| 1 |
#include "oodle.h" |
| 2 |
|
| 3 |
CSound::CSound(const string &snd) |
| 4 |
{ |
| 5 |
string file = CImgLoader::getPath() + "snd/" + snd; |
| 6 |
const char* f2 = file.c_str(); |
| 7 |
data = Mix_LoadWAV( f2 ); |
| 8 |
|
| •9 |
if (!data) { |
| 10 |
LOG("Failed to load sound " << snd << ".", 1, LOG_INFO); |
| 11 |
LOG("This is normal if \"CSoundSystem\" failed to load above.", 1, LOG_INFO); |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
CSound::~CSound() |
| 16 |
{ |
| •17 |
if (data) |
| 18 |
Mix_FreeChunk(data); |
| 19 |
} |
| 20 |
|
| 21 |
void CSound::setChannel(int c) |
| 22 |
{ |
| 23 |
chan = c; |
| 24 |
} |
| 25 |
|
| 26 |
int CSound::getChannel() const |
| 27 |
{ |
| 28 |
return chan; |
| 29 |
} |
| 30 |
|
| 31 |
Mix_Chunk* CSound::getChunk() const |
| 32 |
{ |
| 33 |
return data; |
| •34 |
} |