diff options
author | Chris Robinson <[email protected]> | 2023-03-22 16:09:47 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-22 23:21:01 -0700 |
commit | ac01cbf7a518df913b3c9e45565a4ab7a8653bc7 (patch) | |
tree | 7845df00e378f55bdd175cffff48cf7ef9c2dcc6 /core/buffer_storage.cpp | |
parent | d4bfb62591be4682238f72825c293f0416956934 (diff) |
Log the buffer format when queueing mismatched buffers
Diffstat (limited to 'core/buffer_storage.cpp')
-rw-r--r-- | core/buffer_storage.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/core/buffer_storage.cpp b/core/buffer_storage.cpp index 4f1480c2..98ca2c1b 100644 --- a/core/buffer_storage.cpp +++ b/core/buffer_storage.cpp @@ -6,6 +6,43 @@ #include <stdint.h> +const char *NameFromFormat(FmtType type) noexcept +{ + switch(type) + { + case FmtUByte: return "UInt8"; + case FmtShort: return "Int16"; + case FmtFloat: return "Float"; + case FmtDouble: return "Double"; + case FmtMulaw: return "muLaw"; + case FmtAlaw: return "aLaw"; + case FmtIMA4: return "IMA4 ADPCM"; + case FmtMSADPCM: return "MS ADPCM"; + } + return "<internal error>"; +} + +const char *NameFromFormat(FmtChannels channels) noexcept +{ + switch(channels) + { + case FmtMono: return "Mono"; + case FmtStereo: return "Stereo"; + case FmtRear: return "Rear"; + case FmtQuad: return "Quadraphonic"; + case FmtX51: return "Surround 5.1"; + case FmtX61: return "Surround 6.1"; + case FmtX71: return "Surround 7.1"; + case FmtBFormat2D: return "B-Format 2D"; + case FmtBFormat3D: return "B-Format 3D"; + case FmtUHJ2: return "UHJ2"; + case FmtUHJ3: return "UHJ3"; + case FmtUHJ4: return "UHJ4"; + case FmtSuperStereo: return "Super Stereo"; + } + return "<internal error>"; +} + uint BytesFromFmt(FmtType type) noexcept { switch(type) |