File: CSound.cpp

package info (click to toggle)
blocks-of-the-undead 1.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,084 kB
  • sloc: cpp: 6,224; sh: 3,356; makefile: 171
file content (34 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "oodle.h"

CSound::CSound(const string &snd)
{
	string file = CImgLoader::getPath() + "snd/" + snd;
	const char* f2  = file.c_str();
	data = Mix_LoadWAV( f2 );

	if (!data) {
		LOG("Failed to load sound " << snd << ".", 1, LOG_INFO);
		LOG("This is normal if \"CSoundSystem\" failed to load above.", 1, LOG_INFO);
	}
}

CSound::~CSound()
{
	if (data)
		Mix_FreeChunk(data);
}

void CSound::setChannel(int c)
{
	chan = c;
}

int CSound::getChannel() const
{
	return chan;
}

Mix_Chunk* CSound::getChunk() const
{
	return data;
}