-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sound.h
44 lines (32 loc) · 914 Bytes
/
Sound.h
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
35
36
37
38
39
40
41
42
43
44
#ifndef __SOUND_H__
#define __SOUND_H__
#include <string>
#include <map>
#include <fstream>
#include <iostream>
#include <boost/shared_ptr.hpp>
#include <SDL_mixer.h>
///Klasa obs³uguj¹ca dŸwiêk w grze
class Sound {
public:
///Domyœlny konstruktor
Sound();
///Wczytanie dŸwiêków z dysku
void LoadSounds();
///Granie muzyki
void PlayMusic(const std::string& name);
///Granie efektów dŸwiêkowych
void PlaySfx(const std::string& name);
private:
///Wczytaj muzykê
void LoadMusic(const std::string& name, const std::string& filename);
///Wczytaj efekty dŸwiekowe
void LoadSfx(const std::string& name, const std::string& filename);
private:
std::map<std::string, Mix_Chunk*> m_sfx;
std::map<std::string, Mix_Music*> m_music;
///static Sound* instance;
};
///WskaŸnikk na klasê Sound
typedef boost::shared_ptr<Sound> SoundPtr;
#endif /* __SOUND_H__ */