Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/audio/include/AL/alext.h @ 366

Last change on this file since 366 was 329, checked in by nicolape, 17 years ago
File size: 6.4 KB
Line 
1#ifndef _AL_ALEXT_H
2#define _AL_ALEXT_H
3
4#include "AL/al.h"
5#include "AL/alc.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11/* format base 0x10000 */
12#define AL_FORMAT_IMA_ADPCM_MONO16_EXT            0x10000
13#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT          0x10001
14#define AL_FORMAT_WAVE_EXT                        0x10002
15#define AL_FORMAT_VORBIS_EXT                      0x10003
16
17/* four point formats */
18#define AL_FORMAT_QUAD8_LOKI                      0x10004
19#define AL_FORMAT_QUAD16_LOKI                     0x10005
20
21/**
22 * token extensions, base 0x20000
23 */
24
25/* deprecated, use AL_GAIN */
26#define AL_GAIN_LINEAR_LOKI                      0x20000
27
28/*
29 * types for special loaders.  This should be deprecated in favor
30 * of the special format tags.
31 */
32
33typedef struct WaveFMT {
34        ALushort encoding;
35        ALushort channels;      /* 1 = mono, 2 = stereo */
36        ALuint frequency;       /* One of 11025, 22050, or 44100 Hz */
37        ALuint byterate;        /* Average bytes per second */
38        ALushort blockalign;    /* Bytes per sample block */
39        ALushort bitspersample;
40} alWaveFMT_LOKI;
41
42typedef struct _MS_ADPCM_decodestate {
43        ALubyte hPredictor;
44        ALushort iDelta;
45        ALshort iSamp1;
46        ALshort iSamp2;
47} alMSADPCM_decodestate_LOKI;
48
49typedef struct MS_ADPCM_decoder {
50        alWaveFMT_LOKI wavefmt;
51        ALushort wSamplesPerBlock;
52        ALushort wNumCoef;
53        ALshort aCoeff[7][2];
54        /* * * */
55        alMSADPCM_decodestate_LOKI state[2];
56} alMSADPCM_state_LOKI;
57
58typedef struct IMA_ADPCM_decodestate_s {
59        ALint valprev;          /* Previous output value */
60        ALbyte index;           /* Index into stepsize table */
61} alIMAADPCM_decodestate_LOKI;
62
63typedef struct IMA_ADPCM_decoder {
64        alWaveFMT_LOKI wavefmt;
65        ALushort wSamplesPerBlock;
66        /* * * */
67        alIMAADPCM_decodestate_LOKI state[2];
68} alIMAADPCM_state_LOKI;
69
70/**
71 * Context creation extension tokens
72 * base 0x200000
73 */
74
75/**
76 * followed by ### of sources
77 */
78#define ALC_SOURCES_LOKI                         0x200000
79
80/**
81 * followed by ### of buffers
82 */
83#define ALC_BUFFERS_LOKI                         0x200001
84
85/*
86 *  Channel operations are probably a big no-no and destined
87 *  for obsolesence.
88 *
89 *  base 0x300000
90 */
91#define ALC_CHAN_MAIN_LOKI                       0x300000
92#define ALC_CHAN_PCM_LOKI                        0x300001
93#define ALC_CHAN_CD_LOKI                         0x300002
94
95/* loki */
96
97ALC_API ALfloat  ALC_APIENTRY alcGetAudioChannel_LOKI( ALuint channel );
98ALC_API void     ALC_APIENTRY alcSetAudioChannel_LOKI( ALuint channel, ALfloat volume );
99AL_API  void     AL_APIENTRY  alBombOnError_LOKI( void );
100AL_API  void     AL_APIENTRY  alBufferi_LOKI( ALuint bid, ALenum param, ALint value );
101AL_API  void     AL_APIENTRY  alBufferDataWithCallback_LOKI( ALuint bid, int ( *Callback ) ( ALuint, ALuint, ALshort *, ALenum, ALint, ALint ) );
102AL_API  void     AL_APIENTRY  alBufferWriteData_LOKI( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat );
103AL_API  void     AL_APIENTRY  alGenStreamingBuffers_LOKI( ALsizei n, ALuint *samples );
104AL_API  ALsizei  AL_APIENTRY  alBufferAppendData_LOKI( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq );
105AL_API  ALsizei  AL_APIENTRY  alBufferAppendWriteData_LOKI( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat );
106
107/* binary compatibility */
108AL_API  ALsizei  AL_APIENTRY alBufferAppendData( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq );
109
110/*
111 * Don't use these.  If you're reading this, you should remove these functions
112 * and all other reverb functions.  Now.
113 */
114AL_API void AL_APIENTRY alReverbScale_LOKI(ALuint sid, ALfloat param);
115AL_API void AL_APIENTRY alReverbDelay_LOKI(ALuint sid, ALfloat param);
116
117/* Capture api */
118
119ALC_API ALboolean ALC_APIENTRY alCaptureInit_EXT( ALenum format, ALuint rate, ALsizei bufferSize );
120ALC_API ALboolean ALC_APIENTRY alCaptureDestroy_EXT( void );
121ALC_API ALboolean ALC_APIENTRY alCaptureStart_EXT( void );
122ALC_API ALboolean ALC_APIENTRY alCaptureStop_EXT( void );
123
124/* Non-blocking device read */
125
126ALC_API ALsizei   ALC_APIENTRY alCaptureGetData_EXT( ALvoid *data, ALsizei n, ALenum format, ALuint rate );
127
128/* custom loaders */
129
130AL_API ALboolean AL_APIENTRY alutLoadVorbis_LOKI( ALuint bid, const ALvoid *data, ALint size );
131AL_API ALboolean AL_APIENTRY alutLoadMP3_LOKI( ALuint bid, ALvoid *data, ALint size );
132
133/* function pointers */
134
135typedef ALfloat   ( ALC_APIENTRY *PFNALCGETAUDIOCHANNELPROC ) ( ALuint channel );
136typedef void      ( ALC_APIENTRY *PFNALCSETAUDIOCHANNELPROC ) ( ALuint channel, ALfloat volume );
137typedef void      ( AL_APIENTRY *PFNALBOMBONERRORPROC ) ( void );
138typedef void      ( AL_APIENTRY *PFNALBUFFERIPROC ) ( ALuint bid, ALenum param, ALint value );
139typedef void      ( AL_APIENTRY *PFNALBUFFERDATAWITHCALLBACKPROC ) ( ALuint bid, int ( *Callback ) ( ALuint, ALuint, ALshort *, ALenum, ALint, ALint ) );
140typedef void      ( AL_APIENTRY *PFNALBUFFERWRITEDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat );
141typedef void      ( AL_APIENTRY *PFNALGENSTREAMINGBUFFERSPROC ) ( ALsizei n, ALuint *samples );
142typedef ALsizei   ( AL_APIENTRY *PFNALBUFFERAPPENDDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq );
143typedef ALsizei   ( AL_APIENTRY *PFNALBUFFERAPPENDWRITEDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat );
144
145typedef ALboolean ( ALC_APIENTRY *PFNALCAPTUREINITPROC ) ( ALenum format, ALuint rate, ALsizei bufferSize );
146typedef ALboolean ( ALC_APIENTRY *PFNALCAPTUREDESTROYPROC ) ( void );
147typedef ALboolean ( ALC_APIENTRY *PFNALCAPTURESTARTPROC ) ( void );
148typedef ALboolean ( ALC_APIENTRY *PFNALCAPTURESTOPPROC ) ( void );
149
150typedef ALsizei   ( ALC_APIENTRY *PFNALCAPTUREGETDATAPROC ) ( ALvoid *data, ALsizei n, ALenum format, ALuint rate );
151
152typedef ALboolean ( AL_APIENTRY *PFNALUTLOADVORBISPROC ) ( ALuint bid, ALvoid *data, ALint size );
153typedef ALboolean ( AL_APIENTRY *PFNALUTLOADRAW_ADPCMDATAPROC ) ( ALuint bid, ALvoid *data, ALuint size, ALuint freq, ALenum format );
154typedef ALboolean ( AL_APIENTRY *ALUTLOADIMA_ADPCMDATAPROC ) ( ALuint bid, ALvoid *data, ALuint size, alIMAADPCM_state_LOKI *ias );
155typedef ALboolean ( AL_APIENTRY *ALUTLOADMS_ADPCMDATAPROC ) ( ALuint bid, void *data, int size, alMSADPCM_state_LOKI *mss );
156
157typedef void      ( AL_APIENTRY *PFNALREVERBSCALEPROC ) ( ALuint sid, ALfloat param );
158typedef void      ( AL_APIENTRY *PFNALREVERBDELAYPROC ) ( ALuint sid, ALfloat param );
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif                          /* _AL_ALEXT_H */
Note: See TracBrowser for help on using the repository browser.