-
Notifications
You must be signed in to change notification settings - Fork 0
/
SoundManager.hpp
60 lines (45 loc) · 1.66 KB
/
SoundManager.hpp
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef SOUNDMANAGER_HPP
#define SOUNDMANAGER_HPP
#include <map>
#include <iostream>
#include <SFML/Audio.hpp>
//#define SOUND static sf::Sound
class SoundManager {
public:
static void load();
static void playSound(std::string name);
static void playMusic(std::string name);
static void stopMusic(std::string name);
static void pauseMusic(std::string name);
static void setLoop(bool loop, std::string name);
static void setPitch(float pitch, std::string name);
static void setVolume(float volume, std::string name);
static void setPosition(float x, float y, float z, std::string name);
private:
static sf::Music menuMusic;
static sf::Music overWorldMusic;
static sf::SoundBuffer attackBuf;
static sf::SoundBuffer softSword;
static sf::SoundBuffer stabSword;
static sf::SoundBuffer stepGround;
static sf::SoundBuffer linkAttack0;
static sf::SoundBuffer linkAttack1;
static sf::SoundBuffer linkAttack2;
static sf::SoundBuffer linkAttack3;
static sf::SoundBuffer shootBigBall;
static std::map<std::string, sf::Sound> soundMap;
static std::map<std::string, sf::Music> musicMap;
static std::map<std::string, sf::Sound>::iterator sit;
static std::map<std::string, sf::Music>::iterator mit;
};
#endif // SOUNDMANAGER_HPP
/*
it = mymap.find('b');
if (it != mymap.end())
mymap.erase (it);
// print content:
std::cout << "elements in mymap:" << '\n';
std::cout << "a => " << mymap.find('a')->second << '\n';
std::cout << "c => " << mymap.find('c')->second << '\n';
std::cout << "d => " << mymap.find('d')->second << '\n';
*/