forked from protoman/rockbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoundlib.h
69 lines (59 loc) · 1.6 KB
/
soundlib.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef SOUNDLIB_H
#define SOUNDLIB_H
#include <iostream>
using namespace std;
#include <SDL/SDL_mixer.h>
#include "defines.h"
/**
* @brief
*
*/
class soundLib
{
public:
/**
* @brief
*
*/
soundLib();
~soundLib();
static void fill_audio(void *udata, Uint8 *stream, int len);
void init_audio_system();
void play_sfx(Uint8 sfx);
void play_repeated_sfx(Uint8 sfx, Uint8 loops);
void stop_repeated_sfx();
bool is_playing_repeated_sfx() const;
Uint8 get_repeated_sfx_n() const;
void play_timed_sfx(Uint8 sfx, int time);
void load_all_sfx();
void load_music(string music_file);
void load_shared_music(std::string music_file);
void load_boss_music(string music_file);
void unload_music();
void play_music();
void play_music_once();
void play_boss_music();
void load_stage_music(string filename);
void restart_music();
void stop_music() const;
void close_audio();
void sound_loop();
void disable_sound() const;
void enable_sound();
void update_volumes();
void play_sfx_from_file(std::string filename, int repeat_n);
void play_shared_sfx(std::string filename);
void play_sfx_from_chunk(Mix_Chunk* chunk, int repeat_n);
Mix_Chunk *sfx_from_file(std::string filename);
bool get_is_playing_boss_music();
private:
public:
private:
Mix_Chunk *sfx_list[SFX_COUNT]; /**< TODO */
int/*Mix_Music*/ *music; /**< TODO */
int/*Mix_Music*/ *boss_music; /**< TODO */
Sint8 _repeated_sfx_channel; /**< TODO */
Uint8 _repeated_sfx; /**< TODO */
bool is_playing_boss_music;
};
#endif // SOUNDLIB_H