forked from GuillemFP/DoubleDragon3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModuleAudio.h
44 lines (31 loc) · 814 Bytes
/
ModuleAudio.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 MODULEAUDIO_H
#define MODULEAUDIO_H
#include <vector>
#include "Module.h"
#define MODULE_AUDIO "ModuleAudio"
#define AUDIO_SECTION "Config.Modules.Audio"
struct _Mix_Music;
struct Mix_Chunk;
typedef struct _Mix_Music Mix_Music;
class ModuleAudio : public Module
{
public:
ModuleAudio();
~ModuleAudio();
bool Init();
bool CleanUp();
bool PlayMusic(const char* path) { return PlayMusic(path, fDEFAULT_FADE); }
bool PlayMusic(const char* path, float fade_time);
void StopMusic();
unsigned int LoadFx(const char* path);
bool PlayFx(unsigned int fx, int repeat = 0);
bool isPlayingMusic() const;
bool ConstantConfig();
private:
Mix_Music* music = nullptr;
std::vector<Mix_Chunk*> fx;
float fDEFAULT_FADE = 2.0f;
int iVOLUME_MUSIC = 1;
int iVOLUME_FX = 1;
};
#endif // !MODULEAUDIO_H