🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.7 KiB

  1. #ifndef AL_BUFFER_H
  2. #define AL_BUFFER_H
  3. #include <atomic>
  4. #include "AL/al.h"
  5. #include "albyte.h"
  6. #include "alc/inprogext.h"
  7. #include "almalloc.h"
  8. #include "atomic.h"
  9. #include "core/buffer_storage.h"
  10. #include "vector.h"
  11. #ifdef ALSOFT_EAX
  12. #include "eax/x_ram.h"
  13. #endif // ALSOFT_EAX
  14. /* User formats */
  15. enum UserFmtType : unsigned char {
  16. UserFmtUByte = FmtUByte,
  17. UserFmtShort = FmtShort,
  18. UserFmtFloat = FmtFloat,
  19. UserFmtMulaw = FmtMulaw,
  20. UserFmtAlaw = FmtAlaw,
  21. UserFmtDouble = FmtDouble,
  22. UserFmtIMA4 = 128,
  23. UserFmtMSADPCM,
  24. };
  25. enum UserFmtChannels : unsigned char {
  26. UserFmtMono = FmtMono,
  27. UserFmtStereo = FmtStereo,
  28. UserFmtRear = FmtRear,
  29. UserFmtQuad = FmtQuad,
  30. UserFmtX51 = FmtX51,
  31. UserFmtX61 = FmtX61,
  32. UserFmtX71 = FmtX71,
  33. UserFmtBFormat2D = FmtBFormat2D,
  34. UserFmtBFormat3D = FmtBFormat3D,
  35. UserFmtUHJ2 = FmtUHJ2,
  36. UserFmtUHJ3 = FmtUHJ3,
  37. UserFmtUHJ4 = FmtUHJ4,
  38. };
  39. struct ALbuffer : public BufferStorage {
  40. ALbitfieldSOFT Access{0u};
  41. al::vector<al::byte,16> mData;
  42. UserFmtType OriginalType{UserFmtShort};
  43. ALuint OriginalSize{0};
  44. ALuint OriginalAlign{0};
  45. ALuint UnpackAlign{0};
  46. ALuint PackAlign{0};
  47. ALuint UnpackAmbiOrder{1};
  48. ALbitfieldSOFT MappedAccess{0u};
  49. ALsizei MappedOffset{0};
  50. ALsizei MappedSize{0};
  51. ALuint mLoopStart{0u};
  52. ALuint mLoopEnd{0u};
  53. /* Number of times buffer was attached to a source (deletion can only occur when 0) */
  54. RefCount ref{0u};
  55. /* Self ID */
  56. ALuint id{0};
  57. DISABLE_ALLOC()
  58. #ifdef ALSOFT_EAX
  59. ALenum eax_x_ram_mode{AL_STORAGE_AUTOMATIC};
  60. bool eax_x_ram_is_hardware{};
  61. #endif // ALSOFT_EAX
  62. };
  63. #endif