dmdls.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /* DirectMusic DLS Download Definitions
  2. *
  3. * Copyright (C) 2003-2004 Rok Mandeljc
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  18. */
  19. #ifndef __WINE_DMUSIC_DLS_H
  20. #define __WINE_DMUSIC_DLS_H
  21. #include <dls1.h>
  22. /*****************************************************************************
  23. * Typedef definitions
  24. */
  25. typedef LONG GCENT;
  26. typedef LONG PCENT;
  27. typedef LONG PERCENT;
  28. typedef LONG TCENT;
  29. typedef LONGLONG REFERENCE_TIME, *LPREFERENCE_TIME;
  30. /*****************************************************************************
  31. * FOURCC definition
  32. */
  33. #ifndef mmioFOURCC
  34. typedef DWORD FOURCC;
  35. #define mmioFOURCC(ch0,ch1,ch2,ch3) \
  36. ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
  37. ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  38. #endif
  39. /*****************************************************************************
  40. * Flags
  41. */
  42. #define DMUS_DEFAULT_SIZE_OFFSETTABLE 0x1
  43. #define DMUS_DOWNLOADINFO_INSTRUMENT 0x1
  44. #define DMUS_DOWNLOADINFO_WAVE 0x2
  45. #define DMUS_DOWNLOADINFO_INSTRUMENT2 0x3
  46. #define DMUS_DOWNLOADINFO_WAVEARTICULATION 0x4
  47. #define DMUS_DOWNLOADINFO_STREAMINGWAVE 0x5
  48. #define DMUS_DOWNLOADINFO_ONESHOTWAVE 0x6
  49. #define DMUS_INSTRUMENT_GM_INSTRUMENT 0x1
  50. #define DMUS_MIN_DATA_SIZE 0x4
  51. /*****************************************************************************
  52. * Structures
  53. */
  54. /* typedef definitions */
  55. typedef struct _DMUS_DOWNLOADINFO DMUS_DOWNLOADINFO, *LPDMUS_DOWNLOADINFO;
  56. typedef struct _DMUS_OFFSETTABLE DMUS_OFFSETTABLE, *LPDMUS_OFFSETTABLE;
  57. typedef struct _DMUS_INSTRUMENT DMUS_INSTRUMENT, *LPDMUS_INSTRUMENT;
  58. typedef struct _DMUS_REGION DMUS_REGION, *LPDMUS_REGION;
  59. typedef struct _DMUS_LFOPARAMS DMUS_LFOPARAMS, *LPDMUS_LFOPARAMS;
  60. typedef struct _DMUS_VEGPARAMS DMUS_VEGPARAMS, *LPDMUS_VEGPARAMS;
  61. typedef struct _DMUS_PEGPARAMS DMUS_PEGPARAMS, *LPDMUS_PEGPARAMS;
  62. typedef struct _DMUS_MSCPARAMS DMUS_MSCPARAMS, *LPDMUS_MSCPARAMS;
  63. typedef struct _DMUS_ARTICPARAMS DMUS_ARTICPARAMS, *LPDMUS_ARTICPARAMS;
  64. typedef struct _DMUS_ARTICULATION DMUS_ARTICULATION, *LPDMUS_ARTICULATION;
  65. typedef struct _DMUS_ARTICULATION2 DMUS_ARTICULATION2, *LPDMUS_ARTICULATION2;
  66. typedef struct _DMUS_EXTENSIONCHUNK DMUS_EXTENSIONCHUNK, *LPDMUS_EXTENSIONCHUNK;
  67. typedef struct _DMUS_COPYRIGHT DMUS_COPYRIGHT, *LPDMUS_COPYRIGHT;
  68. typedef struct _DMUS_WAVEDATA DMUS_WAVEDATA, *LPDMUS_WAVEDATA;
  69. typedef struct _DMUS_WAVE DMUS_WAVE, *LPDMUS_WAVE;
  70. typedef struct _DMUS_NOTERANGE DMUS_NOTERANGE, *LPDMUS_NOTERANGE;
  71. typedef struct _DMUS_WAVEARTDL DMUS_WAVEARTDL, *LPDMUS_WAVEARTDL;
  72. typedef struct _DMUS_WAVEDL DMUS_WAVEDL, *LPDMUS_WAVEDL;
  73. /* actual structures */
  74. struct _DMUS_DOWNLOADINFO {
  75. DWORD dwDLType;
  76. DWORD dwDLId;
  77. DWORD dwNumOffsetTableEntries;
  78. DWORD cbSize;
  79. };
  80. struct _DMUS_OFFSETTABLE {
  81. ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
  82. };
  83. struct _DMUS_INSTRUMENT {
  84. ULONG ulPatch;
  85. ULONG ulFirstRegionIdx;
  86. ULONG ulGlobalArtIdx;
  87. ULONG ulFirstExtCkIdx;
  88. ULONG ulCopyrightIdx;
  89. ULONG ulFlags;
  90. };
  91. struct _DMUS_REGION {
  92. RGNRANGE RangeKey;
  93. RGNRANGE RangeVelocity;
  94. USHORT fusOptions;
  95. USHORT usKeyGroup;
  96. ULONG ulRegionArtIdx;
  97. ULONG ulNextRegionIdx;
  98. ULONG ulFirstExtCkIdx;
  99. WAVELINK WaveLink;
  100. WSMPL WSMP;
  101. /* WLOOP is typedef'ed as struct _rloop in dls1.h. Changed type of
  102. * WLOOP[1] from WLOOP to struct _rloop for __cplusplus compat. */
  103. struct _rloop WLOOP[1];
  104. };
  105. struct _DMUS_LFOPARAMS {
  106. PCENT pcFrequency;
  107. TCENT tcDelay;
  108. GCENT gcVolumeScale;
  109. PCENT pcPitchScale;
  110. GCENT gcMWToVolume;
  111. PCENT pcMWToPitch;
  112. };
  113. struct _DMUS_VEGPARAMS {
  114. TCENT tcAttack;
  115. TCENT tcDecay;
  116. PERCENT ptSustain;
  117. TCENT tcRelease;
  118. TCENT tcVel2Attack;
  119. TCENT tcKey2Decay;
  120. };
  121. struct _DMUS_PEGPARAMS {
  122. TCENT tcAttack;
  123. TCENT tcDecay;
  124. PERCENT ptSustain;
  125. TCENT tcRelease;
  126. TCENT tcVel2Attack;
  127. TCENT tcKey2Decay;
  128. PCENT pcRange;
  129. };
  130. struct _DMUS_MSCPARAMS {
  131. PERCENT ptDefaultPan;
  132. };
  133. struct _DMUS_ARTICPARAMS {
  134. DMUS_LFOPARAMS LFO;
  135. DMUS_VEGPARAMS VolEG;
  136. DMUS_PEGPARAMS PitchEG;
  137. DMUS_MSCPARAMS Misc;
  138. };
  139. struct _DMUS_ARTICULATION {
  140. ULONG ulArt1Idx;
  141. ULONG ulFirstExtCkIdx;
  142. };
  143. struct _DMUS_ARTICULATION2 {
  144. ULONG ulArtIdx;
  145. ULONG ulFirstExtCkIdx;
  146. ULONG ulNextArtIdx;
  147. };
  148. struct _DMUS_EXTENSIONCHUNK {
  149. ULONG cbSize;
  150. ULONG ulNextExtCkIdx;
  151. FOURCC ExtCkID;
  152. BYTE byExtCk[DMUS_MIN_DATA_SIZE];
  153. };
  154. struct _DMUS_COPYRIGHT {
  155. ULONG cbSize;
  156. BYTE byCopyright[DMUS_MIN_DATA_SIZE];
  157. };
  158. struct _DMUS_WAVEDATA {
  159. ULONG cbSize;
  160. BYTE byData[DMUS_MIN_DATA_SIZE];
  161. };
  162. struct _DMUS_WAVE {
  163. ULONG ulFirstExtCkIdx;
  164. ULONG ulCopyrightIdx;
  165. ULONG ulWaveDataIdx;
  166. WAVEFORMATEX WaveformatEx;
  167. };
  168. struct _DMUS_NOTERANGE {
  169. DWORD dwLowNote;
  170. DWORD dwHighNote;
  171. };
  172. struct _DMUS_WAVEARTDL {
  173. ULONG ulDownloadIdIdx;
  174. ULONG ulBus;
  175. ULONG ulBuffers;
  176. ULONG ulMasterDLId;
  177. USHORT usOptions;
  178. };
  179. struct _DMUS_WAVEDL {
  180. ULONG cbWaveData;
  181. };
  182. #endif /* __WINE_DMUSIC_DLS_H */