aboutsummaryrefslogtreecommitdiffstats
path: root/alc/buffer_storage.h
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2020-08-27 23:02:17 -0700
committerChris Robinson <chris.kcat@gmail.com>2020-08-27 23:02:17 -0700
commitecf30de36f6487c1f8a19ae0d03ba810078706f4 (patch)
tree1a25173f5d35b9c317854a1e20493bdb2be3d948 /alc/buffer_storage.h
parenta9ebcdcb7fb2d8eeb137b54c100f3d9601b71a2e (diff)
Rename buffer_formats to buffer_storage
Diffstat (limited to 'alc/buffer_storage.h')
-rw-r--r--alc/buffer_storage.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/alc/buffer_storage.h b/alc/buffer_storage.h
new file mode 100644
index 00000000..b10cea4c
--- /dev/null
+++ b/alc/buffer_storage.h
@@ -0,0 +1,33 @@
+#ifndef ALC_BUFFER_FORMATS_H
+#define ALC_BUFFER_FORMATS_H
+
+#include "AL/al.h"
+
+
+/* Storable formats */
+enum FmtType : unsigned char {
+ FmtUByte,
+ FmtShort,
+ FmtFloat,
+ FmtDouble,
+ FmtMulaw,
+ FmtAlaw,
+};
+enum FmtChannels : unsigned char {
+ FmtMono,
+ FmtStereo,
+ FmtRear,
+ FmtQuad,
+ FmtX51, /* (WFX order) */
+ FmtX61, /* (WFX order) */
+ FmtX71, /* (WFX order) */
+ FmtBFormat2D,
+ FmtBFormat3D,
+};
+
+ALuint BytesFromFmt(FmtType type) noexcept;
+ALuint ChannelsFromFmt(FmtChannels chans, ALuint ambiorder) noexcept;
+inline ALuint FrameSizeFromFmt(FmtChannels chans, FmtType type, ALuint ambiorder) noexcept
+{ return ChannelsFromFmt(chans, ambiorder) * BytesFromFmt(type); }
+
+#endif /* ALC_BUFFER_FORMATS_H */