22 |
22 |
23 #ifdef __CPLUSPLUS |
23 #ifdef __CPLUSPLUS |
24 extern "C" { |
24 extern "C" { |
25 #endif |
25 #endif |
26 |
26 |
27 char openal_init (char* programname, char usehardware, unsigned int memorysize); |
27 // init audio context and allocate memory |
28 char openal_close (void); |
28 char openal_init (char usehardware, int memorysize); |
29 char openal_ready (void); |
29 |
30 int openal_loadfile (const char *filename); |
30 // close audio subsytem and free memory |
31 char openal_toggleloop (unsigned int index); |
31 void openal_close (void); |
32 char openal_setposition (unsigned int index, float x, float y, float z); |
32 |
33 char openal_setvolume (unsigned int index, unsigned char percentage); |
33 // check if openal_init has been called |
34 char openal_setglobalvolume (unsigned char percentage); |
34 char openal_ready (void); |
35 char openal_togglemute (void); |
35 |
36 char openal_fadeout (unsigned int index, unsigned short int quantity); |
36 // load an audio file into memory and map it to abuffer |
37 char openal_fadein (unsigned int index, unsigned short int quantity); |
37 int openal_loadfile (const char *filename); |
38 char openal_fade (unsigned int index, unsigned short int quantity, char direction); |
38 |
39 char openal_playsound (unsigned int index); |
39 // play, pause, stop a single sound source |
40 char openal_pausesound (unsigned int index); |
40 void openal_playsound (unsigned int index); |
41 char openal_stopsound (unsigned int index); |
41 void openal_pausesound (unsigned int index); |
42 char openal_freesound (unsigned int index); |
42 void openal_stopsound (unsigned int index); |
43 |
43 |
|
44 // play a sound and set whether it should loop or not (0/1) |
|
45 void openal_playsound_loop (unsigned int index, char loops); |
|
46 |
|
47 // stop a sound and free the associated buffer |
|
48 void openal_stopsound_free (unsigned int index, char freesource); |
|
49 |
|
50 void openal_freesound (unsigned int index); |
|
51 |
|
52 // set or unset the looping property for a sound source |
|
53 void openal_toggleloop (unsigned int index); |
|
54 |
|
55 // set position and volume of a sound source |
|
56 void openal_setposition (unsigned int index, float x, float y, float z); |
|
57 void openal_setvolume (unsigned int index, float gain); |
|
58 |
|
59 // set volume for all sounds (gain interval is [0-1]) |
|
60 void openal_setglobalvolume (float gain); |
|
61 |
|
62 // mute or unmute all sounds |
|
63 void openal_togglemute (void); |
|
64 |
|
65 // fade effect, |
|
66 void openal_fadeout (unsigned int index, unsigned short int quantity); |
|
67 void openal_fadein (unsigned int index, unsigned short int quantity); |
|
68 void openal_fade (unsigned int index, unsigned short int quantity, char direction); |
|
69 |
|
70 #define AL_FADE_IN 1 |
|
71 #define AL_FADE_OUT -1 |
|
72 |
44 #ifdef __CPLUSPLUS |
73 #ifdef __CPLUSPLUS |
45 } |
74 } |
46 #endif |
75 #endif |
47 |
76 |
48 #endif /*_OALB_INTERFACE_H*/ |
77 #endif /*_OALB_INTERFACE_H*/ |