aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-12-04 19:50:00 -0800
committerChris Robinson <[email protected]>2010-12-04 19:50:00 -0800
commit88e3a2277235fe173d4d0ff3f10c0becdc9c82cd (patch)
tree3cfad0017b809fc08e69cc9ec99fe622d26a2606 /OpenAL32/Include
parent191803ad53c156d3f056b649c76e441042a385fb (diff)
Separate device format into 'channel config' and 'sample type' components
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 9a7b01ba..4e0d03da 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -316,6 +316,31 @@ ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value);
void RemoveUIntMapKey(UIntMap *map, ALuint key);
ALvoid *LookupUIntMapKey(UIntMap *map, ALuint key);
+/* Device formats */
+enum DevFmtType {
+ DevFmtByte, /* AL_BYTE */
+ DevFmtUByte, /* AL_UNSIGNED_BYTE */
+ DevFmtShort, /* AL_SHORT */
+ DevFmtUShort, /* AL_UNSIGNED_SHORT */
+ DevFmtFloat, /* AL_FLOAT */
+};
+enum DevFmtChannels {
+ DevFmtMono, /* AL_MONO */
+ DevFmtStereo, /* AL_STEREO */
+ DevFmtQuad, /* AL_QUAD */
+ DevFmtX51, /* AL_5POINT1 */
+ DevFmtX61, /* AL_6POINT1 */
+ DevFmtX71, /* AL_7POINT1 */
+};
+
+ALuint BytesFromDevFmt(enum DevFmtType type);
+ALuint ChannelsFromDevFmt(enum DevFmtChannels chans);
+static __inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans,
+ enum DevFmtType type)
+{
+ return ChannelsFromDevFmt(chans) * BytesFromDevFmt(type);
+}
+
struct ALCdevice_struct
{
@@ -325,7 +350,8 @@ struct ALCdevice_struct
ALuint Frequency;
ALuint UpdateSize;
ALuint NumUpdates;
- ALenum Format;
+ enum DevFmtChannels FmtChans;
+ enum DevFmtType FmtType;
ALCchar *szDeviceName;