Set some common macros in alu.h
[openal-soft.git] / OpenAL32 / Include / alu.h
blob9bbcc46423310754db68b53a5f29282b55ccedbc
1 #ifndef _ALU_H_
2 #define _ALU_H_
4 #include "AL/al.h"
5 #include "AL/alc.h"
7 #ifdef HAVE_FLOAT_H
8 #include <float.h>
9 #endif
11 #ifndef M_PI
12 #define M_PI 3.14159265358979323846 /* pi */
13 #define M_PI_2 1.57079632679489661923 /* pi/2 */
14 #endif
16 #ifdef HAVE_SQRTF
17 #define aluSqrt(x) ((ALfloat)sqrtf((float)(x)))
18 #else
19 #define aluSqrt(x) ((ALfloat)sqrt((double)(x)))
20 #endif
22 #ifdef HAVE_ACOSF
23 #define aluAcos(x) ((ALfloat)acosf((float)(x)))
24 #else
25 #define aluAcos(x) ((ALfloat)acos((double)(x)))
26 #endif
28 #ifdef HAVE_ATANF
29 #define aluAtan(x) ((ALfloat)atanf((float)(x)))
30 #else
31 #define aluAtan(x) ((ALfloat)atan((double)(x)))
32 #endif
34 #ifdef HAVE_FABSF
35 #define aluFabs(x) ((ALfloat)fabsf((float)(x)))
36 #else
37 #define aluFabs(x) ((ALfloat)fabs((double)(x)))
38 #endif
40 // fixes for mingw32.
41 #if defined(max) && !defined(__max)
42 #define __max max
43 #endif
44 #if defined(min) && !defined(__min)
45 #define __min min
46 #endif
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
52 enum {
53 FRONT_LEFT = 0,
54 FRONT_RIGHT,
55 FRONT_CENTER,
56 SIDE_LEFT,
57 SIDE_RIGHT,
58 BACK_LEFT,
59 BACK_RIGHT,
60 BACK_CENTER,
61 LFE,
63 OUTPUTCHANNELS
66 #define BUFFERSIZE 24000
68 extern ALboolean DuplicateStereo;
70 __inline ALuint aluBytesFromFormat(ALenum format);
71 __inline ALuint aluChannelsFromFormat(ALenum format);
72 ALvoid aluInitPanning(ALCcontext *Context);
73 ALvoid aluMixData(ALCcontext *context,ALvoid *buffer,ALsizei size,ALenum format);
75 #ifdef __cplusplus
77 #endif
79 #endif