aboutsummaryrefslogtreecommitdiffstats
path: root/alc/buffer_storage.h
diff options
context:
space:
mode:
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 */