83 lines
1.7 KiB
C
Raw Normal View History

2007-11-13 18:02:18 -08:00
#ifndef _AL_BUFFER_H_
#define _AL_BUFFER_H_
#include "AL/al.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Input formats (some are currently theoretical) */
enum SrcFmtType {
SrcFmtByte, /* AL_BYTE */
SrcFmtUByte, /* AL_UNSIGNED_BYTE */
SrcFmtShort, /* AL_SHORT */
SrcFmtUShort, /* AL_UNSIGNED_SHORT */
SrcFmtFloat, /* AL_FLOAT */
SrcFmtDouble, /* AL_DOUBLE */
2010-11-27 22:00:24 -08:00
SrcFmtMulaw, /* AL_MULAW */
};
enum SrcFmtChannels {
SrcFmtMono, /* AL_MONO */
SrcFmtStereo, /* AL_STEREO */
SrcFmtRear, /* AL_REAR */
SrcFmtQuad, /* AL_QUAD */
SrcFmtX51, /* AL_5POINT1 (WFX order) */
SrcFmtX61, /* AL_6POINT1 (WFX order) */
SrcFmtX71, /* AL_7POINT1 (WFX order) */
};
void DecomposeInputFormat(ALenum format, enum SrcFmtType *type,
enum SrcFmtChannels *order);
/* Storable formats */
2010-11-26 23:42:30 -08:00
enum FmtType {
FmtUByte,
FmtShort,
FmtFloat,
2010-11-27 00:32:53 -08:00
FmtDouble,
2010-11-26 23:42:30 -08:00
};
enum FmtChannels {
FmtMono,
FmtStereo,
FmtQuad,
Fmt51ChanWFX,
Fmt61ChanWFX,
Fmt71ChanWFX,
};
2010-11-27 15:37:51 -08:00
void DecomposeFormat(ALenum format, enum FmtType *type, enum FmtChannels *order);
2010-11-26 23:42:30 -08:00
2009-08-15 09:14:08 -07:00
typedef struct ALbuffer
2007-11-13 18:02:18 -08:00
{
ALvoid *data;
2007-11-13 18:02:18 -08:00
ALsizei size;
ALenum format;
ALenum eOriginalFormat;
2007-11-13 18:02:18 -08:00
ALsizei frequency;
ALsizei OriginalSize;
ALsizei OriginalAlign;
ALsizei LoopStart;
ALsizei LoopEnd;
2010-11-26 23:42:30 -08:00
enum FmtType FmtType;
enum FmtChannels FmtChannels;
2007-11-13 18:02:18 -08:00
ALuint refcount; // Number of sources using this buffer (deletion can only occur when this is 0)
// Index to itself
ALuint buffer;
2007-11-13 18:02:18 -08:00
} ALbuffer;
2009-08-15 09:14:08 -07:00
ALvoid ReleaseALBuffers(ALCdevice *device);
2007-11-13 18:02:18 -08:00
#ifdef __cplusplus
}
#endif
#endif