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