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.

199 lines
7.2 KiB

  1. /************************************************************************
  2. * *
  3. * dmdls.h -- DLS download definitions for DirectMusic API's *
  4. * *
  5. * Copyright (c) Microsoft Corporation. All rights reserved. *
  6. * *
  7. ************************************************************************/
  8. #ifndef _DMDLS_
  9. #define _DMDLS_
  10. #include "dls1.h"
  11. typedef long PCENT; /* Pitch cents */
  12. typedef long GCENT; /* Gain cents */
  13. typedef long TCENT; /* Time cents */
  14. typedef long PERCENT; /* Per.. cent! */
  15. typedef LONGLONG REFERENCE_TIME;
  16. typedef REFERENCE_TIME *LPREFERENCE_TIME;
  17. #ifndef MAKE_FOURCC
  18. #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
  19. ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
  20. ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  21. typedef DWORD FOURCC; /* a four character code */
  22. #endif
  23. typedef struct _DMUS_DOWNLOADINFO
  24. {
  25. DWORD dwDLType; /* Instrument or Wave */
  26. DWORD dwDLId; /* Unique identifier to tag this download. */
  27. DWORD dwNumOffsetTableEntries; /* Number of index in the offset address table. */
  28. DWORD cbSize; /* Total size of this memory chunk. */
  29. } DMUS_DOWNLOADINFO;
  30. #define DMUS_DOWNLOADINFO_INSTRUMENT 1
  31. #define DMUS_DOWNLOADINFO_WAVE 2
  32. #define DMUS_DOWNLOADINFO_INSTRUMENT2 3 /* New version for better DLS2 support. */
  33. /* Support for oneshot and streaming wave data
  34. */
  35. #define DMUS_DOWNLOADINFO_WAVEARTICULATION 4 /* Wave articulation data */
  36. #define DMUS_DOWNLOADINFO_STREAMINGWAVE 5 /* One chunk of a streaming */
  37. #define DMUS_DOWNLOADINFO_ONESHOTWAVE 6
  38. #define DMUS_DEFAULT_SIZE_OFFSETTABLE 1
  39. /* Flags for DMUS_INSTRUMENT's ulFlags member */
  40. #define DMUS_INSTRUMENT_GM_INSTRUMENT (1 << 0)
  41. typedef struct _DMUS_OFFSETTABLE
  42. {
  43. ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
  44. } DMUS_OFFSETTABLE;
  45. typedef struct _DMUS_INSTRUMENT
  46. {
  47. ULONG ulPatch;
  48. ULONG ulFirstRegionIdx;
  49. ULONG ulGlobalArtIdx; /* If zero the instrument does not have an articulation */
  50. ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the instrument */
  51. ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the instrument */
  52. ULONG ulFlags;
  53. } DMUS_INSTRUMENT;
  54. typedef struct _DMUS_REGION
  55. {
  56. RGNRANGE RangeKey;
  57. RGNRANGE RangeVelocity;
  58. USHORT fusOptions;
  59. USHORT usKeyGroup;
  60. ULONG ulRegionArtIdx; /* If zero the region does not have an articulation */
  61. ULONG ulNextRegionIdx; /* If zero no more regions */
  62. ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the region */
  63. WAVELINK WaveLink;
  64. WSMPL WSMP; /* If WSMP.cSampleLoops > 1 then a WLOOP is included */
  65. WLOOP WLOOP[1];
  66. } DMUS_REGION;
  67. typedef struct _DMUS_LFOPARAMS
  68. {
  69. PCENT pcFrequency;
  70. TCENT tcDelay;
  71. GCENT gcVolumeScale;
  72. PCENT pcPitchScale;
  73. GCENT gcMWToVolume;
  74. PCENT pcMWToPitch;
  75. } DMUS_LFOPARAMS;
  76. typedef struct _DMUS_VEGPARAMS
  77. {
  78. TCENT tcAttack;
  79. TCENT tcDecay;
  80. PERCENT ptSustain;
  81. TCENT tcRelease;
  82. TCENT tcVel2Attack;
  83. TCENT tcKey2Decay;
  84. } DMUS_VEGPARAMS;
  85. typedef struct _DMUS_PEGPARAMS
  86. {
  87. TCENT tcAttack;
  88. TCENT tcDecay;
  89. PERCENT ptSustain;
  90. TCENT tcRelease;
  91. TCENT tcVel2Attack;
  92. TCENT tcKey2Decay;
  93. PCENT pcRange;
  94. } DMUS_PEGPARAMS;
  95. typedef struct _DMUS_MSCPARAMS
  96. {
  97. PERCENT ptDefaultPan;
  98. } DMUS_MSCPARAMS;
  99. typedef struct _DMUS_ARTICPARAMS
  100. {
  101. DMUS_LFOPARAMS LFO;
  102. DMUS_VEGPARAMS VolEG;
  103. DMUS_PEGPARAMS PitchEG;
  104. DMUS_MSCPARAMS Misc;
  105. } DMUS_ARTICPARAMS;
  106. typedef struct _DMUS_ARTICULATION /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. */
  107. {
  108. ULONG ulArt1Idx; /* DLS Level 1 articulation chunk */
  109. ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */
  110. } DMUS_ARTICULATION;
  111. typedef struct _DMUS_ARTICULATION2 /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. */
  112. {
  113. ULONG ulArtIdx; /* DLS Level 1/2 articulation chunk */
  114. ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */
  115. ULONG ulNextArtIdx; /* Additional articulation chunks */
  116. } DMUS_ARTICULATION2;
  117. #define DMUS_MIN_DATA_SIZE 4
  118. /* The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK */
  119. typedef struct _DMUS_EXTENSIONCHUNK
  120. {
  121. ULONG cbSize; /* Size of extension chunk */
  122. ULONG ulNextExtCkIdx; /* If zero no more 3rd party entenstion chunks */
  123. FOURCC ExtCkID;
  124. BYTE byExtCk[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */
  125. } DMUS_EXTENSIONCHUNK;
  126. /* The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */
  127. typedef struct _DMUS_COPYRIGHT
  128. {
  129. ULONG cbSize; /* Size of copyright information */
  130. BYTE byCopyright[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */
  131. } DMUS_COPYRIGHT;
  132. typedef struct _DMUS_WAVEDATA
  133. {
  134. ULONG cbSize;
  135. BYTE byData[DMUS_MIN_DATA_SIZE];
  136. } DMUS_WAVEDATA;
  137. typedef struct _DMUS_WAVE
  138. {
  139. ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the wave */
  140. ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the wave */
  141. ULONG ulWaveDataIdx; /* Location of actual wave data. */
  142. WAVEFORMATEX WaveformatEx;
  143. } DMUS_WAVE;
  144. typedef struct _DMUS_NOTERANGE *LPDMUS_NOTERANGE;
  145. typedef struct _DMUS_NOTERANGE
  146. {
  147. DWORD dwLowNote; /* Sets the low note for the range of MIDI note events to which the instrument responds.*/
  148. DWORD dwHighNote; /* Sets the high note for the range of MIDI note events to which the instrument responds.*/
  149. } DMUS_NOTERANGE;
  150. typedef struct _DMUS_WAVEARTDL
  151. {
  152. ULONG ulDownloadIdIdx; /* Download ID's of each buffer */
  153. ULONG ulBus; /* Playback bus */
  154. ULONG ulBuffers; /* Buffers */
  155. ULONG ulMasterDLId; /* Download ID of master voice of slave group */
  156. USHORT usOptions; /* Same as DLS2 region options */
  157. } DMUS_WAVEARTDL,
  158. *LPDMUS_WAVEARTDL;
  159. typedef struct _DMUS_WAVEDL
  160. {
  161. ULONG cbWaveData; /* Bytes of wave data */
  162. } DMUS_WAVEDL,
  163. *LPDMUS_WAVEDL;
  164. #endif