-
Notifications
You must be signed in to change notification settings - Fork 0
/
ao.h
executable file
·183 lines (149 loc) · 3.13 KB
/
ao.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
//
// Audio Overload SDK
//
// Fake ao.h to set up the general Audio Overload style environment
//
#ifndef __AO_H
#define __AO_H
#define AO_SUCCESS 1
#define AO_FAIL 0
#define AO_FAIL_DECOMPRESSION -1
#define MAX_DISP_INFO_LENGTH 256
#define AUDIO_RATE (44100)
enum
{
COMMAND_NONE = 0,
COMMAND_PREV,
COMMAND_NEXT,
COMMAND_RESTART,
COMMAND_HAS_PREV,
COMMAND_HAS_NEXT,
COMMAND_GET_MIN,
COMMAND_GET_MAX,
COMMAND_JUMP
};
/* Compiler defines for Xcode */
#ifdef __BIG_ENDIAN__
#undef LSB_FIRST
#endif
#ifdef __LITTLE_ENDIAN__
#define LSB_FIRST 1
#endif
typedef unsigned char ao_bool;
#ifdef __GNUC__
#include <stddef.h> // get NULL
#include <stdbool.h>
#ifndef nil
#define nil NULL
#endif
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#define xmalloc(a) malloc(a)
#endif
#ifdef _MSC_VER
#include <stddef.h> // get NULL
#include <wchar.h> // for off_t
#ifndef nil
#define nil NULL
#endif
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#define true (1)
#define false (0)
#define xmalloc(a) malloc(a)
#define strcasecmp _strcmpi
#endif
#ifndef PATH_MAX
#define PATH_MAX 2048
#endif
typedef struct
{
char title[9][MAX_DISP_INFO_LENGTH];
char info[9][MAX_DISP_INFO_LENGTH];
} ao_display_info;
typedef unsigned char uint8;
typedef unsigned char UINT8;
typedef signed char int8;
typedef signed char INT8;
typedef unsigned short uint16;
typedef unsigned short UINT16;
typedef signed short int16;
typedef signed short INT16;
typedef signed int int32;
typedef unsigned int uint32;
#ifdef LONG_IS_64BIT
typedef signed long int64;
typedef unsigned long uint64;
#else
typedef signed long long int64;
typedef unsigned long long uint64;
#endif
#ifdef WIN32
#ifndef _BASETSD_H
typedef signed int INT32;
typedef unsigned int UINT32;
typedef signed long long INT64;
typedef unsigned long long UINT64;
#endif
#else
typedef signed int INT32;
typedef unsigned int UINT32;
#ifdef LONG_IS_64BIT
typedef signed long INT64;
typedef unsigned long UINT64;
#else
typedef signed long long INT64;
typedef unsigned long long UINT64;
#endif
#endif
#ifndef INLINE
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(_MWERKS_)
#define INLINE inline
#elif defined(__powerc)
#define INLINE inline
#else
#define INLINE
#endif
#endif
#if LSB_FIRST
#define LE16(x) (x)
#define LE32(x) (x)
#ifndef __ENDIAN__ /* Mac OS X Endian header has this function in it */
static unsigned long INLINE Endian32_Swap(unsigned long addr)
{
unsigned long res = (((addr&0xff000000)>>24) |
((addr&0x00ff0000)>>8) |
((addr&0x0000ff00)<<8) |
((addr&0x000000ff)<<24));
return res;
}
#endif
#else
static unsigned short INLINE LE16(unsigned short x)
{
unsigned short res = (((x & 0xFF00) >> 8) | ((x & 0xFF) << 8));
return res;
}
static unsigned long INLINE LE32(unsigned long addr)
{
unsigned long res = (((addr&0xff000000)>>24) |
((addr&0x00ff0000)>>8) |
((addr&0x0000ff00)<<8) |
((addr&0x000000ff)<<24));
return res;
}
#endif
int ao_get_lib(char *filename, uint8 **buffer, uint64 *length);
#endif // AO_H