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.

392 lines
12 KiB

  1. //************************************************************************
  2. //**
  3. //** THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  4. //** ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
  5. //** TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
  6. //** A PARTICULAR PURPOSE.
  7. //**
  8. //** Copyright (c) 1993-1995 Microsoft Corporation
  9. //**
  10. //** IDF.h
  11. //**
  12. //** DESCRIPTION:
  13. //** This file contains the format of the .IDF files.
  14. //**
  15. //** HISTORY:
  16. //** 04/29/93 created.
  17. //** 07/04/93 added UNICODE for displayable strings.
  18. //** 09/04/93 added keymaps.
  19. //** 09/05/93 added ID's for channel types.
  20. //**
  21. //************************************************************************
  22. /*
  23. @doc EXTERNAL SDK
  24. @types IDFHEADER |
  25. This is the format of the "hdr " chunk in a Microsoft IDF file.
  26. This will be the first subchunk of a "MMAP" list chunk. This will
  27. provide information on the IDF itself; what version, who created it,
  28. and a unique ASCII ID for the instrument.
  29. @field DWORD | cbStruct |
  30. This is the inclusive size of the header structure.
  31. @field DWORD | dwVersion |
  32. This is the version of the IDF file.
  33. under.
  34. @field DWORD | dwCreator |
  35. This is the creator ID for the IDF.
  36. @field DWORD | cbInstID |
  37. This is the size of the unique instrument identifier including the NULL.
  38. @field BYTE | abInstID[] |
  39. This is the actual ASCII bytes of the unique instrument id. This _IS_
  40. NULL terminated. There is no UNICODE version of this since this will
  41. only be used internally and not displayed to the user.
  42. @othertype IDFHEADER * | PIDFHEADER |
  43. A memory model dependant pointer to the structure.
  44. @othertype IDFHEADER FAR* | LPIDFHEADER |
  45. A far pointer to the structure.
  46. */
  47. typedef struct tag_IDFHEADER
  48. {
  49. DWORD cbStruct;
  50. DWORD dwVersion;
  51. DWORD dwCreator;
  52. DWORD cbInstID;
  53. BYTE abInstID[1];
  54. } IDFHEADER, *PIDFHEADER, FAR *LPIDFHEADER;
  55. /*
  56. @doc EXTERNAL SDK
  57. @types IDFINSTINFO |
  58. This is the format of the "inst" chunk in a Microsoft IDF file.
  59. This chunk will contain information on the instrument, e.g. who
  60. manufactured it, the name of the instrument, it's manufacturer and
  61. product id's and a revision number.
  62. @field DWORD | cbStruct |
  63. This is the inclusive size of the instrument information structure.
  64. @field DWORD | dwManufactID |
  65. Manufacturer's ID.
  66. @field DWORD | dwProductID |
  67. Product's ID.
  68. @field DWORD | dwRevision |
  69. Revision of the product.
  70. @field DWORD | cbManufactASCII |
  71. Length of the ASCII version of the manufacturuers name.
  72. @field DWORD | cbManufactUNICODE |
  73. Length of the UNICODE version of the manufacturuers name.
  74. @field DWORD | cbProductASCII |
  75. Length of the ASCII version of the product name.
  76. @field DWORD | cbProductUNICODE |
  77. Length of the UNICODE version of the product name.
  78. @field BYTE | abData[] |
  79. Contains the ASCII and UNICODE strings for the manufacturer and product
  80. names. NOTE that all strings are separated by a NULL and the NULL IS
  81. counted in the string lengths.
  82. @othertype IDFINSTINFO * | PIDFINSTINFO |
  83. A memory model dependant pointer to the structure.
  84. @othertype IDFINSTINFO FAR * | LPIDFINSTINFO |
  85. A far pointer to the structure.
  86. @comm The idea is that the cbManufactXXXXX and cbProductXXXXX will be the
  87. offsets into the bData array of bytes and it will contain a complete
  88. string that you can strcpy out. That is why the NULL is included in
  89. the byte count and in the actual data.
  90. */
  91. typedef struct tag_IDFINSTINFO
  92. {
  93. DWORD cbStruct;
  94. DWORD dwManufactID;
  95. DWORD dwProductID;
  96. DWORD dwRevision;
  97. DWORD cbManufactASCII;
  98. DWORD cbManufactUNICODE;
  99. DWORD cbProductASCII;
  100. DWORD cbProductUNICODE;
  101. BYTE abData[1];
  102. } IDFINSTINFO, FAR *LPIDFINSTINFO;
  103. /*
  104. @doc EXTERNAL SDK
  105. @types IDFINSTCAPS |
  106. This is the format of the "caps" chunk in a Microsoft IDF file.
  107. This chunk will contain information on the MIDI capabilities of
  108. the device. e.g. basic channel of the instrument, number of channels
  109. that the instrument has available. the polyphony of the instrument,
  110. whether or not it supports General MIDI, etc....
  111. @field DWORD | cbStruct |
  112. This is the size of the capabilities structure.
  113. @field DWORD | fdwFlags |
  114. Flags specifiying additional capabilities of an instrument.
  115. @flag IDFINSTCAPS_F_GENERAL_MIDI |
  116. Instrument supports General MIDI.
  117. @flag IDFINSTCAPS_F_SYSTEMEXCLUSIVE |
  118. Instrument supports system exclusive messages
  119. @field DWORD | dwBasicChannel |
  120. The basic channel for the instrument.
  121. @field DWORD | cNumChannels |
  122. Number of channels that the instrument supports to.
  123. @field DWORD | cInstrumentPolyphony |
  124. The total polyphony for the instrument.
  125. @field DWORD | cChannelPolyphony |
  126. The polyphony per channel.
  127. @othertype IDFINSTCAPS * | PIDFINSTCAPS |
  128. A memory model dependant pointer to the structure.
  129. @othertype IDFINSTCAPS FAR * | LPIDFINSTCAPS |
  130. A far pointer to the structure.
  131. */
  132. typedef struct tag_IDFINSTCAPS
  133. {
  134. DWORD cbStruct;
  135. DWORD fdwFlags;
  136. DWORD dwBasicChannel;
  137. DWORD cNumChannels;
  138. DWORD cInstrumentPolyphony;
  139. DWORD cChannelPolyphony;
  140. } IDFINSTCAPS, *PIDFINSTCAPS, FAR *LPIDFINSTCAPS;
  141. #define IDFINSTCAPS_F_GENERAL_MIDI 0x00000001
  142. #define IDFINSTCAPS_F_SYSTEMEXCLUSIVE 0x00000002
  143. /*
  144. @doc EXTERNAL SDK
  145. @types IDFCHANNELHDR |
  146. This is the format of the "chan" chunk in a Microsoft IDF file.
  147. This contains a description on what "type" a channel is, i.e.
  148. is it a General MIDI channel, a drum channel, etc... Directly
  149. following this header is the actual data on each channel.
  150. @field DWORD | cbStruct |
  151. This is the size of the channel header structure.
  152. @field DWORD | fdwFlags |
  153. Flags describing the channel type information.
  154. @flag IDFCHANNELHDR_F_GENERAL_MIDI |
  155. If this flag is set then any channels that are not defined in the
  156. IDF are General MIDI channel types. If this flag is _NOT_ set then
  157. any channels that are not defined in the IDF are undefined and should
  158. NOT be used in mapping. This flag overrides the contents of dwGeneralMask
  159. and dwDrumMask.
  160. @field DWORD | dwGeneralMask |
  161. This mask indicates which channels are available for
  162. use as general channels. The channels will be considered usable even if
  163. there is no associcate IDFCHANNELINFO structure defined.
  164. @field DWORD | dwDrumMask |
  165. This mask indicates which channels are available for
  166. use as drum channels. The channels will be considered usable even if
  167. there is no associcate IDFCHANNELINFO structure defined.
  168. @field DWORD | cNumChannels |
  169. This is the number of channels that follows the header.
  170. @othertype IDFCHANNELHDR * | PIDFCHANNELHDR |
  171. A memory model dependant pointer to the structure.
  172. @othertype IDFCHANNELHDR FAR * | LPIDFCHANNELHDR |
  173. A far pointer to the structure.
  174. */
  175. typedef struct tag_IDFCHANNELHDR
  176. {
  177. DWORD cbStruct;
  178. DWORD dwGeneralMask;
  179. DWORD dwDrumMask;
  180. DWORD dwReserved; // Must be zero
  181. DWORD fdwFlags;
  182. } IDFCHANNELHDR, *PIDFCHANNELHDR, FAR *LPIDFCHANNELHDR;
  183. #define IDFCHANNELHDR_F_GENERAL_MIDI 0x00000001
  184. /*
  185. @doc EXTERNAL SDK
  186. @types IDFCHANNELINFO |
  187. This is the format of the actual channel information for Microsoft
  188. authored IDF files. This is the Microsoft supported format for
  189. channel information.
  190. @field DWORD | dwChannel |
  191. This is the channel number that the structure defines.
  192. @field DWORD | fdwChannel |
  193. Defines the possible types this channel can be.
  194. @flag IDFCHANNELINFO_F_GENERAL_CHANNEL |
  195. Indicates that this channel may be a general channel.
  196. @flag IDFCHANNELINFO_F_DRUM_CHANNEL |
  197. Indicates that this channel may be a drum channel.
  198. @field DWORD | cbInitData |
  199. Specifies the length of the data which should be sent to initialize
  200. the channel. This data will be send to initialize the channel each
  201. time the mapper is opened.
  202. @field BYTE | abData[] |
  203. This field contains the actual initialization data.
  204. <f cbInitData> should indicate the length of this sequence,
  205. byte aligned. However, the actual sequence should be padded so that
  206. it is actually DWORD aligned (i.e. even multiple
  207. of four bytes). <f cbStruct> should reflect the padded length of
  208. the sequences.
  209. @othertype IDFCHANNELINFO * | PIDFCHANNELINFO |
  210. A memory model dependant pointer to the structure.
  211. @othertype IDFCHANNELINFO FAR * | LPIDFCHANNELINFO |
  212. A far pointer to the structure.
  213. */
  214. typedef struct tag_IDFCHANNELINFO
  215. {
  216. DWORD cbStruct;
  217. DWORD dwChannel;
  218. DWORD cbInitData;
  219. BYTE abData[];
  220. } IDFCHANNELINFO, *PIDFCHANNELINFO, FAR *LPIDFCHANNELINFO;
  221. /*
  222. @doc EXTERNAL SDK
  223. @types IDFPATCHMAPHDR |
  224. This is the format of the "map " chunk in a Microsoft IDF file.
  225. This chunk contains information on the patch map used for the
  226. instrument. Directly following this header is the actual mapping
  227. information for each patch.
  228. @field DWORD | cbStruct |
  229. This is the size of the patch map header structure.
  230. @field BYTE | abPatchMap[128] |
  231. This array contains the actual patch map. The incoming patch is
  232. used to index the array; the array contents are the new patch value
  233. and must be in the range 0x00-0x7F. Patch maps will only apply to
  234. channels of type general. If the instrument needs a patch change
  235. on a drum channel, it should be included in the initialization data
  236. in the IDFCHANNELINFO.
  237. @othertype IDFPATCHMAPHDR * | PIDFPATCHMAPHDR |
  238. A memory model dependant pointer to the structure.
  239. @othertype IDFPATCHMAPHDR FAR * | LPIDFPATCHMAPHDR |
  240. A far pointer to the structure.
  241. */
  242. typedef struct tag_IDFPATCHMAPHDR
  243. {
  244. DWORD cbStruct;
  245. BYTE abPatchMap[128];
  246. } IDFPATCHMAPHDR, *PIDFPATCHMAPHDR, FAR *LPIDFPATCHMAPHDR;
  247. /*
  248. @doc EXTERNAL SDK
  249. @types IDFKEYMAPHDR |
  250. This is the format of the "key " chunk in a Microsoft IDF file.
  251. This chunk contains information on the all of the key maps used
  252. for a given instrument. The information that is in this structure
  253. pertains to all of the key maps for the instrument. It contains
  254. the total number of key maps for the instrument and whether or not
  255. the key maps are General MIDI.
  256. @field DWORD | cbStruct |
  257. This is the size of the key map header structure.
  258. @field DWORD | cNumKeyMaps |
  259. This is the number of key maps that follow the header.
  260. @field DWORD | cbKeyMap |
  261. This is the size of each key map that follows the header.
  262. @othertype IDFPATCHMAPHDR * | PIDFPATCHMAPHDR |
  263. A memory model dependant pointer to the structure.
  264. @othertype IDFPATCHMAPHDR FAR * | LPIDFPATCHMAPHDR |
  265. A far pointer to the structure.
  266. */
  267. typedef struct tag_IDFKEYMAPHDR
  268. {
  269. DWORD cbStruct;
  270. DWORD cNumKeyMaps;
  271. DWORD cbKeyMap;
  272. } IDFKEYMAPHDR, *PIDFKEYMAPHDR, FAR *LPIDFKEYMAPHDR;
  273. /*
  274. @doc EXTERNAL SDK
  275. @types IDFKEYMAP |
  276. This is the format of the "gkey" or "dkey" chunk in a Microsoft
  277. IDF file. This chunk contains information on the all of the key maps
  278. used for a given instrument. The information that is in this structure
  279. pertains to all of the key maps for the instrument. It contains
  280. the total number of key maps for the instrument and whether or not
  281. the key maps are General MIDI.
  282. @field DWORD | cbStruct |
  283. This is the size of the key map header structure.
  284. @field BYTE | abKeyMap[128] |
  285. This field contains the actual key map. The incoming key number from
  286. a note on or note off message is used to index this array; the array
  287. contents are the new key value. If the high bit it set in the new
  288. key value, then the note on or note off will be ignore; otherwise,
  289. it will be transmitted with the new key value.
  290. @othertype IDFKEYMAP * | PIDFKEYMAP |
  291. A memory model dependant pointer to the structure.
  292. @othertype IDFKEYMAP FAR * | LPIDFKEYMAP |
  293. A far pointer to the structure.
  294. */
  295. typedef struct tag_IDFKEYMAP
  296. {
  297. DWORD cbStruct;
  298. BYTE abKeyMap[128];
  299. } IDFKEYMAP, *PIDFKEYMAP, FAR *LPIDFKEYMAP;