zenilib: zenilib/jni/external/openal-soft/OpenAL32/Include/alBuffer.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
alBuffer.h
Go to the documentation of this file.
1 #ifndef _AL_BUFFER_H_
2 #define _AL_BUFFER_H_
3
4 #include "alMain.h"
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 /* User formats */
11 enum UserFmtType {
12 UserFmtByte = AL_BYTE_SOFT,
13 UserFmtUByte = AL_UNSIGNED_BYTE_SOFT,
14 UserFmtShort = AL_SHORT_SOFT,
15 UserFmtUShort = AL_UNSIGNED_SHORT_SOFT,
16 UserFmtInt = AL_INT_SOFT,
17 UserFmtUInt = AL_UNSIGNED_INT_SOFT,
18 UserFmtFloat = AL_FLOAT_SOFT,
19 UserFmtDouble = AL_DOUBLE_SOFT,
20 UserFmtByte3 = AL_BYTE3_SOFT,
21 UserFmtUByte3 = AL_UNSIGNED_BYTE3_SOFT,
22 UserFmtMulaw,
23 UserFmtAlaw,
24 UserFmtIMA4,
25 };
26 enum UserFmtChannels {
27 UserFmtMono = AL_MONO_SOFT,
28 UserFmtStereo = AL_STEREO_SOFT,
29 UserFmtRear = AL_REAR_SOFT,
30 UserFmtQuad = AL_QUAD_SOFT,
31 UserFmtX51 = AL_5POINT1_SOFT, /* (WFX order) */
32 UserFmtX61 = AL_6POINT1_SOFT, /* (WFX order) */
33 UserFmtX71 = AL_7POINT1_SOFT, /* (WFX order) */
34 };
35
36 ALuint BytesFromUserFmt(enum UserFmtType type);
37 ALuint ChannelsFromUserFmt(enum UserFmtChannels chans);
38 static __inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans,
39 enum UserFmtType type)
40 {
41 return ChannelsFromUserFmt(chans) * BytesFromUserFmt(type);
42 }
43
44
45 /* Storable formats */
46 enum FmtType {
47 FmtByte = UserFmtByte,
48 FmtShort = UserFmtShort,
49 FmtFloat = UserFmtFloat,
50 };
51 enum FmtChannels {
52 FmtMono = UserFmtMono,
53 FmtStereo = UserFmtStereo,
54 FmtRear = UserFmtRear,
55 FmtQuad = UserFmtQuad,
56 FmtX51 = UserFmtX51,
57 FmtX61 = UserFmtX61,
58 FmtX71 = UserFmtX71,
59 };
60
61 ALuint BytesFromFmt(enum FmtType type);
62 ALuint ChannelsFromFmt(enum FmtChannels chans);
63 static __inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type)
64 {
65 return ChannelsFromFmt(chans) * BytesFromFmt(type);
66 }
67
68
69 typedef struct ALbuffer
70 {
71 ALvoid *data;
72
73 ALsizei Frequency;
74 ALenum Format;
75 ALsizei SampleLen;
76
77 enum FmtChannels FmtChannels;
78 enum FmtType FmtType;
79
80 enum UserFmtChannels OriginalChannels;
81 enum UserFmtType OriginalType;
82 ALsizei OriginalSize;
83
84 ALsizei LoopStart;
85 ALsizei LoopEnd;
86
87 /* Number of times buffer was attached to a source (deletion can only occur when 0) */
88 RefCount ref;
89
90 RWLock lock;
91
92 /* Self ID */
93 ALuint id;
94 } ALbuffer;
95
96 ALvoid ReleaseALBuffers(ALCdevice *device);
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif
ALbuffer
struct ALbuffer ALbuffer
ALbuffer::data
ALvoid * data
Definition: alBuffer.h:71
ALvoid
void ALvoid
Definition: al.h:74
RefCount
ALuint RefCount
Definition: alMain.h:288
FmtX71
Definition: alBuffer.h:58
AL_STEREO_SOFT
#define AL_STEREO_SOFT
Definition: alext.h:210
AL_6POINT1_SOFT
#define AL_6POINT1_SOFT
Definition: alext.h:214
type
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
Definition: gl2ext.h:845
UserFmtShort
Definition: alBuffer.h:14
ALbuffer::FmtType
enum FmtType FmtType
Definition: alBuffer.h:78
UserFmtUByte3
Definition: alBuffer.h:21
ALbuffer::FmtChannels
enum FmtChannels FmtChannels
Definition: alBuffer.h:77
UserFmtRear
Definition: alBuffer.h:29
UserFmtInt
Definition: alBuffer.h:16
AL_REAR_SOFT
#define AL_REAR_SOFT
Definition: alext.h:211
RWLock
Definition: alMain.h:292
ALbuffer::lock
RWLock lock
Definition: alBuffer.h:90
BytesFromFmt
ALuint BytesFromFmt(enum FmtType type)
Definition: alBuffer.c:2109
ALsizei
int ALsizei
Definition: al.h:62
ALCdevice_struct
Definition: alMain.h:560
ALbuffer::OriginalChannels
enum UserFmtChannels OriginalChannels
Definition: alBuffer.h:80
ALbuffer::Frequency
ALsizei Frequency
Definition: alBuffer.h:73
FmtX61
Definition: alBuffer.h:57
UserFmtIMA4
Definition: alBuffer.h:24
AL_UNSIGNED_INT_SOFT
#define AL_UNSIGNED_INT_SOFT
Definition: alext.h:223
UserFmtMulaw
Definition: alBuffer.h:22
FmtRear
Definition: alBuffer.h:54
ALbuffer::SampleLen
ALsizei SampleLen
Definition: alBuffer.h:75
AL_INT_SOFT
#define AL_INT_SOFT
Definition: alext.h:222
UserFmtStereo
Definition: alBuffer.h:28
AL_DOUBLE_SOFT
#define AL_DOUBLE_SOFT
Definition: alext.h:225
UserFmtX61
Definition: alBuffer.h:32
ALbuffer
Definition: alBuffer.h:69
FmtStereo
Definition: alBuffer.h:53
ALbuffer::LoopStart
ALsizei LoopStart
Definition: alBuffer.h:84
UserFmtByte
Definition: alBuffer.h:12
UserFmtByte3
Definition: alBuffer.h:20
AL_5POINT1_SOFT
#define AL_5POINT1_SOFT
Definition: alext.h:213
AL_SHORT_SOFT
#define AL_SHORT_SOFT
Definition: alext.h:220
AL_UNSIGNED_BYTE_SOFT
#define AL_UNSIGNED_BYTE_SOFT
Definition: alext.h:219
AL_FLOAT_SOFT
#define AL_FLOAT_SOFT
Definition: alext.h:224
FmtType
FmtType
Definition: alBuffer.h:46
ALbuffer::OriginalType
enum UserFmtType OriginalType
Definition: alBuffer.h:81
alMain.h
AL_7POINT1_SOFT
#define AL_7POINT1_SOFT
Definition: alext.h:215
AL_BYTE3_SOFT
#define AL_BYTE3_SOFT
Definition: alext.h:226
FmtShort
Definition: alBuffer.h:48
FrameSizeFromUserFmt
static __inline ALuint FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType type)
Definition: alBuffer.h:38
ALbuffer::ref
RefCount ref
Definition: alBuffer.h:88
FmtMono
Definition: alBuffer.h:52
FmtX51
Definition: alBuffer.h:56
BytesFromUserFmt
ALuint BytesFromUserFmt(enum UserFmtType type)
Definition: alBuffer.c:2008
ALenum
int ALenum
Definition: al.h:65
AL_QUAD_SOFT
#define AL_QUAD_SOFT
Definition: alext.h:212
ALuint
unsigned int ALuint
Definition: al.h:59
UserFmtAlaw
Definition: alBuffer.h:23
UserFmtDouble
Definition: alBuffer.h:19
FrameSizeFromFmt
static __inline ALuint FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type)
Definition: alBuffer.h:63
AL_BYTE_SOFT
#define AL_BYTE_SOFT
Definition: alext.h:218
UserFmtX71
Definition: alBuffer.h:33
FmtByte
Definition: alBuffer.h:47
UserFmtMono
Definition: alBuffer.h:27
UserFmtQuad
Definition: alBuffer.h:30
FmtChannels
FmtChannels
Definition: alBuffer.h:51
ReleaseALBuffers
ALvoid ReleaseALBuffers(ALCdevice *device)
Definition: alBuffer.c:2228
UserFmtChannels
UserFmtChannels
Definition: alBuffer.h:26
ALbuffer::Format
ALenum Format
Definition: alBuffer.h:74
AL_UNSIGNED_SHORT_SOFT
#define AL_UNSIGNED_SHORT_SOFT
Definition: alext.h:221
FmtQuad
Definition: alBuffer.h:55
UserFmtUByte
Definition: alBuffer.h:13
ALbuffer::id
ALuint id
Definition: alBuffer.h:93
UserFmtUShort
Definition: alBuffer.h:15
UserFmtType
UserFmtType
Definition: alBuffer.h:11
ChannelsFromUserFmt
ALuint ChannelsFromUserFmt(enum UserFmtChannels chans)
Definition: alBuffer.c:2028
UserFmtX51
Definition: alBuffer.h:31
UserFmtFloat
Definition: alBuffer.h:18
ALbuffer::LoopEnd
ALsizei LoopEnd
Definition: alBuffer.h:85
AL_UNSIGNED_BYTE3_SOFT
#define AL_UNSIGNED_BYTE3_SOFT
Definition: alext.h:227
FmtFloat
Definition: alBuffer.h:49
ChannelsFromFmt
ALuint ChannelsFromFmt(enum FmtChannels chans)
Definition: alBuffer.c:2119
UserFmtUInt
Definition: alBuffer.h:17
ALbuffer::OriginalSize
ALsizei OriginalSize
Definition: alBuffer.h:82
AL_MONO_SOFT
#define AL_MONO_SOFT
Definition: alext.h:209