This repository has been archived by the owner on Mar 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsound.h
79 lines (61 loc) · 1.37 KB
/
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Fade To Black engine rewrite
* Copyright (C) 2006-2012 Gregory Montoir ([email protected])
*/
#ifndef SOUND_H__
#define SOUND_H__
#include "file.h"
#include "util.h"
#include "mixer.h"
struct Resource;
struct DigiSnd {
char name[16];
uint32_t offset;
uint32_t size;
};
struct MidiSng {
char name[16];
uint32_t offset;
uint32_t size;
};
enum {
MIDI_AWE32,
MIDI_FM,
MIDI_GUS,
MIDI_MT32
};
struct Sound {
Sound(Resource *res);
~Sound();
void init(int midiType);
void loadDigiSnd(File *fp);
const DigiSnd *findDigiSndByName(const char *name) const;
void loadMidiSng(File *fp);
const MidiSng *findMidiSngByName(const char *name) const;
void setVolume(int volume);
void setPan(int pan);
void playSfx(int16_t objKey, int16_t sndKey, bool loop = false);
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, int16_t sndKey);
void stopMidi(int16_t objKey, int16_t sndKey);
void playMidi(const char *name);
void playVag(int num);
void stopVag(int num);
int _sfxVolume;
int _sfxPan;
Resource *_res;
Mixer _mix;
bool _digiCompressed;
int _digiCount;
DigiSnd *_digiTable;
File *_fpSnd;
int _midiCount;
MidiSng *_midiTable;
File *_fpSng;
int _musicMode;
int16_t _musicKey;
};
#endif // SOUND_H__