2961
|
1 //
|
|
2 // Audio Overload SDK
|
|
3 //
|
|
4 // Fake ao.h to set up the general Audio Overload style environment
|
|
5 //
|
|
6
|
|
7 #include "../../config.h"
|
|
8
|
|
9 #ifndef __AO_H
|
|
10 #define __AO_H
|
|
11
|
|
12 #define AO_SUCCESS 1
|
|
13 #define AO_FAIL 0
|
|
14 #define AO_FAIL_DECOMPRESSION -1
|
|
15
|
|
16 #define MAX_DISP_INFO_LENGTH 256
|
|
17 #define AUDIO_RATE (44100)
|
|
18
|
|
19 enum
|
|
20 {
|
|
21 COMMAND_NONE = 0,
|
|
22 COMMAND_PREV,
|
|
23 COMMAND_NEXT,
|
|
24 COMMAND_RESTART,
|
|
25 COMMAND_HAS_PREV,
|
|
26 COMMAND_HAS_NEXT,
|
|
27 COMMAND_GET_MIN,
|
|
28 COMMAND_GET_MAX,
|
|
29 COMMAND_JUMP
|
|
30 };
|
|
31
|
|
32 /* Compiler defines for Xcode */
|
|
33 #ifndef WORDS_BIGENDIAN
|
|
34 #define LSB_FIRST 1
|
|
35 #endif
|
|
36
|
|
37 typedef unsigned char ao_bool;
|
|
38
|
|
39 #ifdef __GNUC__
|
|
40 #include <stddef.h> // get NULL
|
|
41 #include <stdbool.h>
|
|
42
|
|
43 #ifndef nil
|
|
44 #define nil NULL
|
|
45 #endif
|
|
46
|
|
47 #ifndef TRUE
|
|
48 #define TRUE (1)
|
|
49 #endif
|
|
50 #ifndef FALSE
|
|
51 #define FALSE (0)
|
|
52 #endif
|
|
53
|
|
54 #define xmalloc(a) malloc(a)
|
|
55
|
|
56 #endif
|
|
57
|
|
58 #ifdef _MSC_VER
|
|
59 #include <stddef.h> // get NULL
|
|
60 #include <wchar.h> // for off_t
|
|
61
|
|
62 #ifndef nil
|
|
63 #define nil NULL
|
|
64 #endif
|
|
65
|
|
66 #ifndef TRUE
|
|
67 #define TRUE (1)
|
|
68 #endif
|
|
69 #ifndef FALSE
|
|
70 #define FALSE (0)
|
|
71 #endif
|
|
72
|
|
73 #define true (1)
|
|
74 #define false (0)
|
|
75
|
|
76 #define xmalloc(a) malloc(a)
|
|
77
|
|
78 #define strcasecmp _strcmpi
|
|
79
|
|
80 #endif
|
|
81
|
|
82 #ifndef PATH_MAX
|
|
83 #define PATH_MAX 2048
|
|
84 #endif
|
|
85
|
|
86 typedef unsigned char uint8;
|
|
87 typedef unsigned char UINT8;
|
|
88 typedef signed char int8;
|
|
89 typedef signed char INT8;
|
|
90 typedef unsigned short uint16;
|
|
91 typedef unsigned short UINT16;
|
|
92 typedef signed short int16;
|
|
93 typedef signed short INT16;
|
|
94 typedef signed int int32;
|
|
95 typedef unsigned int uint32;
|
|
96 #ifdef LONG_IS_64BIT
|
|
97 typedef signed long int64;
|
|
98 typedef unsigned long uint64;
|
|
99 #else
|
|
100 typedef signed long long int64;
|
|
101 typedef unsigned long long uint64;
|
|
102 #endif
|
|
103
|
|
104 #ifdef WIN32
|
|
105 #ifndef _BASETSD_H
|
|
106 typedef signed int INT32;
|
|
107 typedef unsigned int UINT32;
|
|
108 typedef signed long long INT64;
|
|
109 typedef unsigned long long UINT64;
|
|
110 #endif
|
|
111 #else
|
|
112 typedef signed int INT32;
|
|
113 typedef unsigned int UINT32;
|
|
114 #ifdef LONG_IS_64BIT
|
|
115 typedef signed long INT64;
|
|
116 typedef unsigned long UINT64;
|
|
117 #else
|
|
118 typedef signed long long INT64;
|
|
119 typedef unsigned long long UINT64;
|
|
120 #endif
|
|
121 #endif
|
|
122
|
|
123 #ifndef INLINE
|
|
124 #if defined(_MSC_VER)
|
|
125 #define INLINE __forceinline
|
|
126 #elif defined(__GNUC__)
|
|
127 #define INLINE __inline__
|
|
128 #elif defined(_MWERKS_)
|
|
129 #define INLINE inline
|
|
130 #elif defined(__powerc)
|
|
131 #define INLINE inline
|
|
132 #else
|
|
133 #define INLINE
|
|
134 #endif
|
|
135 #endif
|
|
136
|
|
137 #if LSB_FIRST
|
|
138 #define LE16(x) (x)
|
|
139 #define LE32(x) (x)
|
|
140
|
|
141 #ifndef __ENDIAN__ /* Mac OS X Endian header has this function in it */
|
|
142 static unsigned long INLINE Endian32_Swap(unsigned long addr)
|
|
143 {
|
|
144 unsigned long res = (((addr&0xff000000)>>24) |
|
|
145 ((addr&0x00ff0000)>>8) |
|
|
146 ((addr&0x0000ff00)<<8) |
|
|
147 ((addr&0x000000ff)<<24));
|
|
148
|
|
149 return res;
|
|
150 }
|
|
151 #endif
|
|
152
|
|
153 #else
|
|
154
|
|
155 static unsigned short INLINE LE16(unsigned short x)
|
|
156 {
|
|
157 unsigned short res = (((x & 0xFF00) >> 8) | ((x & 0xFF) << 8));
|
|
158 return res;
|
|
159 }
|
|
160
|
|
161 static unsigned long INLINE LE32(unsigned long addr)
|
|
162 {
|
|
163 unsigned long res = (((addr&0xff000000)>>24) |
|
|
164 ((addr&0x00ff0000)>>8) |
|
|
165 ((addr&0x0000ff00)<<8) |
|
|
166 ((addr&0x000000ff)<<24));
|
|
167
|
|
168 return res;
|
|
169 }
|
|
170
|
|
171 #endif
|
|
172
|
|
173 int ao_get_lib(char *filename, uint8 **buffer, uint64 *length);
|
|
174
|
|
175 #endif // AO_H
|