Leaked source code of windows server 2003
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.

177 lines
6.5 KiB

  1. /************************************************************************
  2. * *
  3. * dmdls.h -- DLS download definitions for DirectMusic API's *
  4. * *
  5. * Copyright (c) 1998, Microsoft Corp. 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. #define DMUS_DEFAULT_SIZE_OFFSETTABLE 1
  34. /* Flags for DMUS_INSTRUMENT's ulFlags member */
  35. #define DMUS_INSTRUMENT_GM_INSTRUMENT (1 << 0)
  36. typedef struct _DMUS_OFFSETTABLE
  37. {
  38. ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
  39. } DMUS_OFFSETTABLE;
  40. typedef struct _DMUS_INSTRUMENT
  41. {
  42. ULONG ulPatch;
  43. ULONG ulFirstRegionIdx;
  44. ULONG ulGlobalArtIdx; /* If zero the instrument does not have an articulation */
  45. ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the instrument */
  46. ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the instrument */
  47. ULONG ulFlags;
  48. } DMUS_INSTRUMENT;
  49. typedef struct _DMUS_REGION
  50. {
  51. RGNRANGE RangeKey;
  52. RGNRANGE RangeVelocity;
  53. USHORT fusOptions;
  54. USHORT usKeyGroup;
  55. ULONG ulRegionArtIdx; /* If zero the region does not have an articulation */
  56. ULONG ulNextRegionIdx; /* If zero no more regions */
  57. ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the region */
  58. WAVELINK WaveLink;
  59. WSMPL WSMP; /* If WSMP.cSampleLoops > 1 then a WLOOP is included */
  60. WLOOP WLOOP[1];
  61. } DMUS_REGION;
  62. typedef struct _DMUS_LFOPARAMS
  63. {
  64. PCENT pcFrequency;
  65. TCENT tcDelay;
  66. GCENT gcVolumeScale;
  67. PCENT pcPitchScale;
  68. GCENT gcMWToVolume;
  69. PCENT pcMWToPitch;
  70. } DMUS_LFOPARAMS;
  71. typedef struct _DMUS_VEGPARAMS
  72. {
  73. TCENT tcAttack;
  74. TCENT tcDecay;
  75. PERCENT ptSustain;
  76. TCENT tcRelease;
  77. TCENT tcVel2Attack;
  78. TCENT tcKey2Decay;
  79. } DMUS_VEGPARAMS;
  80. typedef struct _DMUS_PEGPARAMS
  81. {
  82. TCENT tcAttack;
  83. TCENT tcDecay;
  84. PERCENT ptSustain;
  85. TCENT tcRelease;
  86. TCENT tcVel2Attack;
  87. TCENT tcKey2Decay;
  88. PCENT pcRange;
  89. } DMUS_PEGPARAMS;
  90. typedef struct _DMUS_MSCPARAMS
  91. {
  92. PERCENT ptDefaultPan;
  93. } DMUS_MSCPARAMS;
  94. typedef struct _DMUS_ARTICPARAMS
  95. {
  96. DMUS_LFOPARAMS LFO;
  97. DMUS_VEGPARAMS VolEG;
  98. DMUS_PEGPARAMS PitchEG;
  99. DMUS_MSCPARAMS Misc;
  100. } DMUS_ARTICPARAMS;
  101. typedef struct _DMUS_ARTICULATION /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. */
  102. {
  103. ULONG ulArt1Idx; /* DLS Level 1 articulation chunk */
  104. ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */
  105. } DMUS_ARTICULATION;
  106. typedef struct _DMUS_ARTICULATION2 /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. */
  107. {
  108. ULONG ulArtIdx; /* DLS Level 1/2 articulation chunk */
  109. ULONG ulFirstExtCkIdx; /* 3rd party extenstion chunks associated with the articulation */
  110. ULONG ulNextArtIdx; /* Additional articulation chunks */
  111. } DMUS_ARTICULATION2;
  112. #define DMUS_MIN_DATA_SIZE 4
  113. /* The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK */
  114. typedef struct _DMUS_EXTENSIONCHUNK
  115. {
  116. ULONG cbSize; /* Size of extension chunk */
  117. ULONG ulNextExtCkIdx; /* If zero no more 3rd party entenstion chunks */
  118. FOURCC ExtCkID;
  119. BYTE byExtCk[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */
  120. } DMUS_EXTENSIONCHUNK;
  121. /* The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */
  122. typedef struct _DMUS_COPYRIGHT
  123. {
  124. ULONG cbSize; /* Size of copyright information */
  125. BYTE byCopyright[DMUS_MIN_DATA_SIZE]; /* The actual number that follows is determined by cbSize */
  126. } DMUS_COPYRIGHT;
  127. typedef struct _DMUS_WAVEDATA
  128. {
  129. ULONG cbSize;
  130. BYTE byData[DMUS_MIN_DATA_SIZE];
  131. } DMUS_WAVEDATA;
  132. typedef struct _DMUS_WAVE
  133. {
  134. ULONG ulFirstExtCkIdx; /* If zero no 3rd party entenstion chunks associated with the wave */
  135. ULONG ulCopyrightIdx; /* If zero no Copyright information associated with the wave */
  136. ULONG ulWaveDataIdx; /* Location of actual wave data. */
  137. WAVEFORMATEX WaveformatEx;
  138. } DMUS_WAVE;
  139. typedef struct _DMUS_NOTERANGE *LPDMUS_NOTERANGE;
  140. typedef struct _DMUS_NOTERANGE
  141. {
  142. DWORD dwLowNote; /* Sets the low note for the range of MIDI note events to which the instrument responds.*/
  143. DWORD dwHighNote; /* Sets the high note for the range of MIDI note events to which the instrument responds.*/
  144. } DMUS_NOTERANGE;
  145. #endif