forked from cyxx/f2bgl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsound.h
55 lines (41 loc) · 989 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
46
47
48
49
50
51
52
53
54
55
/*
* Fade To Black engine rewrite
* Copyright (C) 2006-2012 Gregory Montoir ([email protected])
*/
#ifndef SOUND_H__
#define SOUND_H__
#include "util.h"
#include "mixer.h"
struct Resource;
struct DigiSnd {
char name[16];
uint32_t offset;
uint32_t size;
};
struct Sound {
Sound(Resource *res);
~Sound();
void init();
void loadDigiSnd(FILE *fp);
const DigiSnd *findDigiSndByName(const char *name) const;
void setVolume(int volume);
void setPan(int pan);
void playSfx(int16_t objKey, int16_t sndKey);
void stopSfx(int16_t objKey, int16_t sndKey);
void playVoice(int16_t objKey, uint32_t crc);
void stopVoice(int16_t objKey);
bool isVoicePlaying(int16_t objKey) const;
void playMidi(int16_t objKey, int index);
void stopMidi(int16_t objKey, int index);
int _sfxVolume;
int _sfxPan;
Resource *_res;
Mixer _mix;
bool _digiCompressed;
int _digiCount;
DigiSnd *_digiTable;
FILE *_fpSnd;
int _musicMode;
int16_t _musicKey;
};
#endif // SOUND_H__