-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSound.h
61 lines (55 loc) · 1.27 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
#pragma once
#ifdef USE_FMOD
#include "fmod/api/inc/fmod.h"
#endif
#ifdef USE_UNTZ
#include "untz/include/UntzSound.h"
#endif
#ifdef USE_OPENAL
class ALSound;
#endif
#ifdef USE_MOYAIAL
class MoyaiALSound;
#endif
class SoundSystem;
class Sound {
public:
int id;
SoundSystem *parent;
#if defined(USE_FMOD)
FMOD_SOUND *sound;
FMOD_CHANNEL *ch;
#elif defined(USE_UNTZ)
UNTZ::Sound *sound;
void *ch;
#elif defined(USE_OPENAL)
ALSound *sound;
void *ch;
#elif defined(USE_MOYAIAL)
MoyaiALSound *sound;
void *ch;
#else
void *sound;
void *ch;
#endif
float default_volume;
float temp_volume;
int external_id; // for app use
char last_load_file_path[256]; // for headless
float *last_samples; // for headless
int last_samples_num; // for headless, number of floats
float last_play_volume; // for headless
static bool g_no_real_sound;
Sound( SoundSystem *s);
void setLoop( bool flag );
void play();
void play(float vol);
void playDistance(float mindist, float maxdist, float dist, float relvol );
void stop();
bool isPlaying();
void setVolume(float v);
float getVolume();
float getTimePositionSec();
void setTimePositionSec(float sec);
void updateLastSamples( float *samples, int samples_num );
};