Counter Strike : Global Offensive Source Code
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.

163 lines
5.1 KiB

  1. /*
  2. Copyright (C) Impulsonic, Inc. All rights reserved.
  3. */
  4. #ifndef IPL_PHONON_API_COMMON_H
  5. #define IPL_PHONON_API_COMMON_H
  6. #if (defined(_WIN32) || defined(_WIN64))
  7. #define IPLAPI __declspec(dllexport)
  8. #else
  9. #define IPLAPI __attribute__((visibility("default")))
  10. #endif
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /*************************************************************************/
  15. /* Basic Data Types */
  16. /*************************************************************************/
  17. /* Elementary data types. */
  18. typedef void IPLvoid;
  19. typedef char IPLint8;
  20. typedef unsigned char IPLuint8;
  21. typedef short IPLint16;
  22. typedef unsigned short IPLuint16;
  23. typedef int IPLint32;
  24. typedef unsigned int IPLuint32;
  25. typedef long long IPLint64;
  26. typedef unsigned long long IPLuint64;
  27. typedef float IPLfloat32;
  28. typedef double IPLfloat64;
  29. typedef unsigned char IPLbyte;
  30. typedef size_t IPLsize;
  31. typedef char* IPLstring;
  32. /* Boolean values. */
  33. typedef enum {
  34. IPL_FALSE,
  35. IPL_TRUE
  36. } IPLbool;
  37. /* Opaque object handles. */
  38. typedef void* IPLhandle;
  39. /* Status codes. */
  40. typedef enum {
  41. IPL_STATUS_SUCCESS,
  42. IPL_STATUS_FAILURE,
  43. IPL_STATUS_OUTOFMEMORY,
  44. IPL_STATUS_INITIALIZATION
  45. } IPLerror;
  46. /*************************************************************************/
  47. /* Context */
  48. /*************************************************************************/
  49. /* Logger function prototype. */
  50. typedef IPLvoid (*IPLLogFunction)(char* message);
  51. /* Memory allocator function prototypes. */
  52. typedef IPLvoid* (*IPLAllocateFunction)(IPLsize, IPLsize);
  53. typedef IPLvoid (*IPLFreeFunction)(IPLvoid*);
  54. /* Context data structure. */
  55. typedef struct {
  56. IPLLogFunction logCallback;
  57. IPLAllocateFunction allocateCallback;
  58. IPLFreeFunction freeCallback;
  59. } IPLGlobalContext;
  60. /*************************************************************************/
  61. /* Geometric Types */
  62. /*************************************************************************/
  63. /* Points in 3D space. */
  64. typedef struct {
  65. IPLfloat32 x;
  66. IPLfloat32 y;
  67. IPLfloat32 z;
  68. } IPLVector3;
  69. /*************************************************************************/
  70. /* Audio Buffers */
  71. /*************************************************************************/
  72. /* Whether the audio buffer is Ambisonics or not. */
  73. typedef enum {
  74. IPL_CHANNELLAYOUTTYPE_SPEAKERS,
  75. IPL_CHANNELLAYOUTTYPE_AMBISONICS
  76. } IPLChannelLayoutType;
  77. /* For speaker-based layouts, the type of layout used. */
  78. typedef enum {
  79. IPL_CHANNELLAYOUT_MONO,
  80. IPL_CHANNELLAYOUT_STEREO,
  81. IPL_CHANNELLAYOUT_QUADRAPHONIC,
  82. IPL_CHANNELLAYOUT_FIVEPOINTONE,
  83. IPL_CHANNELLAYOUT_SEVENPOINTONE,
  84. IPL_CHANNELLAYOUT_CUSTOM
  85. } IPLChannelLayout;
  86. /* The different possible orderings of Ambisonics channels. */
  87. typedef enum {
  88. IPL_AMBISONICSORDERING_FURSEMALHAM,
  89. IPL_AMBISONICSORDERING_ACN
  90. } IPLAmbisonicsOrdering;
  91. /* The different possible normalization conventions for Ambisonics. */
  92. typedef enum {
  93. IPL_AMBISONICSNORMALIZATION_FURSEMALHAM,
  94. IPL_AMBISONICSNORMALIZATION_SN3D,
  95. IPL_AMBISONICSNORMALIZATION_N3D
  96. } IPLAmbisonicsNormalization;
  97. /* Whether the data is interleaved or deinterleaved. */
  98. typedef enum {
  99. IPL_CHANNELORDER_INTERLEAVED,
  100. IPL_CHANNELORDER_DEINTERLEAVED
  101. } IPLChannelOrder;
  102. /* The format of an audio buffer. */
  103. typedef struct {
  104. IPLChannelLayoutType channelLayoutType;
  105. IPLChannelLayout channelLayout;
  106. IPLint32 numSpeakers;
  107. IPLVector3* speakerDirections;
  108. IPLint32 ambisonicsOrder;
  109. IPLAmbisonicsOrdering ambisonicsOrdering;
  110. IPLAmbisonicsNormalization ambisonicsNormalization;
  111. IPLChannelOrder channelOrder;
  112. } IPLAudioFormat;
  113. /* An audio buffer. */
  114. typedef struct {
  115. IPLAudioFormat format;
  116. IPLint32 numSamples;
  117. IPLfloat32* interleavedBuffer;
  118. IPLfloat32** deinterleavedBuffer;
  119. } IPLAudioBuffer;
  120. /*************************************************************************/
  121. /* DSP Parameters */
  122. /*************************************************************************/
  123. /* Properties of the DSP pipeline. */
  124. typedef struct {
  125. IPLint32 samplingRate;
  126. IPLint32 frameSize;
  127. } IPLDspParams;
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131. #endif