Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/freealut-1.1.0/src/alutInternal.h @ 14

Last change on this file since 14 was 14, checked in by landauf, 16 years ago

added freealut

File size: 5.4 KB
Line 
1/*
2 * This file should be #included as the first header in all *.c files.
3 */
4
5#if !defined(ALUT_INTERNAL_H)
6#define ALUT_INTERNAL_H
7
8#if HAVE_CONFIG_H
9#include "config.h"
10#endif
11
12#include <stdlib.h>
13
14#if HAVE_STDINT_H
15#include <stdint.h>
16#elif _MSC_VER < 1300
17typedef char int8_t;
18typedef unsigned char uint8_t;
19typedef short int16_t;
20typedef unsigned short uint16_t;
21typedef int int32_t;
22typedef unsigned int uint32_t;
23#elif HAVE_BASETSD_H
24#include <basetsd.h>
25typedef INT8 int8_t;
26typedef UINT8 uint8_t;
27typedef INT16 int16_t;
28typedef UINT16 uint16_t;
29typedef INT32 int32_t;
30typedef UINT32 uint32_t;
31#else
32#error Do not know sized types on this platform
33#endif
34
35typedef int16_t Int16BigEndian;
36typedef uint16_t UInt16LittleEndian;
37typedef int32_t Int32BigEndian;
38typedef uint32_t UInt32LittleEndian;
39
40#if HAVE___ATTRIBUTE__
41#define UNUSED(x) x __attribute__((unused))
42#else
43#define UNUSED(x) x
44#endif
45
46#include <AL/alut.h>
47
48#define AU_HEADER_SIZE 24
49
50/* see: http://en.wikipedia.org/wiki/Au_file_format, G.72x are missing */
51enum AUEncoding
52{
53  AU_ULAW_8 = 1,                /* 8-bit ISDN u-law */
54  AU_PCM_8 = 2,                 /* 8-bit linear PCM (signed) */
55  AU_PCM_16 = 3,                /* 16-bit linear PCM (signed, big-endian) */
56  AU_PCM_24 = 4,                /* 24-bit linear PCM */
57  AU_PCM_32 = 5,                /* 32-bit linear PCM */
58  AU_FLOAT_32 = 6,              /* 32-bit IEEE floating point */
59  AU_FLOAT_64 = 7,              /* 64-bit IEEE floating point */
60  AU_ALAW_8 = 27                /* 8-bit ISDN a-law */
61};
62
63/* in alutCodec.c */
64typedef ALvoid *Codec (ALvoid *data, size_t length, ALint numChannels,
65                       ALint bitsPerSample, ALfloat sampleFrequency);
66extern Codec _alutCodecLinear;
67extern Codec _alutCodecPCM8s;
68extern Codec _alutCodecPCM16;
69extern Codec _alutCodecULaw;
70extern Codec _alutCodecALaw;
71
72/* in alutError.c */
73extern void _alutSetError (ALenum err);
74
75/* in alutInit.c */
76extern ALboolean _alutSanityCheck (void);
77
78/* in alutInputStream.c */
79typedef struct InputStream_struct InputStream;
80extern InputStream *_alutInputStreamConstructFromFile (const char *fileName);
81extern InputStream *_alutInputStreamConstructFromMemory (const ALvoid *data,
82                                                         size_t length);
83extern const char *_alutInputStreamGetFileName (const InputStream *stream);
84extern size_t _alutInputStreamGetRemainingLength (const InputStream *stream);
85extern ALboolean _alutInputStreamDestroy (InputStream *stream);
86extern ALboolean _alutInputStreamEOF (InputStream *stream);
87extern ALvoid *_alutInputStreamRead (InputStream *stream, size_t length);
88extern ALboolean _alutInputStreamSkip (InputStream *stream,
89                                       size_t numBytesToSkip);
90extern ALboolean _alutInputStreamReadUInt16LE (InputStream *stream,
91                                               UInt16LittleEndian *value);
92extern ALboolean _alutInputStreamReadInt32BE (InputStream *stream,
93                                              Int32BigEndian *value);
94extern ALboolean _alutInputStreamReadUInt32LE (InputStream *stream,
95                                               UInt32LittleEndian *value);
96
97/* in alutLoader.c */
98extern ALuint _alutCreateBufferFromInputStream (InputStream *stream);
99extern void *_alutLoadMemoryFromInputStream (InputStream *stream,
100                                             ALenum *format, ALsizei *size,
101                                             ALfloat *frequency);
102
103/* in alutOutputStream.c */
104typedef struct OutputStream_struct OutputStream;
105extern OutputStream *_alutOutputStreamConstruct (size_t maximumLength);
106extern ALboolean _alutOutputStreamDestroy (OutputStream *stream);
107extern void *_alutOutputStreamGetData (OutputStream *stream);
108extern size_t _alutOutputStreamGetLength (OutputStream *stream);
109extern ALboolean _alutOutputStreamWriteInt16BE (OutputStream *stream,
110                                                Int16BigEndian value);
111extern ALboolean _alutOutputStreamWriteInt32BE (OutputStream *stream,
112                                                Int32BigEndian value);
113
114/* in alutUtil.c */
115extern ALvoid *_alutMalloc (size_t size);
116extern ALboolean _alutFormatConstruct (ALint numChannels, ALint bitsPerSample,
117                                       ALenum *format);
118extern ALboolean _alutFormatGetNumChannels (ALenum format,
119                                            ALint *numChannels);
120extern ALboolean _alutFormatGetBitsPerSample (ALenum format,
121                                              ALint *bitsPerSample);
122
123/* in alutWaveform.c */
124typedef struct BufferData_struct BufferData;
125extern BufferData *_alutBufferDataConstruct (ALvoid *data, size_t length,
126                                             ALint numChannels,
127                                             ALint bitsPerSample,
128                                             ALfloat sampleFrequency);
129extern ALboolean _alutBufferDataDestroy (BufferData *bufferData);
130extern void _alutBufferDataDetachData (BufferData *bufferData);
131extern ALvoid *_alutBufferDataGetData (const BufferData *bufferData);
132extern size_t _alutBufferDataGetLength (const BufferData *bufferData);
133extern ALfloat _alutBufferDataGetSampleFrequency (const BufferData
134                                                  *bufferData);
135extern ALboolean _alutGetFormat (const BufferData *bufferData,
136                                 ALenum *format);
137extern ALuint _alutPassBufferData (BufferData *bufferData);
138
139#endif /* not ALUT_INTERNAL_H */
Note: See TracBrowser for help on using the repository browser.