Debian Codegraph @

Oodle/src/CSoundSystem.cpp

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #include "oodle.h"
2
3 CSoundSystem::CSoundSystem(int chunksize, int frequency, int channels, Uint16 format)
4 {
5 SDL_InitSubSystem(SDL_INIT_AUDIO);
6 if (Mix_OpenAudio(frequency, format, channels, chunksize))
7 {
8 _THROWEX(ex_sdl, "Failed to load sound subsystem", "CSoundSystem", "CSoundSystem",
9 "frequency = " << frequency << ", chunksize = " << chunksize << ", " <<
10 "channels = " << channels << ", format = " << format);
11 }
12 }
13
14 void CSoundSystem::playSound(CSound &snd) const
15 {
16 snd.setChannel( Mix_PlayChannel(-1, snd.getChunk(), 0) );
17 }
18 void CSoundSystem::stopSound(const CSound &snd) const
19 {
20 Mix_HaltChannel(snd.getChannel());
21 }
22
23 CSoundSystem::~CSoundSystem()
24 {
25 Mix_CloseAudio();
26 }