forked from stephane-hulot/thanksgiving-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sound.h
45 lines (37 loc) · 885 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
45
#ifndef _SOUND_H_
#define _SOUND_H_
#include <SDL2/SDL_mixer.h>
#include "menu.h"
#include "player.h"
#include <SDL2/SDL.h>
class Sound
{
public:
Sound(Menu* me, Player* p);
void init_sounds();
void play_sounds();
void set_volume(int vol);
~Sound();
//forbids copy constructor to avoid warning in c++11
Sound(const Sound& s) = delete;
Sound& operator=(const Sound& s) = delete;
private:
Mix_Chunk* theme;
Mix_Chunk* music_menu;
Mix_Chunk* music_pause;
Mix_Chunk* gameover;
Mix_Chunk* victory;
Mix_Chunk* gunshot;
Mix_Chunk* death_turkey;
Mix_Chunk* key;
Mix_Chunk* turkey;
Mix_Chunk* wall;
Mix_Chunk* hurt;
Mix_Chunk* load_sound(std::string filename);
void pause_music(int channel);
void resume_music(int channel);
void play(Mix_Chunk* sound, int channel, int loops);
Menu* menu;
Player* player;
};
#endif