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.

2199 lines
71 KiB

  1. /************************************************************************
  2. * *
  3. * dmusicf.h -- This module defines the DirectMusic file formats *
  4. * *
  5. * Copyright (c) Microsoft Corporation. All rights reserved. *
  6. * *
  7. ************************************************************************/
  8. #ifndef _DMUSICF_
  9. #define _DMUSICF_
  10. #include <windows.h>
  11. #define COM_NO_WINDOWS_H
  12. #include <objbase.h>
  13. #include <mmsystem.h>
  14. #include <pshpack8.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. interface IDirectMusicCollection;
  19. #ifndef __cplusplus
  20. typedef interface IDirectMusicCollection IDirectMusicCollection;
  21. #endif
  22. /* Common chunks */
  23. #define DMUS_FOURCC_GUID_CHUNK mmioFOURCC('g','u','i','d')
  24. #define DMUS_FOURCC_INFO_LIST mmioFOURCC('I','N','F','O')
  25. #define DMUS_FOURCC_UNFO_LIST mmioFOURCC('U','N','F','O')
  26. #define DMUS_FOURCC_UNAM_CHUNK mmioFOURCC('U','N','A','M')
  27. #define DMUS_FOURCC_UART_CHUNK mmioFOURCC('U','A','R','T')
  28. #define DMUS_FOURCC_UCOP_CHUNK mmioFOURCC('U','C','O','P')
  29. #define DMUS_FOURCC_USBJ_CHUNK mmioFOURCC('U','S','B','J')
  30. #define DMUS_FOURCC_UCMT_CHUNK mmioFOURCC('U','C','M','T')
  31. #define DMUS_FOURCC_CATEGORY_CHUNK mmioFOURCC('c','a','t','g')
  32. #define DMUS_FOURCC_VERSION_CHUNK mmioFOURCC('v','e','r','s')
  33. /* The following structures are used by the Tracks, and are the packed structures */
  34. /* that are passed to the Tracks inside the IStream. */
  35. typedef struct _DMUS_IO_SEQ_ITEM
  36. {
  37. MUSIC_TIME mtTime;
  38. MUSIC_TIME mtDuration;
  39. DWORD dwPChannel;
  40. short nOffset;
  41. BYTE bStatus;
  42. BYTE bByte1;
  43. BYTE bByte2;
  44. } DMUS_IO_SEQ_ITEM;
  45. typedef struct _DMUS_IO_CURVE_ITEM
  46. {
  47. MUSIC_TIME mtStart;
  48. MUSIC_TIME mtDuration;
  49. MUSIC_TIME mtResetDuration;
  50. DWORD dwPChannel;
  51. short nOffset;
  52. short nStartValue;
  53. short nEndValue;
  54. short nResetValue;
  55. BYTE bType;
  56. BYTE bCurveShape;
  57. BYTE bCCData;
  58. BYTE bFlags;
  59. /* Following was added for DirectX8. */
  60. WORD wParamType; /* RPN or NRPN parameter number. */
  61. WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.) */
  62. } DMUS_IO_CURVE_ITEM;
  63. typedef struct _DMUS_IO_TEMPO_ITEM
  64. {
  65. MUSIC_TIME lTime;
  66. double dblTempo;
  67. } DMUS_IO_TEMPO_ITEM;
  68. typedef struct _DMUS_IO_SYSEX_ITEM
  69. {
  70. MUSIC_TIME mtTime;
  71. DWORD dwPChannel;
  72. DWORD dwSysExLength;
  73. } DMUS_IO_SYSEX_ITEM;
  74. typedef DMUS_CHORD_KEY DMUS_CHORD_PARAM; /* DMUS_CHORD_KEY defined in dmusici.h */
  75. typedef struct _DMUS_RHYTHM_PARAM
  76. {
  77. DMUS_TIMESIGNATURE TimeSig;
  78. DWORD dwRhythmPattern;
  79. } DMUS_RHYTHM_PARAM;
  80. typedef struct _DMUS_TEMPO_PARAM
  81. {
  82. MUSIC_TIME mtTime;
  83. double dblTempo;
  84. } DMUS_TEMPO_PARAM;
  85. typedef struct _DMUS_MUTE_PARAM
  86. {
  87. DWORD dwPChannel;
  88. DWORD dwPChannelMap;
  89. BOOL fMute;
  90. } DMUS_MUTE_PARAM;
  91. /* Style chunks */
  92. #define DMUS_FOURCC_STYLE_FORM mmioFOURCC('D','M','S','T')
  93. #define DMUS_FOURCC_STYLE_CHUNK mmioFOURCC('s','t','y','h')
  94. #define DMUS_FOURCC_PART_LIST mmioFOURCC('p','a','r','t')
  95. #define DMUS_FOURCC_PART_CHUNK mmioFOURCC('p','r','t','h')
  96. #define DMUS_FOURCC_NOTE_CHUNK mmioFOURCC('n','o','t','e')
  97. #define DMUS_FOURCC_CURVE_CHUNK mmioFOURCC('c','r','v','e')
  98. #define DMUS_FOURCC_MARKER_CHUNK mmioFOURCC('m','r','k','r')
  99. #define DMUS_FOURCC_RESOLUTION_CHUNK mmioFOURCC('r','s','l','n')
  100. #define DMUS_FOURCC_ANTICIPATION_CHUNK mmioFOURCC('a','n','p','n')
  101. #define DMUS_FOURCC_PATTERN_LIST mmioFOURCC('p','t','t','n')
  102. #define DMUS_FOURCC_PATTERN_CHUNK mmioFOURCC('p','t','n','h')
  103. #define DMUS_FOURCC_RHYTHM_CHUNK mmioFOURCC('r','h','t','m')
  104. #define DMUS_FOURCC_PARTREF_LIST mmioFOURCC('p','r','e','f')
  105. #define DMUS_FOURCC_PARTREF_CHUNK mmioFOURCC('p','r','f','c')
  106. #define DMUS_FOURCC_STYLE_PERS_REF_LIST mmioFOURCC('p','r','r','f')
  107. #define DMUS_FOURCC_MOTIFSETTINGS_CHUNK mmioFOURCC('m','t','f','s')
  108. /* Flags used by variations: these make up the DWORDs in dwVariationChoices. */
  109. /* These flags determine the types of chords supported by a given variation in DirectMusic */
  110. /* mode. The first seven flags (bits 1-7) are set if the variation supports major chords */
  111. /* rooted in scale positions, so, e.g., if bits 1, 2, and 4 are set, the variation */
  112. /* supports major chords rooted in the tonic, second, and fourth scale positions. The */
  113. /* next seven flags serve the same purpose, but for minor chords, and the following seven */
  114. /* flags serve the same purpose for chords that are not major or minor (e.g., SUS 4 */
  115. /* chords). Bits 22, 23, and 24 are set if the variation supports chords rooted in the */
  116. /* scale, chords rooted sharp of scale tones, and chords rooted flat of scale tones, */
  117. /* respectively. For example, to support a C# minor chord in the scale of C Major, */
  118. /* bits 8 (for tonic minor) and 24 (for sharp) need to be set. Bits 25, 26, an 27 handle */
  119. /* chords that are triads, 6th or 7th chords, and chords with extensions, respectively. */
  120. /* bits 28 and 29 handle chords that are followed by tonic and dominant chords, */
  121. /* respectively. */
  122. #define DMUS_VARIATIONF_MAJOR 0x0000007F /* Seven positions in the scale - major chords. */
  123. #define DMUS_VARIATIONF_MINOR 0x00003F80 /* Seven positions in the scale - minor chords. */
  124. #define DMUS_VARIATIONF_OTHER 0x001FC000 /* Seven positions in the scale - other chords. */
  125. #define DMUS_VARIATIONF_ROOT_SCALE 0x00200000 /* Handles chord roots in the scale. */
  126. #define DMUS_VARIATIONF_ROOT_FLAT 0x00400000 /* Handles flat chord roots (based on scale notes). */
  127. #define DMUS_VARIATIONF_ROOT_SHARP 0x00800000 /* Handles sharp chord roots (based on scale notes). */
  128. #define DMUS_VARIATIONF_TYPE_TRIAD 0x01000000 /* Handles simple chords - triads. */
  129. #define DMUS_VARIATIONF_TYPE_6AND7 0x02000000 /* Handles simple chords - 6 and 7. */
  130. #define DMUS_VARIATIONF_TYPE_COMPLEX 0x04000000 /* Handles complex chords. */
  131. #define DMUS_VARIATIONF_DEST_TO1 0x08000000 /* Handles transitions to 1 chord. */
  132. #define DMUS_VARIATIONF_DEST_TO5 0x10000000 /* Handles transitions to 5 chord. */
  133. #define DMUS_VARIATIONF_DEST_OTHER 0x40000000 /* Handles transitions to chords other than 1 . */
  134. /* legacy mask for variation modes */
  135. #define DMUS_VARIATIONF_MODES 0xE0000000
  136. /* Bits 29 and 31 of the variation flags are the Mode bits. If both are 0, it's IMA. */
  137. /* If bit 29 is 1, it's Direct Music. */
  138. #define DMUS_VARIATIONF_MODES_EX (0x20000000 | 0x80000000)
  139. #define DMUS_VARIATIONF_IMA25_MODE 0x00000000
  140. #define DMUS_VARIATIONF_DMUS_MODE 0x20000000
  141. /* Set this if the part uses marker events */
  142. #define DMUS_PARTF_USE_MARKERS 0x1
  143. /* Set this if the part is allowed to switch only on chord-aligned markers */
  144. #define DMUS_PARTF_ALIGN_CHORDS 0x2
  145. /* These specify if the marker event signals whether to stop a variation or start a
  146. pattern/variation (or both), and whether new variations must align with a chord */
  147. #define DMUS_MARKERF_START 0x1
  148. #define DMUS_MARKERF_STOP 0x2
  149. #define DMUS_MARKERF_CHORD_ALIGN 0x4
  150. /* if this flag is set, variation settings in a playing pattern-based track's state data will
  151. persist in the track after it stops playing */
  152. #define DMUS_PATTERNF_PERSIST_CONTROL 0x1
  153. /* These specify possible values for DMUS_IO_PARTREF.bRandomVariation
  154. all but DMUS_VARIATIONT_SEQUENTIAL and DMUS_VARIATIONT_RANDOM are DirectX8. */
  155. typedef enum enumDMUS_VARIATIONT_TYPES
  156. {
  157. DMUS_VARIATIONT_SEQUENTIAL = 0, /* Play sequential starting with variation 1. */
  158. DMUS_VARIATIONT_RANDOM = 1, /* Play randomly. */
  159. DMUS_VARIATIONT_RANDOM_START = 2, /* Play sequential starting with a random variation. */
  160. DMUS_VARIATIONT_NO_REPEAT = 3, /* Play randomly, but don't play the same variation twice. */
  161. DMUS_VARIATIONT_RANDOM_ROW = 4 /* Play randomly as a row: don't repeat any variation until all have played. */
  162. } DMUS_VARIATIONT_TYPES;
  163. /* These specify possible values for DMUS_IO_PATTERN.wEmbellishment (DirectX8) */
  164. typedef enum enumDMUS_EMBELLISHT_TYPES
  165. {
  166. DMUS_EMBELLISHT_NORMAL = 0,
  167. DMUS_EMBELLISHT_FILL = 1,
  168. DMUS_EMBELLISHT_BREAK = 2,
  169. DMUS_EMBELLISHT_INTRO = 4,
  170. DMUS_EMBELLISHT_END = 8,
  171. DMUS_EMBELLISHT_MOTIF = 16,
  172. DMUS_EMBELLISHT_ALL = 0xFFFF
  173. } DMUS_EMBELLISHT_TYPES;
  174. #pragma pack(2)
  175. typedef struct _DMUS_IO_TIMESIG
  176. {
  177. /* Time signatures define how many beats per measure, which note receives */
  178. /* the beat, and the grid resolution. */
  179. BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */
  180. BYTE bBeat; /* what note receives the beat (bottom of time sig.) */
  181. /* we can assume that 0 means 256th note */
  182. WORD wGridsPerBeat; /* grids per beat */
  183. } DMUS_IO_TIMESIG;
  184. typedef struct _DMUS_IO_STYLE
  185. {
  186. DMUS_IO_TIMESIG timeSig; /* Styles have a default Time Signature */
  187. double dblTempo;
  188. } DMUS_IO_STYLE;
  189. typedef struct _DMUS_IO_VERSION
  190. {
  191. DWORD dwVersionMS; /* Version # high-order 32 bits */
  192. DWORD dwVersionLS; /* Version # low-order 32 bits */
  193. } DMUS_IO_VERSION;
  194. typedef struct _DMUS_IO_PATTERN
  195. {
  196. DMUS_IO_TIMESIG timeSig; /* Patterns can override the Style's Time sig. */
  197. BYTE bGrooveBottom; /* bottom of groove range */
  198. BYTE bGrooveTop; /* top of groove range */
  199. WORD wEmbellishment; /* Fill, Break, Intro, End, Normal, Motif */
  200. WORD wNbrMeasures; /* length in measures */
  201. BYTE bDestGrooveBottom; /* bottom of groove range for next pattern */
  202. BYTE bDestGrooveTop; /* top of groove range for next pattern */
  203. DWORD dwFlags; /* various flags */
  204. } DMUS_IO_PATTERN;
  205. typedef struct _DMUS_IO_STYLEPART
  206. {
  207. DMUS_IO_TIMESIG timeSig; /* can override pattern's */
  208. DWORD dwVariationChoices[32]; /* MOAW choice bitfield */
  209. GUID guidPartID; /* identifies the part */
  210. WORD wNbrMeasures; /* length of the Part */
  211. BYTE bPlayModeFlags; /* see PLAYMODE flags */
  212. BYTE bInvertUpper; /* inversion upper limit */
  213. BYTE bInvertLower; /* inversion lower limit */
  214. BYTE bPad[3]; /* for DWORD alignment */
  215. DWORD dwFlags; /* various flags */
  216. } DMUS_IO_STYLEPART;
  217. typedef struct _DMUS_IO_PARTREF
  218. {
  219. GUID guidPartID; /* unique ID for matching up with parts */
  220. WORD wLogicalPartID; /* corresponds to port/device/midi channel OBSOLETE */
  221. BYTE bVariationLockID; /* parts with the same ID lock variations. */
  222. /* high bit is used to identify master Part */
  223. BYTE bSubChordLevel; /* tells which sub chord level this part wants */
  224. BYTE bPriority; /* 256 priority levels. Parts with lower priority */
  225. /* aren't played first when a device runs out of */
  226. /* notes */
  227. BYTE bRandomVariation; /* when set, matching variations play in random order */
  228. /* when clear, matching variations play sequentially */
  229. WORD wPad; /* not used */
  230. DWORD dwPChannel; /* replaces wLogicalPartID */
  231. } DMUS_IO_PARTREF;
  232. typedef struct _DMUS_IO_STYLENOTE
  233. {
  234. MUSIC_TIME mtGridStart; /* when this note occurs */
  235. DWORD dwVariation; /* variation bits */
  236. MUSIC_TIME mtDuration; /* how long this note lasts */
  237. short nTimeOffset; /* offset from mtGridStart */
  238. WORD wMusicValue; /* Position in scale. */
  239. BYTE bVelocity; /* Note velocity. */
  240. BYTE bTimeRange; /* Range to randomize start time. */
  241. BYTE bDurRange; /* Range to randomize duration. */
  242. BYTE bVelRange; /* Range to randomize velocity. */
  243. BYTE bInversionID; /* Identifies inversion group to which this note belongs */
  244. BYTE bPlayModeFlags; /* Can override part */
  245. /* Following exists only under DirectX8 and on */
  246. BYTE bNoteFlags; /* values from DMUS_NOTEF_FLAGS */
  247. } DMUS_IO_STYLENOTE;
  248. typedef struct _DMUS_IO_STYLECURVE
  249. {
  250. MUSIC_TIME mtGridStart; /* when this curve occurs */
  251. DWORD dwVariation; /* variation bits */
  252. MUSIC_TIME mtDuration; /* how long this curve lasts */
  253. MUSIC_TIME mtResetDuration;/* how long after the end of the curve to reset the curve */
  254. short nTimeOffset; /* offset from mtGridStart */
  255. short nStartValue; /* curve's start value */
  256. short nEndValue; /* curve's end value */
  257. short nResetValue; /* the value to which to reset the curve */
  258. BYTE bEventType; /* type of curve */
  259. BYTE bCurveShape; /* shape of curve */
  260. BYTE bCCData; /* CC# */
  261. BYTE bFlags; /* Bit 1=TRUE means to send nResetValue. Otherwise, don't.
  262. Other bits are reserved. */
  263. /* Following was added for DirectX8. */
  264. WORD wParamType; /* RPN or NRPN parameter number. */
  265. WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.) */
  266. } DMUS_IO_STYLECURVE;
  267. typedef struct _DMUS_IO_STYLEMARKER
  268. {
  269. MUSIC_TIME mtGridStart; /* when this marker occurs */
  270. DWORD dwVariation; /* variation bits */
  271. WORD wMarkerFlags; /* how the marker is used */
  272. } DMUS_IO_STYLEMARKER;
  273. typedef struct _DMUS_IO_STYLERESOLUTION
  274. {
  275. DWORD dwVariation; /* variation bits */
  276. WORD wMusicValue; /* Position in scale. */
  277. BYTE bInversionID; /* Identifies inversion group to which this note belongs */
  278. BYTE bPlayModeFlags; /* Can override part */
  279. } DMUS_IO_STYLERESOLUTION;
  280. typedef struct _DMUS_IO_STYLE_ANTICIPATION
  281. {
  282. MUSIC_TIME mtGridStart; /* when this anticipation occurs */
  283. DWORD dwVariation; /* variation bits */
  284. short nTimeOffset; /* offset from mtGridStart */
  285. BYTE bTimeRange; /* Range to randomize start time. */
  286. } DMUS_IO_STYLE_ANTICIPATION;
  287. typedef struct _DMUS_IO_MOTIFSETTINGS
  288. {
  289. DWORD dwRepeats; /* Number of repeats. By default, 0. */
  290. MUSIC_TIME mtPlayStart; /* Start of playback. By default, 0. */
  291. MUSIC_TIME mtLoopStart; /* Start of looping portion. By default, 0. */
  292. MUSIC_TIME mtLoopEnd; /* End of loop. Must be greater than mtLoopStart. Or, 0, indicating loop full motif. */
  293. DWORD dwResolution; /* Default resolution. */
  294. } DMUS_IO_MOTIFSETTINGS;
  295. #pragma pack()
  296. /*
  297. RIFF
  298. (
  299. 'DMST' // Style
  300. <styh-ck> // Style header chunk
  301. <guid-ck> // Every Style has a GUID
  302. [<UNFO-list>] // Name, author, copyright info., comments
  303. [<vers-ck>] // version chunk
  304. <part-list>... // Array of parts in the Style, used by patterns
  305. <pttn-list>... // Array of patterns in the Style
  306. <DMBD-form>... // Array of bands in the Style
  307. [<prrf-list>]...// Optional array of chord map references in the Style
  308. )
  309. // <styh-ck>
  310. styh
  311. (
  312. <DMUS_IO_STYLE>
  313. )
  314. // <guid-ck>
  315. guid
  316. (
  317. <GUID>
  318. )
  319. // <vers-ck>
  320. vers
  321. (
  322. <DMUS_IO_VERSION>
  323. )
  324. // <part-list>
  325. LIST
  326. (
  327. 'part'
  328. <prth-ck> // Part header chunk
  329. [<UNFO-list>] // Name, author, copyright info., comments
  330. [<note-ck>] // Optional chunk containing an array of notes in Part
  331. [<crve-ck>] // Optional chunk containing an array of curves in Part
  332. [<mrkr-ck>] // Optional chunk containing an array of markers in Part
  333. [<rsln-ck>] // Optional chunk containing an array of variation resolutions in Part
  334. [<anpn-ck>] // Optional chunk containing an array of resolution anticipations in Part
  335. )
  336. // <orth-ck>
  337. prth
  338. (
  339. <DMUS_IO_STYLEPART>
  340. )
  341. // <note-ck>
  342. 'note'
  343. (
  344. // sizeof DMUS_IO_STYLENOTE:DWORD
  345. <DMUS_IO_STYLENOTE>...
  346. )
  347. // <crve-ck>
  348. 'crve'
  349. (
  350. // sizeof DMUS_IO_STYLECURVE:DWORD
  351. <DMUS_IO_STYLECURVE>...
  352. )
  353. // <mrkr-ck>
  354. 'mrkr'
  355. (
  356. // sizeof DMUS_IO_STYLEMARKER:DWORD
  357. <DMUS_IO_STYLEMARKER>...
  358. )
  359. // <rsln-ck>
  360. 'rsln'
  361. (
  362. // sizeof DMUS_IO_STYLERESOLUTION:DWORD
  363. <DMUS_IO_STYLERESOLUTION>...
  364. )
  365. // <anpn-ck>
  366. 'anpn'
  367. (
  368. // sizeof DMUS_IO_STYLE_ANTICIPATION:DWORD
  369. <DMUS_IO_STYLE_ANTICIPATION>...
  370. )
  371. // <pttn-list>
  372. LIST
  373. (
  374. 'pttn'
  375. <ptnh-ck> // Pattern header chunk
  376. <rhtm-ck> // Chunk containing an array of rhythms for chord matching
  377. [<UNFO-list>] // Name, author, copyright info., comments
  378. [<mtfs-ck>] // Motif settings chunk
  379. [<DMBD-form>] // Optional band to be associated with the pattern (for motifs)
  380. <pref-list>... // Array of part reference id's
  381. )
  382. // <ptnh-ck>
  383. ptnh
  384. (
  385. <DMUS_IO_PATTERN>
  386. )
  387. // <rhtm-ck>
  388. 'rhtm'
  389. (
  390. // DWORD's representing rhythms for chord matching based on number
  391. // of measures in the pattern
  392. )
  393. // pref-list
  394. LIST
  395. (
  396. 'pref'
  397. <prfc-ck> // part ref chunk
  398. )
  399. // <prfc-ck>
  400. prfc
  401. (
  402. <DMUS_IO_PARTREF>
  403. )
  404. // <mtfs-ck>
  405. mtfs
  406. (
  407. <DMUS_IO_MOTIFSETTINGS>
  408. )
  409. // <prrf-list>
  410. LIST
  411. (
  412. 'prrf'
  413. <DMRF-list>... // Array of Chordmap references
  414. )
  415. */
  416. /* Pattern chunk, for use in Pattern tracks */
  417. #define DMUS_FOURCC_PATTERN_FORM mmioFOURCC('D','M','P','T')
  418. /*
  419. RIFF
  420. (
  421. 'DMPT' // Pattern
  422. <styh-ck> // Style header chunk
  423. <pttn-list> // The pattern, in single pattern format (includes DMUS_FOURCC_PART_LIST chunks)
  424. )
  425. */
  426. /* Chord and command file formats */
  427. /* These specify possible values for DMUS_IO_COMMAND.bRepeatMode (DirectX8) */
  428. typedef enum enumDMUS_PATTERNT_TYPES
  429. {
  430. DMUS_PATTERNT_RANDOM = 0, /* Play randomly. (DirectX7 behavior) */
  431. DMUS_PATTERNT_REPEAT = 1, /* Repeat last pattern. */
  432. DMUS_PATTERNT_SEQUENTIAL = 2, /* Play sequential starting with first matching pattern. */
  433. DMUS_PATTERNT_RANDOM_START = 3, /* Play sequential starting with a random pattern. */
  434. DMUS_PATTERNT_NO_REPEAT = 4, /* Play randomly, but don't play the same pattern twice. */
  435. DMUS_PATTERNT_RANDOM_ROW = 5 /* Play randomly as a row: don't repeat any pattern until all have played. */
  436. } DMUS_PATTERNT_TYPES;
  437. #define DMUS_FOURCC_CHORDTRACK_LIST mmioFOURCC('c','o','r','d')
  438. #define DMUS_FOURCC_CHORDTRACKHEADER_CHUNK mmioFOURCC('c','r','d','h')
  439. #define DMUS_FOURCC_CHORDTRACKBODY_CHUNK mmioFOURCC('c','r','d','b')
  440. #define DMUS_FOURCC_COMMANDTRACK_CHUNK mmioFOURCC('c','m','n','d')
  441. typedef struct _DMUS_IO_CHORD
  442. {
  443. WCHAR wszName[16]; /* Name of the chord */
  444. MUSIC_TIME mtTime; /* Time of this chord */
  445. WORD wMeasure; /* Measure this falls on */
  446. BYTE bBeat; /* Beat this falls on */
  447. BYTE bFlags; /* Various flags */
  448. } DMUS_IO_CHORD;
  449. typedef struct _DMUS_IO_SUBCHORD
  450. {
  451. DWORD dwChordPattern; /* Notes in the subchord */
  452. DWORD dwScalePattern; /* Notes in the scale */
  453. DWORD dwInversionPoints; /* Where inversions can occur */
  454. DWORD dwLevels; /* Which levels are supported by this subchord */
  455. BYTE bChordRoot; /* Root of the subchord */
  456. BYTE bScaleRoot; /* Root of the scale */
  457. } DMUS_IO_SUBCHORD;
  458. typedef struct _DMUS_IO_COMMAND
  459. {
  460. MUSIC_TIME mtTime; /* Time of this command */
  461. WORD wMeasure; /* Measure this falls on */
  462. BYTE bBeat; /* Beat this falls on */
  463. BYTE bCommand; /* Command type (see #defines below) */
  464. BYTE bGrooveLevel; /* Groove level (0 if command is not a groove) */
  465. BYTE bGrooveRange; /* Groove range */
  466. BYTE bRepeatMode; /* Used to control selection of patterns with same groove level */
  467. } DMUS_IO_COMMAND;
  468. /*
  469. // <cord-list>
  470. LIST
  471. (
  472. 'cord'
  473. <crdh-ck>
  474. <crdb-ck>... // Chord body chunks
  475. )
  476. // <crdh-ck>
  477. crdh
  478. (
  479. // Scale: dword (upper 8 bits for root, lower 24 for scale)
  480. )
  481. // <crdb-ck>
  482. crdb
  483. (
  484. // sizeof DMUS_IO_CHORD:dword
  485. <DMUS_IO_CHORD>
  486. // # of DMUS_IO_SUBCHORDS:dword
  487. // sizeof DMUS_IO_SUBCHORDS:dword
  488. // a number of <DMUS_IO_SUBCHORD>
  489. )
  490. // <cmnd-list>
  491. 'cmnd'
  492. (
  493. //sizeof DMUS_IO_COMMAND: DWORD
  494. <DMUS_IO_COMMAND>...
  495. )
  496. */
  497. /* File io for DirectMusic Tool and ToolGraph objects
  498. */
  499. /* RIFF ids: */
  500. #define DMUS_FOURCC_TOOLGRAPH_FORM mmioFOURCC('D','M','T','G')
  501. #define DMUS_FOURCC_TOOL_LIST mmioFOURCC('t','o','l','l')
  502. #define DMUS_FOURCC_TOOL_FORM mmioFOURCC('D','M','T','L')
  503. #define DMUS_FOURCC_TOOL_CHUNK mmioFOURCC('t','o','l','h')
  504. /* io structures: */
  505. typedef struct _DMUS_IO_TOOL_HEADER
  506. {
  507. GUID guidClassID; /* Class id of tool. */
  508. long lIndex; /* Position in graph. */
  509. DWORD cPChannels; /* Number of items in channels array. */
  510. FOURCC ckid; /* chunk ID of tool's data chunk if 0 fccType valid. */
  511. FOURCC fccType; /* list type if NULL ckid valid. */
  512. DWORD dwPChannels[1]; /* Array of PChannels, size determined by cPChannels. */
  513. } DMUS_IO_TOOL_HEADER;
  514. /*
  515. RIFF
  516. (
  517. 'DMTG' // DirectMusic ToolGraph chunk
  518. [<guid-ck>] // GUID for ToolGraph
  519. [<vers-ck>] // Optional version info
  520. [<UNFO-list>] // Name, author, copyright info., comments
  521. <toll-list> // List of Tools
  522. )
  523. // <guid-ck>
  524. 'guid'
  525. (
  526. <GUID>
  527. )
  528. // <vers-ck>
  529. vers
  530. (
  531. <DMUS_IO_VERSION>
  532. )
  533. // <toll-list>
  534. LIST
  535. (
  536. 'toll' // Array of tools
  537. <DMTL-form>... // Each tool is encapsulated in a RIFF chunk
  538. )
  539. // <DMTL-form> Tools are embedded in a graph. Theoretically, they can be saved as individual files too.
  540. RIFF
  541. (
  542. 'DMTL'
  543. <tolh-ck>
  544. [<data>] // Tool data. Must be a RIFF readable chunk.
  545. )
  546. // <tolh-ck> // Tool header chunk
  547. (
  548. 'tolh'
  549. <DMUS_IO_TOOL_HEADER> // Tool header
  550. )
  551. */
  552. /* The AudioPath file carries everything for describing a specific audio path,
  553. including Tool Graph and Buffer Descriptor.
  554. This can even be used for configuring a complete performance.
  555. */
  556. #define DMUS_FOURCC_AUDIOPATH_FORM mmioFOURCC('D','M','A','P')
  557. /*
  558. RIFF
  559. (
  560. 'DMAP' // DirectMusic AudioPath chunk
  561. [<guid-ck>] // GUID for this Audio Path configuration
  562. [<vers-ck>] // Optional version info
  563. [<UNFO-list>] // Name, author, copyright info., comments
  564. [<DMTG-form>] // Optional ToolGraph
  565. [<pcsl-list>] // Optional list of port configurations
  566. [<dbfl-list>]...// Optional array of DirectSound buffer descriptors
  567. )
  568. */
  569. #define DMUS_FOURCC_PORTCONFIGS_LIST mmioFOURCC('p','c','s','l')
  570. #define DMUS_FOURCC_PORTCONFIG_LIST mmioFOURCC('p','c','f','l')
  571. #define DMUS_FOURCC_PORTCONFIG_ITEM mmioFOURCC('p','c','f','h')
  572. #define DMUS_FOURCC_PORTPARAMS_ITEM mmioFOURCC('p','p','r','h')
  573. #define DMUS_FOURCC_DSBUFFER_LIST mmioFOURCC('d','b','f','l')
  574. #define DMUS_FOURCC_DSBUFFATTR_ITEM mmioFOURCC('d','d','a','h')
  575. #define DMUS_FOURCC_PCHANNELS_LIST mmioFOURCC('p','c','h','l')
  576. #define DMUS_FOURCC_PCHANNELS_ITEM mmioFOURCC('p','c','h','h')
  577. typedef struct _DMUS_IO_PORTCONFIG_HEADER
  578. {
  579. GUID guidPort; /* GUID of requested port. */
  580. DWORD dwPChannelBase; /* PChannel that this should start on. */
  581. DWORD dwPChannelCount; /* How many channels. */
  582. DWORD dwFlags; /* Various flags. */
  583. } DMUS_IO_PORTCONFIG_HEADER;
  584. #define DMUS_PORTCONFIGF_DRUMSON10 1 /* This port configured for drums on channel 10. */
  585. #define DMUS_PORTCONFIGF_USEDEFAULT 2 /* Use the default port. */
  586. /* Each portconfig has one or more pchannel to buffer mappings. Each buffer
  587. is identified by a guid. Each pchannel can map to one or more buffers.
  588. This is defined with one or more DMUS_IO_PCHANNELTOBUFFER_HEADER
  589. structures. Each defines a range of PChannels and the set of buffers
  590. that they connect to.
  591. */
  592. typedef struct _DMUS_IO_PCHANNELTOBUFFER_HEADER
  593. {
  594. DWORD dwPChannelBase; /* PChannel that this should start on. */
  595. DWORD dwPChannelCount; /* How many PChannels. */
  596. DWORD dwBufferCount; /* How many buffers do these connect to. */
  597. DWORD dwFlags; /* Various flags. Currently reserved for future use. Must be 0. */
  598. } DMUS_IO_PCHANNELTOBUFFER_HEADER;
  599. /* Each buffer is represented by an DSBC form. This is wrapped by the
  600. DMUS_IO_BUFFER_ATTRIBUTES_HEADER which identifies how to use the
  601. buffer. In particular, it indicates whether this gets dynamically duplicated
  602. or all references to this should share the same instance.
  603. To resolve references, the unique GUID of the buffer is also stored
  604. in this structure.
  605. */
  606. typedef struct _DMUS_IO_BUFFER_ATTRIBUTES_HEADER
  607. {
  608. GUID guidBufferID; /* Each buffer config has a unique ID. */
  609. DWORD dwFlags; /* Various flags. */
  610. } DMUS_IO_BUFFER_ATTRIBUTES_HEADER;
  611. /* DMUS_IO_BUFFER_ATTRIBUTES_HEADER.dwFlags: */
  612. #define DMUS_BUFFERF_SHARED 1 /* Share this with other audio paths, instead of creating unique copies. */
  613. #define DMUS_BUFFERF_DEFINED 2 /* Use one of the standard predefined buffers (see GUID_Buffer... in dmusici.h.) */
  614. #define DMUS_BUFFERF_MIXIN 8 /* This is a mixin buffer. */
  615. /*
  616. LIST
  617. (
  618. 'pcsl' // Array of port configurations
  619. <pcfl-list>... // One or more port configurations, each in a list chunk
  620. )
  621. LIST
  622. (
  623. 'pcfl' // List container for one port configuration.
  624. <pcfh-ck> // Portconfig header chunk.
  625. <pprh-ck> // Port params, to be used to create the port.
  626. [<dbfl-list>]...// Optional array of DirectSound buffer descriptors
  627. [<pchl-list>] // Optional list of pchannel to buffer assignments
  628. )
  629. // <pcfh-ck> // Port config header chunk
  630. (
  631. 'pcfh'
  632. <DMUS_IO_PORTCONFIG_HEADER> // Port config header
  633. )
  634. // <pprh-ck> // Port params header chunk
  635. (
  636. 'pprh'
  637. <DMUS_PORTPARAMS8> // Port params header
  638. )
  639. LIST
  640. (
  641. 'pchl' // List container for one or more pchannel to buffer assignments.
  642. <pchh-ck>... // One or more pchannel to buffer assignment headers and data.
  643. // <pchh-ck>
  644. (
  645. 'pchh'
  646. <DMUS_IO_PCHANNELTOBUFFER_HEADER> // Description of PChannels
  647. <GUID>... // Array of GUIDs defining the buffers they all connect to.
  648. )
  649. )
  650. LIST
  651. (
  652. 'dbfl' // List container for one buffer and buffer attributes header.
  653. <ddah-ck> // Buffer attributes header.
  654. [<DSBC-form>] // Buffer configuration. Not required when header uses a predefined buffer type.
  655. // <ddah-ck>
  656. (
  657. 'ddah'
  658. <DMUS_IO_BUFFER_ATTRIBUTES_HEADER> // Buffer attributes.
  659. )
  660. )
  661. */
  662. /* File io for DirectMusic Band Track object */
  663. /* RIFF ids: */
  664. #define DMUS_FOURCC_BANDTRACK_FORM mmioFOURCC('D','M','B','T')
  665. #define DMUS_FOURCC_BANDTRACK_CHUNK mmioFOURCC('b','d','t','h')
  666. #define DMUS_FOURCC_BANDS_LIST mmioFOURCC('l','b','d','l')
  667. #define DMUS_FOURCC_BAND_LIST mmioFOURCC('l','b','n','d')
  668. #define DMUS_FOURCC_BANDITEM_CHUNK mmioFOURCC('b','d','i','h')
  669. #define DMUS_FOURCC_BANDITEM_CHUNK2 mmioFOURCC('b','d','2','h')
  670. /* io structures */
  671. typedef struct _DMUS_IO_BAND_TRACK_HEADER
  672. {
  673. BOOL bAutoDownload; /* Determines if Auto-Download is enabled. */
  674. } DMUS_IO_BAND_TRACK_HEADER;
  675. typedef struct _DMUS_IO_BAND_ITEM_HEADER
  676. {
  677. MUSIC_TIME lBandTime; /* Position in track list. */
  678. } DMUS_IO_BAND_ITEM_HEADER;
  679. typedef struct _DMUS_IO_BAND_ITEM_HEADER2
  680. {
  681. MUSIC_TIME lBandTimeLogical; /* Position in track list. Time in the music with which band change is associated. */
  682. MUSIC_TIME lBandTimePhysical; /* Precise time band change will take effect. Should be close to logical time. */
  683. } DMUS_IO_BAND_ITEM_HEADER2;
  684. /*
  685. RIFF
  686. (
  687. 'DMBT' // DirectMusic Band Track form-type
  688. [<bdth-ck>] // Band track header
  689. [<guid-ck>] // GUID for band track
  690. [<vers-ck>] // Optional version info
  691. [<UNFO-list>] // Name, author, copyright info., comments
  692. <lbdl-list> // List of Band items
  693. )
  694. // <bnth-ck>
  695. 'bdth'
  696. (
  697. <DMUS_IO_BAND_TRACK_HEADER>
  698. )
  699. // <guid-ck>
  700. 'guid'
  701. (
  702. <GUID>
  703. )
  704. // <vers-ck>
  705. vers
  706. (
  707. <DMUS_IO_VERSION>
  708. )
  709. // <lbdl-list>
  710. LIST
  711. (
  712. 'lbdl'
  713. <lbnd-list>... // Array of bands, each encapsulated in a list chunk
  714. )
  715. // <lbnd-list>
  716. LIST
  717. (
  718. 'lbnd'
  719. <bdih-ck> or <bd2h-ck> // bdih is a legacy format. bd2h is preferred for new content.
  720. <DMBD-form> // Band
  721. )
  722. // <bdih-ck> or <bd2h-ck> // band item header
  723. (
  724. <DMUS_IO_BAND_ITEM_HEADER> or <DMUS_IO_BAND_ITEM_HEADER2> // Band item header
  725. )
  726. */
  727. /* File io for DirectMusic Band object
  728. */
  729. /* RIFF ids: */
  730. #define DMUS_FOURCC_BAND_FORM mmioFOURCC('D','M','B','D')
  731. #define DMUS_FOURCC_INSTRUMENTS_LIST mmioFOURCC('l','b','i','l')
  732. #define DMUS_FOURCC_INSTRUMENT_LIST mmioFOURCC('l','b','i','n')
  733. #define DMUS_FOURCC_INSTRUMENT_CHUNK mmioFOURCC('b','i','n','s')
  734. /* Flags for DMUS_IO_INSTRUMENT
  735. */
  736. #define DMUS_IO_INST_PATCH (1 << 0) /* dwPatch is valid. */
  737. #define DMUS_IO_INST_BANKSELECT (1 << 1) /* dwPatch contains a valid Bank Select MSB and LSB part */
  738. #define DMUS_IO_INST_ASSIGN_PATCH (1 << 3) /* dwAssignPatch is valid */
  739. #define DMUS_IO_INST_NOTERANGES (1 << 4) /* dwNoteRanges is valid */
  740. #define DMUS_IO_INST_PAN (1 << 5) /* bPan is valid */
  741. #define DMUS_IO_INST_VOLUME (1 << 6 ) /* bVolume is valid */
  742. #define DMUS_IO_INST_TRANSPOSE (1 << 7) /* nTranspose is valid */
  743. #define DMUS_IO_INST_GM (1 << 8) /* Instrument is from GM collection */
  744. #define DMUS_IO_INST_GS (1 << 9) /* Instrument is from GS collection */
  745. #define DMUS_IO_INST_XG (1 << 10) /* Instrument is from XG collection */
  746. #define DMUS_IO_INST_CHANNEL_PRIORITY (1 << 11) /* dwChannelPriority is valid */
  747. #define DMUS_IO_INST_USE_DEFAULT_GM_SET (1 << 12) /* Always use the default GM set for this patch, */
  748. /* don't rely on the synth caps stating GM or GS in hardware. */
  749. #define DMUS_IO_INST_PITCHBENDRANGE (1 << 13) /* nPitchBendRange is valid */
  750. /* io structures */
  751. typedef struct _DMUS_IO_INSTRUMENT
  752. {
  753. DWORD dwPatch; /* MSB, LSB and Program change to define instrument */
  754. DWORD dwAssignPatch; /* MSB, LSB and Program change to assign to instrument when downloading */
  755. DWORD dwNoteRanges[4]; /* 128 bits; one for each MIDI note instrument needs to able to play */
  756. DWORD dwPChannel; /* PChannel instrument plays on */
  757. DWORD dwFlags; /* DMUS_IO_INST_ flags */
  758. BYTE bPan; /* Pan for instrument */
  759. BYTE bVolume; /* Volume for instrument */
  760. short nTranspose; /* Number of semitones to transpose notes */
  761. DWORD dwChannelPriority; /* Channel priority */
  762. short nPitchBendRange; /* Number of semitones shifted by pitch bend */
  763. } DMUS_IO_INSTRUMENT;
  764. /*
  765. // <DMBD-form> bands can be embedded in other forms
  766. RIFF
  767. (
  768. 'DMBD' // DirectMusic Band chunk
  769. [<guid-ck>] // GUID for band
  770. [<vers-ck>] // Optional version info
  771. [<UNFO-list>] // Name, author, copyright info., comments
  772. <lbil-list> // List of Instruments
  773. )
  774. // <guid-ck>
  775. 'guid'
  776. (
  777. <GUID>
  778. )
  779. // <vers-ck>
  780. vers
  781. (
  782. <DMUS_IO_VERSION>
  783. )
  784. // <lbil-list>
  785. LIST
  786. (
  787. 'lbil' // Array of instruments
  788. <lbin-list>... // Each instrument is encapsulated in a list
  789. )
  790. // <lbin-list>
  791. LIST
  792. (
  793. 'lbin'
  794. <bins-ck>
  795. [<DMRF-list>] // Optional reference to DLS Collection file.
  796. )
  797. // <bins-ck> // Instrument chunk
  798. (
  799. 'bins'
  800. <DMUS_IO_INSTRUMENT> // Instrument header
  801. )
  802. */
  803. /* This RIFF id and io struct have been added to allow wave files (and the wave object) to
  804. differentiate between streaming and one-shot waves, and to give a prefetch for streaming
  805. waves */
  806. #define DMUS_FOURCC_WAVEHEADER_CHUNK mmioFOURCC('w','a','v','h')
  807. typedef struct _DMUS_IO_WAVE_HEADER
  808. {
  809. REFERENCE_TIME rtReadAhead; /* How far ahead in the stream wave data will be read (in REFERENCE_TIME). Ignored for one-shot waves. */
  810. DWORD dwFlags; /* Various flags, including whether this is a streaming wave and whether it can be invalidated. */
  811. } DMUS_IO_WAVE_HEADER;
  812. /* File io for Wave track */
  813. /* RIFF ids: */
  814. #define DMUS_FOURCC_WAVETRACK_LIST mmioFOURCC('w','a','v','t')
  815. #define DMUS_FOURCC_WAVETRACK_CHUNK mmioFOURCC('w','a','t','h')
  816. #define DMUS_FOURCC_WAVEPART_LIST mmioFOURCC('w','a','v','p')
  817. #define DMUS_FOURCC_WAVEPART_CHUNK mmioFOURCC('w','a','p','h')
  818. #define DMUS_FOURCC_WAVEITEM_LIST mmioFOURCC('w','a','v','i')
  819. #define DMUS_FOURCC_WAVE_LIST mmioFOURCC('w','a','v','e')
  820. #define DMUS_FOURCC_WAVEITEM_CHUNK mmioFOURCC('w','a','i','h')
  821. /* This flag is included in DMUS_IO_WAVE_TRACK_HEADER.dwFlags. If set, the track will get its
  822. variations from a pattern track, via GetParam(GUID_Variations). */
  823. #define DMUS_WAVETRACKF_SYNC_VAR 0x1
  824. /* This is also included in DMUS_IO_WAVE_TRACK_HEADER.dwFlags. If set, variation control
  825. information will persist from one playback instance to the next.*/
  826. #define DMUS_WAVETRACKF_PERSIST_CONTROL 0x2
  827. typedef struct _DMUS_IO_WAVE_TRACK_HEADER
  828. {
  829. long lVolume; /* Gain, in 1/100th of dB, to be applied to all waves. Note: All gain values should be negative. */
  830. DWORD dwFlags; /* Flags, including whether this track syncs to a pattern track for its variations. */
  831. } DMUS_IO_WAVE_TRACK_HEADER;
  832. typedef struct _DMUS_IO_WAVE_PART_HEADER
  833. {
  834. long lVolume; /* Gain, in 1/100th of dB, to be applied to all waves in wave part. Note: All gain values should be negative. */
  835. DWORD dwVariations; /* Variation mask for which of 32 variations */
  836. DWORD dwPChannel; /* PChannel */
  837. DWORD dwLockToPart; /* Part ID to lock to. */
  838. DWORD dwFlags; /* Flags, including stuff for managing how variations are chosen (in low-order nibble) */
  839. DWORD dwIndex; /* Index for distinguishing multiple parts on the same PChannel*/
  840. } DMUS_IO_WAVE_PART_HEADER;
  841. typedef struct _DMUS_IO_WAVE_ITEM_HEADER
  842. {
  843. long lVolume; /* Gain, in 1/100th of dB. Note: All gain values should be negative. */
  844. long lPitch; /* Pitch offset in 1/100th of a semitone. */
  845. DWORD dwVariations; /* Variation flags for which of 32 variations this wave belongs to. */
  846. REFERENCE_TIME rtTime; /* Start time, in REFERENCE_TIME, if clock time track, or MUSIC_TIME for music time track. */
  847. REFERENCE_TIME rtStartOffset; /* Distance into wave to start playback, in reference time units. */
  848. REFERENCE_TIME rtReserved; /* Reserved field. */
  849. REFERENCE_TIME rtDuration; /* Duration, in REFERENCE_TIME or MUSIC_TIME, depending on track timing format. */
  850. MUSIC_TIME mtLogicalTime; /* If in music track format, this indicates the musical boundary where this belongs. Otherwise, ignored. */
  851. DWORD dwLoopStart; /* Start point for a looping wave. */
  852. DWORD dwLoopEnd; /* End point for a looping wave. */
  853. DWORD dwFlags; /* Various flags, including whether this is a streaming wave and whether it can be invalidated. */
  854. WORD wVolumeRange; /* Random range for volume. */
  855. WORD wPitchRange; /* Random range for pitch. */
  856. } DMUS_IO_WAVE_ITEM_HEADER;
  857. /*
  858. LIST
  859. {
  860. 'wavt' // Wave track chunk
  861. <wath-ck> // Wave track header
  862. <wavp-list>... // Array of Wave Parts
  863. }
  864. // <wath-ck>
  865. 'wath'
  866. {
  867. <DMUS_IO_WAVE_TRACK_HEADER>
  868. }
  869. // <wavp-list>
  870. LIST
  871. {
  872. 'wavp'
  873. <waph-ck> // Wave Part Header
  874. <wavi-list> // List of wave items
  875. }
  876. // <waph-ck>
  877. 'waph'
  878. {
  879. <DMUS_IO_WAVE_PART_HEADER>
  880. }
  881. // <wavi-list>
  882. LIST
  883. {
  884. 'wavi'
  885. <wave-list>... // Array of waves; each wave is encapsulated in a list
  886. }
  887. // <wave-list>
  888. LIST
  889. {
  890. 'wave'
  891. <waih-ck> // Wave item header
  892. <DMRF-list> // Reference to wave object
  893. }
  894. // <waih-ck>
  895. 'waih'
  896. {
  897. <DMUS_IO_WAVE_ITEM_HEADER>
  898. }
  899. */
  900. /* File io for DirectMusic Container file. This embeds a set of related files. And,
  901. in turn, it can be embedded within a segment or script file.
  902. */
  903. #define DMUS_FOURCC_CONTAINER_FORM mmioFOURCC('D','M','C','N')
  904. #define DMUS_FOURCC_CONTAINER_CHUNK mmioFOURCC('c','o','n','h')
  905. #define DMUS_FOURCC_CONTAINED_ALIAS_CHUNK mmioFOURCC('c','o','b','a')
  906. #define DMUS_FOURCC_CONTAINED_OBJECT_CHUNK mmioFOURCC('c','o','b','h')
  907. #define DMUS_FOURCC_CONTAINED_OBJECTS_LIST mmioFOURCC('c','o','s','l')
  908. #define DMUS_FOURCC_CONTAINED_OBJECT_LIST mmioFOURCC('c','o','b','l')
  909. typedef struct _DMUS_IO_CONTAINER_HEADER
  910. {
  911. DWORD dwFlags; /* Flags. */
  912. } DMUS_IO_CONTAINER_HEADER;
  913. #define DMUS_CONTAINER_NOLOADS (1 << 1) /* Contained items are not loaded when the container is loaded.
  914. Entries will be created in the loader (via SetObject) but
  915. the actual objects will not be created until they are
  916. specifically loaded at a later time. */
  917. typedef struct _DMUS_IO_CONTAINED_OBJECT_HEADER
  918. {
  919. GUID guidClassID; /* Class id of object. */
  920. DWORD dwFlags; /* Flags, for example DMUS_CONTAINED_OBJF_KEEP. */
  921. FOURCC ckid; /* chunk ID of track's data chunk if 0 fccType valid. */
  922. FOURCC fccType; /* list type if NULL ckid valid */
  923. /* Note that LIST:DMRF may be used for ckid and fccType in order to reference an
  924. object instead of embedding it within the container. */
  925. } DMUS_IO_CONTAINED_OBJECT_HEADER;
  926. #define DMUS_CONTAINED_OBJF_KEEP 1 /* Keep the object cached in the loader after the container is released. */
  927. /*
  928. RIFF
  929. (
  930. 'DMCN' // DirectMusic Container chunk
  931. <conh-ck> // Container header chunk
  932. [<guid-ck>] // GUID for container
  933. [<vers-ck>] // Optional version info
  934. [<UNFO-list>] // Name, author, copyright info., comments
  935. <cosl-list> // List of objects.
  936. )
  937. // <conh-ck>
  938. 'conh'
  939. (
  940. <DMUS_IO_CONTAINER_HEADER>
  941. )
  942. // <guid-ck>
  943. 'guid'
  944. (
  945. <GUID>
  946. )
  947. // <vers-ck>
  948. vers
  949. (
  950. <DMUS_IO_VERSION>
  951. )
  952. LIST
  953. (
  954. 'cosl' // Array of embedded objects.
  955. <cobl-list>... // Each object is encapsulated in a LIST chunk
  956. )
  957. // <cobl-list> // Encapsulates one object
  958. LIST
  959. (
  960. 'cobl'
  961. [<coba-ck>] // Alias. An alternative name by which this object is known
  962. // within the container.
  963. <cobh-ck> // Required header, includes CLASS ID for object.
  964. [<data>] or <DMRF> // Object data of the type specified in <cobh-ck>.
  965. // If DMRF, it is a reference of where to find the object.
  966. // Otherwise, it could be any RIFF readable chunk in the
  967. // exact same format as a file. The object will load
  968. // itself from this data.
  969. )
  970. // <coba-ck>
  971. 'coba'
  972. (
  973. // Alias, stored as NULL terminated string of WCHARs
  974. )
  975. // <cobh-ck>
  976. 'cobh'
  977. (
  978. <DMUS_IO_CONTAINED_OBJECT_HEADER>
  979. )
  980. */
  981. /* File io for DirectMusic Segment object */
  982. /* RIFF ids: */
  983. #define DMUS_FOURCC_SEGMENT_FORM mmioFOURCC('D','M','S','G')
  984. #define DMUS_FOURCC_SEGMENT_CHUNK mmioFOURCC('s','e','g','h')
  985. #define DMUS_FOURCC_TRACK_LIST mmioFOURCC('t','r','k','l')
  986. #define DMUS_FOURCC_TRACK_FORM mmioFOURCC('D','M','T','K')
  987. #define DMUS_FOURCC_TRACK_CHUNK mmioFOURCC('t','r','k','h')
  988. #define DMUS_FOURCC_TRACK_EXTRAS_CHUNK mmioFOURCC('t','r','k','x')
  989. /* io structures:*/
  990. typedef struct _DMUS_IO_SEGMENT_HEADER
  991. {
  992. DWORD dwRepeats; /* Number of repeats. By default, 0. */
  993. MUSIC_TIME mtLength; /* Length, in music time. */
  994. MUSIC_TIME mtPlayStart; /* Start of playback. By default, 0. */
  995. MUSIC_TIME mtLoopStart; /* Start of looping portion. By default, 0. */
  996. MUSIC_TIME mtLoopEnd; /* End of loop. Must be greater than dwPlayStart. Or, 0, indicating loop full segment. */
  997. DWORD dwResolution; /* Default resolution. */
  998. /* Following added for DirectX8: */
  999. REFERENCE_TIME rtLength; /* Length, in reference time (overrides music time length.) */
  1000. DWORD dwFlags;
  1001. DWORD dwReserved; /* Reserved. */
  1002. /* Added for DirectX9: */
  1003. REFERENCE_TIME rtLoopStart; /* Clock time loop start. */
  1004. REFERENCE_TIME rtLoopEnd; /* Clock time loop end. */
  1005. REFERENCE_TIME rtPlayStart; /* Start of playback in clock time. */
  1006. } DMUS_IO_SEGMENT_HEADER;
  1007. #define DMUS_SEGIOF_REFLENGTH 1 /* Use the time in rtLength for the segment length. */
  1008. #define DMUS_SEGIOF_CLOCKTIME 2 /* This is a clock time segment. */
  1009. typedef struct _DMUS_IO_TRACK_HEADER
  1010. {
  1011. GUID guidClassID; /* Class id of track. */
  1012. DWORD dwPosition; /* Position in track list. */
  1013. DWORD dwGroup; /* Group bits for track. */
  1014. FOURCC ckid; /* chunk ID of track's data chunk. */
  1015. FOURCC fccType; /* list type if ckid is RIFF or LIST */
  1016. } DMUS_IO_TRACK_HEADER;
  1017. /* Additional parameters for the track header chunk, introduced in DirectX8 and
  1018. on, are stored in a separate chunk. */
  1019. typedef struct _DMUS_IO_TRACK_EXTRAS_HEADER
  1020. {
  1021. DWORD dwFlags; /* DirectX8 Added flags for control tracks. */
  1022. DWORD dwPriority; /* Priority for composition. */
  1023. } DMUS_IO_TRACK_EXTRAS_HEADER;
  1024. /*
  1025. RIFF
  1026. (
  1027. 'DMSG' // DirectMusic Segment chunk
  1028. <segh-ck> // Segment header chunk
  1029. [<guid-ck>] // GUID for segment
  1030. [<vers-ck>] // Optional version info
  1031. [<UNFO-list>] // Name, author, copyright info., comments
  1032. [<DMCN-form>] // Optional container of objects embedded in file. Must precede tracklist.
  1033. <trkl-list> // List of Tracks
  1034. [<DMTG-form>] // Optional ToolGraph
  1035. [<DMAP-form>] // Optional Audio Path
  1036. )
  1037. // <segh-ck>
  1038. 'segh'
  1039. (
  1040. <DMUS_IO_SEGMENT_HEADER>
  1041. )
  1042. // <guid-ck>
  1043. 'guid'
  1044. (
  1045. <GUID>
  1046. )
  1047. // <vers-ck>
  1048. vers
  1049. (
  1050. <DMUS_IO_VERSION>
  1051. )
  1052. // <trkl-list>
  1053. LIST
  1054. (
  1055. 'trkl' // Array of tracks
  1056. <DMTK-form>... // Each track is encapsulated in a RIFF chunk
  1057. )
  1058. // <DMTK-form> // Tracks can be embedded in a segment or stored as separate files.
  1059. RIFF
  1060. (
  1061. 'DMTK'
  1062. <trkh-ck>
  1063. [<trkx-ck>] // Optional track flags.
  1064. [<guid-ck>] // Optional GUID for track object instance (not to be confused with Class id in track header)
  1065. [<vers-ck>] // Optional version info
  1066. [<UNFO-list>] // Optional name, author, copyright info., comments
  1067. [<data>] // Track data. Must be a RIFF readable chunk.
  1068. )
  1069. // <trkh-ck> // Track header chunk
  1070. (
  1071. 'trkh'
  1072. <DMUS_IO_TRACK_HEADER> // Track header
  1073. )
  1074. // <trkx-ck> // Track flags chunk
  1075. (
  1076. 'trkx'
  1077. <DMUS_IO_TRACK_EXTRAS_HEADER> // DirectX8 Track flags header
  1078. )
  1079. */
  1080. /* File io for DirectMusic reference chunk.
  1081. This is used to embed a reference to an object.
  1082. */
  1083. /* RIFF ids: */
  1084. #define DMUS_FOURCC_REF_LIST mmioFOURCC('D','M','R','F')
  1085. #define DMUS_FOURCC_REF_CHUNK mmioFOURCC('r','e','f','h')
  1086. #define DMUS_FOURCC_DATE_CHUNK mmioFOURCC('d','a','t','e')
  1087. #define DMUS_FOURCC_NAME_CHUNK mmioFOURCC('n','a','m','e')
  1088. #define DMUS_FOURCC_FILE_CHUNK mmioFOURCC('f','i','l','e')
  1089. typedef struct _DMUS_IO_REFERENCE
  1090. {
  1091. GUID guidClassID; /* Class id is always required. */
  1092. DWORD dwValidData; /* Flags. */
  1093. } DMUS_IO_REFERENCE;
  1094. /*
  1095. LIST
  1096. (
  1097. 'DMRF' // DirectMusic Reference chunk
  1098. <refh-ck> // Reference header chunk
  1099. [<guid-ck>] // Optional object GUID.
  1100. [<date-ck>] // Optional file date.
  1101. [<name-ck>] // Optional name.
  1102. [<file-ck>] // Optional file name.
  1103. [<catg-ck>] // Optional category name.
  1104. [<vers-ck>] // Optional version info.
  1105. )
  1106. // <refh-ck>
  1107. 'refh'
  1108. (
  1109. <DMUS_IO_REFERENCE>
  1110. )
  1111. // <guid-ck>
  1112. 'guid'
  1113. (
  1114. <GUID>
  1115. )
  1116. // <date-ck>
  1117. date
  1118. (
  1119. <FILETIME>
  1120. )
  1121. // <name-ck>
  1122. name
  1123. (
  1124. // Name, stored as NULL terminated string of WCHARs
  1125. )
  1126. // <file-ck>
  1127. file
  1128. (
  1129. // File name, stored as NULL terminated string of WCHARs
  1130. )
  1131. // <catg-ck>
  1132. catg
  1133. (
  1134. // Category name, stored as NULL terminated string of WCHARs
  1135. )
  1136. // <vers-ck>
  1137. vers
  1138. (
  1139. <DMUS_IO_VERSION>
  1140. )
  1141. */
  1142. /* Chord Maps */
  1143. /* runtime chunks */
  1144. #define DMUS_FOURCC_CHORDMAP_FORM mmioFOURCC('D','M','P','R')
  1145. #define DMUS_FOURCC_IOCHORDMAP_CHUNK mmioFOURCC('p','e','r','h')
  1146. #define DMUS_FOURCC_SUBCHORD_CHUNK mmioFOURCC('c','h','d','t')
  1147. #define DMUS_FOURCC_CHORDENTRY_CHUNK mmioFOURCC('c','h','e','h')
  1148. #define DMUS_FOURCC_SUBCHORDID_CHUNK mmioFOURCC('s','b','c','n')
  1149. #define DMUS_FOURCC_IONEXTCHORD_CHUNK mmioFOURCC('n','c','r','d')
  1150. #define DMUS_FOURCC_NEXTCHORDSEQ_CHUNK mmioFOURCC('n','c','s','q')
  1151. #define DMUS_FOURCC_IOSIGNPOST_CHUNK mmioFOURCC('s','p','s','h')
  1152. #define DMUS_FOURCC_CHORDNAME_CHUNK mmioFOURCC('I','N','A','M')
  1153. /* runtime list chunks */
  1154. #define DMUS_FOURCC_CHORDENTRY_LIST mmioFOURCC('c','h','o','e')
  1155. #define DMUS_FOURCC_CHORDMAP_LIST mmioFOURCC('c','m','a','p')
  1156. #define DMUS_FOURCC_CHORD_LIST mmioFOURCC('c','h','r','d')
  1157. #define DMUS_FOURCC_CHORDPALETTE_LIST mmioFOURCC('c','h','p','l')
  1158. #define DMUS_FOURCC_CADENCE_LIST mmioFOURCC('c','a','d','e')
  1159. #define DMUS_FOURCC_SIGNPOSTITEM_LIST mmioFOURCC('s','p','s','t')
  1160. #define DMUS_FOURCC_SIGNPOST_LIST mmioFOURCC('s','p','s','q')
  1161. /* values for dwChord field of DMUS_IO_PERS_SIGNPOST */
  1162. /* DMUS_SIGNPOSTF_ flags are also used in templates (DMUS_IO_SIGNPOST) */
  1163. #define DMUS_SIGNPOSTF_A 1
  1164. #define DMUS_SIGNPOSTF_B 2
  1165. #define DMUS_SIGNPOSTF_C 4
  1166. #define DMUS_SIGNPOSTF_D 8
  1167. #define DMUS_SIGNPOSTF_E 0x10
  1168. #define DMUS_SIGNPOSTF_F 0x20
  1169. #define DMUS_SIGNPOSTF_LETTER (DMUS_SIGNPOSTF_A | DMUS_SIGNPOSTF_B | DMUS_SIGNPOSTF_C | DMUS_SIGNPOSTF_D | DMUS_SIGNPOSTF_E | DMUS_SIGNPOSTF_F)
  1170. #define DMUS_SIGNPOSTF_1 0x100
  1171. #define DMUS_SIGNPOSTF_2 0x200
  1172. #define DMUS_SIGNPOSTF_3 0x400
  1173. #define DMUS_SIGNPOSTF_4 0x800
  1174. #define DMUS_SIGNPOSTF_5 0x1000
  1175. #define DMUS_SIGNPOSTF_6 0x2000
  1176. #define DMUS_SIGNPOSTF_7 0x4000
  1177. #define DMUS_SIGNPOSTF_ROOT (DMUS_SIGNPOSTF_1 | DMUS_SIGNPOSTF_2 | DMUS_SIGNPOSTF_3 | DMUS_SIGNPOSTF_4 | DMUS_SIGNPOSTF_5 | DMUS_SIGNPOSTF_6 | DMUS_SIGNPOSTF_7)
  1178. #define DMUS_SIGNPOSTF_CADENCE 0x8000
  1179. /* values for dwFlags field of DMUS_IO_CHORDMAP */
  1180. #define DMUS_CHORDMAPF_VERSION8 1 /* Chordmap is version 8 or above. */
  1181. /* values for dwChord field of DMUS_IO_PERS_SIGNPOST */
  1182. #define DMUS_SPOSTCADENCEF_1 2 /* Use the first cadence chord. */
  1183. #define DMUS_SPOSTCADENCEF_2 4 /* Use the second cadence chord. */
  1184. /* run time data structs */
  1185. typedef struct _DMUS_IO_CHORDMAP
  1186. {
  1187. WCHAR wszLoadName[20];
  1188. DWORD dwScalePattern;
  1189. DWORD dwFlags; /* Various flags. Only lower 16 bits are significant. */
  1190. } DMUS_IO_CHORDMAP;
  1191. typedef struct _DMUS_IO_CHORDMAP_SUBCHORD
  1192. {
  1193. DWORD dwChordPattern;
  1194. DWORD dwScalePattern;
  1195. DWORD dwInvertPattern;
  1196. BYTE bChordRoot;
  1197. BYTE bScaleRoot;
  1198. WORD wCFlags;
  1199. DWORD dwLevels; /* parts or which subchord levels this chord supports */
  1200. } DMUS_IO_CHORDMAP_SUBCHORD;
  1201. /* Legacy name... */
  1202. typedef DMUS_IO_CHORDMAP_SUBCHORD DMUS_IO_PERS_SUBCHORD;
  1203. typedef struct _DMUS_IO_CHORDENTRY
  1204. {
  1205. DWORD dwFlags;
  1206. WORD wConnectionID; /* replaces runtime "pointer to this" */
  1207. } DMUS_IO_CHORDENTRY;
  1208. typedef struct _DMUS_IO_NEXTCHORD
  1209. {
  1210. DWORD dwFlags;
  1211. WORD nWeight;
  1212. WORD wMinBeats;
  1213. WORD wMaxBeats;
  1214. WORD wConnectionID; /* points to an ioChordEntry */
  1215. } DMUS_IO_NEXTCHORD;
  1216. typedef struct _DMUS_IO_CHORDMAP_SIGNPOST
  1217. {
  1218. DWORD dwChords; /* 1bit per group */
  1219. DWORD dwFlags;
  1220. } DMUS_IO_CHORDMAP_SIGNPOST;
  1221. /* Legacy name... */
  1222. typedef DMUS_IO_CHORDMAP_SIGNPOST DMUS_IO_PERS_SIGNPOST;
  1223. /*
  1224. RIFF
  1225. (
  1226. 'DMPR'
  1227. <perh-ck> // Chord map header chunk
  1228. [<guid-ck>] // guid chunk
  1229. [<vers-ck>] // version chunk (two DWORDS)
  1230. [<UNFO-list>] // Unfo chunk
  1231. <chdt-ck> // subchord database
  1232. <chpl-list> // chord palette
  1233. <cmap-list> // chord map
  1234. <spsq-list> // signpost list
  1235. )
  1236. <cmap-list> ::= LIST('cmap' <choe-list> )
  1237. <choe-list> ::= LIST('choe'
  1238. <cheh-ck> // chord entry data
  1239. <chrd-list> // chord definition
  1240. <ncsq-ck> // connecting(next) chords
  1241. )
  1242. <chrd-list> ::= LIST('chrd'
  1243. <INAM-ck> // name of chord in wide char format
  1244. <sbcn-ck> // list of subchords composing chord
  1245. )
  1246. <chpl-list> ::= LIST('chpl'
  1247. <chrd-list> ... // chord definition
  1248. )
  1249. <spsq-list> ::== LIST('spsq' <spst-list> ... )
  1250. <spst-list> ::= LIST('spst'
  1251. <spsh-ck>
  1252. <chrd-list>
  1253. [<cade-list>]
  1254. )
  1255. <cade-list> ::= LIST('cade' <chrd-list> ...)
  1256. <perh-ck> ::= perh(<DMUS_IO_CHORDMAP>)
  1257. <chdt-ck> ::= chdt(<cbChordSize::WORD>
  1258. <DMUS_IO_PERS_SUBCHORD> ... )
  1259. <cheh-ck> ::= cheh(<DMUS_IO_CHORDENTRY>)
  1260. <sbcn-ck> ::= sbcn(<cSubChordID:WORD> ...)
  1261. <ncsq-ck> ::= ncsq(<wNextChordSize:WORD>
  1262. <DMUS_IO_NEXTCHORD>...)
  1263. <spsh-ck> ::= spsh(<DMUS_IO_PERS_SIGNPOST>)
  1264. */
  1265. /* File io for DirectMusic Script object */
  1266. /* RIFF ids: */
  1267. #define DMUS_FOURCC_SCRIPT_FORM mmioFOURCC('D','M','S','C')
  1268. #define DMUS_FOURCC_SCRIPT_CHUNK mmioFOURCC('s','c','h','d')
  1269. #define DMUS_FOURCC_SCRIPTVERSION_CHUNK mmioFOURCC('s','c','v','e')
  1270. #define DMUS_FOURCC_SCRIPTLANGUAGE_CHUNK mmioFOURCC('s','c','l','a')
  1271. #define DMUS_FOURCC_SCRIPTSOURCE_CHUNK mmioFOURCC('s','c','s','r')
  1272. /* io structures:*/
  1273. typedef struct _DMUS_IO_SCRIPT_HEADER
  1274. {
  1275. DWORD dwFlags; /* DMUS_SCRIPTIOF_ flags */
  1276. } DMUS_IO_SCRIPT_HEADER;
  1277. #define DMUS_SCRIPTIOF_LOAD_ALL_CONTENT (1 << 0)
  1278. /* If set, when the script loads it will also load all the content in its container. */
  1279. #define DMUS_SCRIPTIOF_DOWNLOAD_ALL_SEGMENTS (1 << 1)
  1280. /* If set and LOAD_ALL_CONTENT is also set, when the script initializes it will also download all the segments in its container.
  1281. If set and LOAD_ALL_CONTENT is not set, when the script calls segment.Load on a segment then the segment will also be downloaded.
  1282. If not set, the script must manually download and unload by calling segment.DownloadSoundData and segment.UnloadSoundData. */
  1283. /*
  1284. RIFF
  1285. (
  1286. 'DMSC' // DirectMusic Script chunk
  1287. <schd-ck> // Script header chunk
  1288. [<guid-ck>] // GUID for script
  1289. [<vers-ck>] // Optional version info
  1290. [<UNFO-list>] // Name, author, copyright info., comments
  1291. <scve-ck> // Version of DirectMusic this script was authored to run against
  1292. <DMCN-form> // Container of content referenced by the script.
  1293. <scla-ck> // ActiveX scripting language in which the script is written
  1294. <scsr-ck> or <DMRF> // The script's source code.
  1295. // If scsr-ck, the source is embedding in the chunk.
  1296. // If DMRF, it is a reference of where to find a text file with the source.
  1297. // Class id (guidClassID in DMUS_IO_REFERENCE) must be GUID_NULL because
  1298. // this text file is not a DirectMusic object in its own right.
  1299. )
  1300. // <schd-ck>
  1301. 'schd'
  1302. (
  1303. <DMUS_FOURCC_SCRIPT_CHUNK>
  1304. )
  1305. // <guid-ck>
  1306. 'guid'
  1307. (
  1308. <GUID>
  1309. )
  1310. // <vers-ck>
  1311. vers
  1312. (
  1313. <DMUS_IO_VERSION>
  1314. )
  1315. // <scve-ck>
  1316. scve
  1317. (
  1318. <DMUS_IO_VERSION>
  1319. )
  1320. 'scla'
  1321. (
  1322. // Language name, stored as NULL terminated string of WCHARs
  1323. )
  1324. 'scsr'
  1325. (
  1326. // Source code, stored as NULL terminated string of WCHARs
  1327. )
  1328. */
  1329. /* Signpost tracks */
  1330. #define DMUS_FOURCC_SIGNPOST_TRACK_CHUNK mmioFOURCC( 's', 'g', 'n', 'p' )
  1331. typedef struct _DMUS_IO_SIGNPOST
  1332. {
  1333. MUSIC_TIME mtTime;
  1334. DWORD dwChords;
  1335. WORD wMeasure;
  1336. } DMUS_IO_SIGNPOST;
  1337. /*
  1338. // <sgnp-list>
  1339. 'sgnp'
  1340. (
  1341. //sizeof DMUS_IO_SIGNPOST: DWORD
  1342. <DMUS_IO_SIGNPOST>...
  1343. )
  1344. */
  1345. #define DMUS_FOURCC_MUTE_CHUNK mmioFOURCC('m','u','t','e')
  1346. typedef struct _DMUS_IO_MUTE
  1347. {
  1348. MUSIC_TIME mtTime;
  1349. DWORD dwPChannel;
  1350. DWORD dwPChannelMap;
  1351. } DMUS_IO_MUTE;
  1352. /*
  1353. // <mute-list>
  1354. 'mute'
  1355. (
  1356. //sizeof DMUS_IO_MUTE:DWORD
  1357. <DMUS_IO_MUTE>...
  1358. )
  1359. */
  1360. /* Used for both style and chord map tracks */
  1361. #define DMUS_FOURCC_TIME_STAMP_CHUNK mmioFOURCC('s', 't', 'm', 'p')
  1362. /* Style tracks */
  1363. #define DMUS_FOURCC_STYLE_TRACK_LIST mmioFOURCC('s', 't', 't', 'r')
  1364. #define DMUS_FOURCC_STYLE_REF_LIST mmioFOURCC('s', 't', 'r', 'f')
  1365. /*
  1366. // <sttr-list>
  1367. LIST('sttr'
  1368. (
  1369. <strf-list>... // Array of Style references
  1370. )
  1371. // <strf-list>
  1372. LIST('strf'
  1373. (
  1374. <stmp-ck>
  1375. <DMRF>
  1376. )
  1377. // <stmp-ck>
  1378. 'stmp'
  1379. (
  1380. // time:DWORD
  1381. )
  1382. */
  1383. /* Chord map tracks */
  1384. #define DMUS_FOURCC_PERS_TRACK_LIST mmioFOURCC('p', 'f', 't', 'r')
  1385. #define DMUS_FOURCC_PERS_REF_LIST mmioFOURCC('p', 'f', 'r', 'f')
  1386. /*
  1387. // <pftr-list>
  1388. LIST('pftr'
  1389. (
  1390. <pfrf-list>... // Array of Chord map references
  1391. )
  1392. // <pfrf-list>
  1393. LIST('pfrf'
  1394. (
  1395. <stmp-ck>
  1396. <DMRF>
  1397. )
  1398. // <stmp-ck>
  1399. 'stmp'
  1400. (
  1401. // time:DWORD
  1402. )
  1403. */
  1404. #define DMUS_FOURCC_TEMPO_TRACK mmioFOURCC('t','e','t','r')
  1405. /*
  1406. // tempo array
  1407. 'tetr'
  1408. (
  1409. // sizeof DMUS_IO_TEMPO_ITEM: DWORD
  1410. <DMUS_IO_TEMPO_ITEM>...
  1411. )
  1412. */
  1413. #define DMUS_FOURCC_SEQ_TRACK mmioFOURCC('s','e','q','t')
  1414. #define DMUS_FOURCC_SEQ_LIST mmioFOURCC('e','v','t','l')
  1415. #define DMUS_FOURCC_CURVE_LIST mmioFOURCC('c','u','r','l')
  1416. /*
  1417. // sequence track
  1418. 'seqt'
  1419. (
  1420. // sequence array
  1421. 'evtl'
  1422. (
  1423. // sizeof DMUS_IO_SEQ_ITEM: DWORD
  1424. <DMUS_IO_SEQ_ITEM>...
  1425. )
  1426. // curve array
  1427. 'curl'
  1428. (
  1429. // sizeof DMUS_IO_CURVE_ITEM: DWORD
  1430. <DMUS_IO_CURVE_ITEM>...
  1431. )
  1432. )
  1433. */
  1434. #define DMUS_FOURCC_SYSEX_TRACK mmioFOURCC('s','y','e','x')
  1435. /*
  1436. // sysex track
  1437. 'syex'
  1438. (
  1439. {
  1440. <DMUS_IO_SYSEX_ITEM>
  1441. <BYTE>... // Array of bytes, length defined in the DMUS_IO_SYSEXITEM structure
  1442. }...
  1443. )
  1444. */
  1445. #define DMUS_FOURCC_TIMESIGNATURE_TRACK mmioFOURCC('t','i','m','s')
  1446. typedef struct _DMUS_IO_TIMESIGNATURE_ITEM
  1447. {
  1448. MUSIC_TIME lTime;
  1449. BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */
  1450. BYTE bBeat; /* what note receives the beat (bottom of time sig.) */
  1451. /* we can assume that 0 means 256th note */
  1452. WORD wGridsPerBeat; /* grids per beat */
  1453. } DMUS_IO_TIMESIGNATURE_ITEM;
  1454. /* DirectX6 time signature track
  1455. 'tims'
  1456. (
  1457. // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD
  1458. <DMUS_IO_TIMESIGNATURE_ITEM>...
  1459. )
  1460. */
  1461. /* DirectX8 Time signature track. The track has been updated from DirectX7 to support a list of
  1462. RIFF chunks. This will allow the time signature track to expand in the future.
  1463. */
  1464. #define DMUS_FOURCC_TIMESIGTRACK_LIST mmioFOURCC('T','I','M','S')
  1465. #define DMUS_FOURCC_TIMESIG_CHUNK DMUS_FOURCC_TIMESIGNATURE_TRACK
  1466. /*
  1467. LIST
  1468. (
  1469. 'TIMS' // Time Signature Track list-type
  1470. <tims-ck> // Chunk containing an array of time signatures
  1471. )
  1472. 'tims'
  1473. (
  1474. // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD
  1475. <DMUS_IO_TIMESIGNATURE_ITEM>...
  1476. )
  1477. */
  1478. /* DirectX8 Marker track. This is used to store valid start points and other
  1479. flow control parameters that may come later. For example, if we want
  1480. to implement more sophisticated looping and branching constructs, they
  1481. would live in this track.
  1482. */
  1483. #define DMUS_FOURCC_MARKERTRACK_LIST mmioFOURCC('M','A','R','K')
  1484. #define DMUS_FOURCC_VALIDSTART_CHUNK mmioFOURCC('v','a','l','s')
  1485. #define DMUS_FOURCC_PLAYMARKER_CHUNK mmioFOURCC('p','l','a','y')
  1486. /* io structures */
  1487. typedef struct _DMUS_IO_VALID_START
  1488. {
  1489. MUSIC_TIME mtTime; /* Time of a legal start. */
  1490. } DMUS_IO_VALID_START;
  1491. typedef struct _DMUS_IO_PLAY_MARKER
  1492. {
  1493. MUSIC_TIME mtTime; /* Time of a next legal play point marker. */
  1494. } DMUS_IO_PLAY_MARKER;
  1495. /*
  1496. LIST
  1497. (
  1498. 'MARK' // Marker Track list-type
  1499. [<vals-ck>] // Chunk containing an array of start points
  1500. [<play-ck>] // Chunk containing an array of play start markers
  1501. )
  1502. 'vals'
  1503. (
  1504. // size of DMUS_IO_VALID_START : DWORD
  1505. <DMUS_IO_VALID_START>...
  1506. )
  1507. 'play'
  1508. (
  1509. // size of DMUS_IO_PLAY_MARKER : DWORD
  1510. <DMUS_IO_PLAY_MARKER>...
  1511. )
  1512. */
  1513. /* segment trigger tracks */
  1514. /* RIFF ids: */
  1515. #define DMUS_FOURCC_SEGTRACK_LIST mmioFOURCC('s','e','g','t')
  1516. #define DMUS_FOURCC_SEGTRACK_CHUNK mmioFOURCC('s','g','t','h')
  1517. #define DMUS_FOURCC_SEGMENTS_LIST mmioFOURCC('l','s','g','l')
  1518. #define DMUS_FOURCC_SEGMENT_LIST mmioFOURCC('l','s','e','g')
  1519. #define DMUS_FOURCC_SEGMENTITEM_CHUNK mmioFOURCC('s','g','i','h')
  1520. #define DMUS_FOURCC_SEGMENTITEMNAME_CHUNK mmioFOURCC('s','n','a','m')
  1521. /* io structures */
  1522. typedef struct _DMUS_IO_SEGMENT_TRACK_HEADER
  1523. {
  1524. DWORD dwFlags; /* Reserved leave as 0. */
  1525. } DMUS_IO_SEGMENT_TRACK_HEADER;
  1526. typedef struct _DMUS_IO_SEGMENT_ITEM_HEADER
  1527. {
  1528. MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */
  1529. MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */
  1530. DWORD dwPlayFlags; /* Flags for PlaySegment(). */
  1531. DWORD dwFlags; /* Flags. */
  1532. } DMUS_IO_SEGMENT_ITEM_HEADER;
  1533. /* values for dwflags field of DMUS_IO_SEGMENT_ITEM_HEADER */
  1534. #define DMUS_SEGMENTTRACKF_MOTIF 1 /* interpret DMRF as link to style, and use snam as the name of a motif within the style */
  1535. /*
  1536. LIST
  1537. (
  1538. 'segt' // DirectMusic Segment Trigger Track form-type
  1539. [<sgth-ck>] // Segment track header
  1540. <lsgl-list> // List of Segment Lists
  1541. )
  1542. // <sgth-ck>
  1543. 'sgth'
  1544. (
  1545. <DMUS_IO_SEGMENT_TRACK_HEADER>
  1546. )
  1547. // <lsgl-list>
  1548. LIST
  1549. (
  1550. 'lsgl' // Array of segments
  1551. <lseg-list>... // Each segment is encapsulated in a list (that way it can still be riff parsed.)
  1552. )
  1553. // <lseg-list>
  1554. LIST
  1555. (
  1556. 'lseg'
  1557. <sgih-ck>
  1558. <DMRF-list> // Link to a segment or style file.
  1559. [<snam-ck>] // Name field. Used with DMUS_SEGMENTTRACKF_MOTIF flag.
  1560. )
  1561. // <sgih-ck> // segment item header
  1562. (
  1563. <DMUS_IO_SEGMENT_ITEM_HEADER> // Segment item header
  1564. )
  1565. // <snam-ck>
  1566. (
  1567. // Name, stored as NULL terminated string of WCHARs
  1568. )
  1569. */
  1570. /* Script track. */
  1571. /* RIFF ids: */
  1572. #define DMUS_FOURCC_SCRIPTTRACK_LIST mmioFOURCC('s','c','r','t')
  1573. #define DMUS_FOURCC_SCRIPTTRACKEVENTS_LIST mmioFOURCC('s','c','r','l')
  1574. #define DMUS_FOURCC_SCRIPTTRACKEVENT_LIST mmioFOURCC('s','c','r','e')
  1575. #define DMUS_FOURCC_SCRIPTTRACKEVENTHEADER_CHUNK mmioFOURCC('s','c','r','h')
  1576. #define DMUS_FOURCC_SCRIPTTRACKEVENTNAME_CHUNK mmioFOURCC('s','c','r','n')
  1577. /* Flags for DMUS_IO_SCRIPTTRACK_TIMING
  1578. */
  1579. #define DMUS_IO_SCRIPTTRACKF_PREPARE (1 << 0) /* Fire event in advance of time stamp, at Prepare time. This is the default because it leaves the script time to change the music happening at the target time. */
  1580. #define DMUS_IO_SCRIPTTRACKF_QUEUE (1 << 1) /* Fire event just before time stamp, at Queue time. */
  1581. #define DMUS_IO_SCRIPTTRACKF_ATTIME (1 << 2) /* Fire event right at the time stamp. */
  1582. typedef struct _DMUS_IO_SCRIPTTRACK_EVENTHEADER
  1583. {
  1584. DWORD dwFlags; /* various bits (see DMUS_IO_SCRIPTTRACKF_*) */
  1585. MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */
  1586. MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */
  1587. } DMUS_IO_SCRIPTTRACK_EVENTHEADER;
  1588. /*
  1589. // Script Track
  1590. // <scrt-list>
  1591. LIST
  1592. (
  1593. <scrl-list> // List of script events
  1594. )
  1595. // <scrl-list>
  1596. LIST
  1597. (
  1598. <scre-list>... // Array of event descriptions
  1599. )
  1600. // <scre-list>
  1601. LIST
  1602. (
  1603. <scrh-ck> // Event header chunk
  1604. <DMRF>
  1605. <scrn-ck> // Routine name
  1606. )
  1607. 'scrh'
  1608. (
  1609. <DMUS_IO_SCRIPTTRACK_EVENTHEADER>
  1610. )
  1611. 'scrn'
  1612. (
  1613. // Name, stored as NULL terminated string of WCHARs
  1614. )
  1615. */
  1616. /* Lyrics/Notification track. */
  1617. /* RIFF ids: */
  1618. #define DMUS_FOURCC_LYRICSTRACK_LIST mmioFOURCC('l','y','r','t')
  1619. #define DMUS_FOURCC_LYRICSTRACKEVENTS_LIST mmioFOURCC('l','y','r','l')
  1620. #define DMUS_FOURCC_LYRICSTRACKEVENT_LIST mmioFOURCC('l','y','r','e')
  1621. #define DMUS_FOURCC_LYRICSTRACKEVENTHEADER_CHUNK mmioFOURCC('l','y','r','h')
  1622. #define DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK mmioFOURCC('l','y','r','n')
  1623. typedef struct _DMUS_IO_LYRICSTRACK_EVENTHEADER
  1624. {
  1625. DWORD dwFlags; /* Reserved leave as 0. */
  1626. DWORD dwTimingFlags; /* Combination DMUS_PMSGF_TOOL_* flags. Determines the precise timing of when the notification happens. Invalid with the flag DMUS_PMSGF_REFTIME, DMUS_PMSGF_MUSICTIME, DMUS_PMSGF_TOOL_FLUSH, or DMUS_PMSGF_LOCKTOREFTIME. */
  1627. MUSIC_TIME lTimeLogical; /* Position in track list. Time in the music with which the event is associated. */
  1628. MUSIC_TIME lTimePhysical; /* Precise time event will be triggered. Should be close to logical time. */
  1629. } DMUS_IO_LYRICSTRACK_EVENTHEADER;
  1630. /*
  1631. // Lyrics/Notification Track
  1632. // <lyrt-list>
  1633. LIST
  1634. (
  1635. <lyrl-list> // List of notification events
  1636. )
  1637. // <lyrl-list>
  1638. LIST
  1639. (
  1640. <lyre-list>... // Array of event descriptions
  1641. )
  1642. // <lyre-list>
  1643. LIST
  1644. (
  1645. <lyrh-ck> // Event header chunk
  1646. <lyrn-ck> // Notification text
  1647. )
  1648. 'lyrh'
  1649. (
  1650. <DMUS_IO_LYRICSTRACK_EVENTHEADER>
  1651. )
  1652. 'lyrn'
  1653. (
  1654. // Name, stored as NULL terminated string of WCHARs
  1655. )
  1656. */
  1657. /* Parameter control track */
  1658. /* RIFF ids: */
  1659. #define DMUS_FOURCC_PARAMCONTROLTRACK_TRACK_LIST mmioFOURCC('p','r','m','t')
  1660. #define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_LIST mmioFOURCC('p','r','o','l')
  1661. #define DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_CHUNK mmioFOURCC('p','r','o','h')
  1662. #define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_LIST mmioFOURCC('p','r','p','l')
  1663. #define DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_CHUNK mmioFOURCC('p','r','p','h')
  1664. #define DMUS_FOURCC_PARAMCONTROLTRACK_CURVES_CHUNK mmioFOURCC('p','r','c','c')
  1665. typedef struct _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER
  1666. {
  1667. DWORD dwFlags; /* Reserved. Must be zero. */
  1668. GUID guidTimeFormat; /* Time format to set the object to. Must be GUID_TIME_REFERNCE or GUID_TIME_MUSIC from medparam.h. */
  1669. /* Path for finding the object. These fields correspond to the first five parameters of IDirectMusicSegmentState::GetObjectInPath. */
  1670. DWORD dwPChannel;
  1671. DWORD dwStage;
  1672. DWORD dwBuffer;
  1673. GUID guidObject;
  1674. DWORD dwIndex;
  1675. } DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER;
  1676. typedef struct _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER
  1677. {
  1678. DWORD dwFlags; /* Reserved. Must be zero. */
  1679. DWORD dwIndex; /* Index number of the parameter on the object */
  1680. } DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER;
  1681. typedef struct _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO
  1682. {
  1683. MUSIC_TIME mtStartTime;
  1684. MUSIC_TIME mtEndTime;
  1685. float fltStartValue;
  1686. float fltEndValue;
  1687. DWORD dwCurveType; /* One of the items from the MP_CURVE_TYPE enum in medparam.h */
  1688. DWORD dwFlags; /* A combination of the MPF_ENVLP_* constants in medparam.h */
  1689. } DMUS_IO_PARAMCONTROLTRACK_CURVEINFO;
  1690. /*
  1691. // <prmt-list>
  1692. LIST
  1693. (
  1694. <prol-list>... // one for each object
  1695. )
  1696. // <prol-list>
  1697. LIST
  1698. (
  1699. <proh-ck> // object header chunk
  1700. <prpl-list>... // one for each parameter
  1701. )
  1702. // <proh-ck>
  1703. proh
  1704. (
  1705. <DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER>
  1706. )
  1707. // <prpl-list>
  1708. LIST
  1709. (
  1710. <prph-ck> // parameter header chunk
  1711. <prcc-ck> // chunk containing an array of curves
  1712. )
  1713. // <prph-ck>
  1714. prph
  1715. (
  1716. <DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER>
  1717. )
  1718. // <prcc-ck>
  1719. prcc
  1720. (
  1721. // sizeof DMUS_IO_PARAMCONTROLTRACK_CURVEINFO:DWORD
  1722. <DMUS_IO_PARAMCONTROLTRACK_CURVEINFO>... // curves, sorted in order of mtTime
  1723. )
  1724. */
  1725. #if (DIRECTSOUND_VERSION >= 0x0800)
  1726. /* DirectSoundBufferConfig FX Map */
  1727. /* RIFF ids: */
  1728. #define DMUS_FOURCC_DSBC_FORM mmioFOURCC('D','S','B','C')
  1729. #define DMUS_FOURCC_DSBD_CHUNK mmioFOURCC('d','s','b','d')
  1730. #define DMUS_FOURCC_BSID_CHUNK mmioFOURCC('b','s','i','d')
  1731. #define DMUS_FOURCC_DS3D_CHUNK mmioFOURCC('d','s','3','d')
  1732. #define DMUS_FOURCC_DSBC_LIST mmioFOURCC('f','x','l','s')
  1733. #define DMUS_FOURCC_DSFX_FORM mmioFOURCC('D','S','F','X')
  1734. #define DMUS_FOURCC_DSFX_CHUNK mmioFOURCC('f','x','h','r')
  1735. #define DMUS_FOURCC_DSFX_DATA mmioFOURCC('d','a','t','a')
  1736. /* io structures */
  1737. typedef struct _DSOUND_IO_DSBUFFERDESC
  1738. {
  1739. DWORD dwFlags; /* DirectSound buffer creation flags */
  1740. WORD nChannels; /* No. of channels (rest of buffer format is determined by owning sink) */
  1741. LONG lVolume; /* Initial pan; only used if CTRLVOLUME is specified */
  1742. LONG lPan; /* Initial pan; only used if CTRLPAN is specified */
  1743. DWORD dwReserved; /* Reserved - must be 0 */
  1744. } DSOUND_IO_DSBUFFERDESC;
  1745. typedef struct _DSOUND_IO_DSBUSID
  1746. {
  1747. DWORD busid[1]; /* Array size determined from chunk size */
  1748. } DSOUND_IO_DSBUSID;
  1749. typedef struct _DSOUND_IO_3D
  1750. {
  1751. GUID guid3DAlgorithm; /* GUID identifying the 3D algorithm to use (defined in dsound.h) */
  1752. DS3DBUFFER ds3d; /* Initial 3D parameters */
  1753. } DSOUND_IO_3D;
  1754. typedef struct _DSOUND_IO_DXDMO_HEADER
  1755. {
  1756. DWORD dwEffectFlags; /* Effect creation flags - equivalent to DSEFFECTDESC::dwFlags */
  1757. GUID guidDSFXClass; /* GUID identifying the effect to use - corresponds to a COM CLSID */
  1758. GUID guidReserved; /* Reserved - must be the null GUID */
  1759. GUID guidSendBuffer; /* GUID identifying the buffer to send to if this is a send effect */
  1760. DWORD dwReserved; /* Reserved - must be 0 */
  1761. } DSOUND_IO_DXDMO_HEADER;
  1762. typedef struct _DSOUND_IO_DXDMO_DATA
  1763. {
  1764. DWORD data[1]; /* Array size determined by the DMO involved */
  1765. } DSOUND_IO_DXDMO_DATA;
  1766. /*
  1767. RIFF
  1768. (
  1769. 'DSBC' // DirectSoundBufferConfig chunk
  1770. [<guid-ck>] // GUID identifier for this DirectSoundBufferConfig
  1771. [<vers-ck>] // Optional version info
  1772. [<UNFO-list>] // Name, author, copyright info., comments
  1773. <dsbd-ck> // DirectSound Buffer descriptor chunk
  1774. [<bsid-ck>] // Optional bus id array
  1775. [<ds3d-ck>] // Optional 3d Parameters
  1776. [<fxls-list>] // Optional list of FX descriptors
  1777. )
  1778. // <guid-ck>
  1779. 'guid'
  1780. (
  1781. <GUID>
  1782. )
  1783. // <vers-ck>
  1784. 'vers'
  1785. (
  1786. <DMUS_IO_VERSION>
  1787. )
  1788. // <dsbd-ck>
  1789. 'dsbd'
  1790. (
  1791. <DSOUND_IO_DSBUFFERDESC> // Creation parameters and initial settings for the buffer
  1792. )
  1793. // <bsid-ck>
  1794. 'bsid'
  1795. (
  1796. <DSOUND_IO_DSBUSID> // The size of DSOUND_IO_DSBUSID is determined by the chunk size
  1797. )
  1798. // <ds3d-ck>
  1799. 'ds3d'
  1800. (
  1801. <DSOUND_IO_3D> // Initial 3D buffer parameters: position, etc.
  1802. )
  1803. // <fx-list>
  1804. LIST
  1805. (
  1806. 'fxls' // Array of DMO creation parameter blocks
  1807. <DSFX-form>... // Each DMO is encapsulated in a RIFF chunk
  1808. )
  1809. // <DSFX-form> // DMOs can be embedded in a buffer configuration or stored as separate files
  1810. RIFF
  1811. (
  1812. 'DSFX'
  1813. <fxhr-ck> // FX header chunk
  1814. [<data-ck>] // FX initial settings chunk
  1815. )
  1816. // <fxhr-ck>
  1817. 'fxhr'
  1818. (
  1819. <DSOUND_IO_DXDMO_HEADER>
  1820. )
  1821. // <data-ck>
  1822. 'data'
  1823. (
  1824. <DSOUND_IO_DXDMO_DATA> // Opaque data block used by the DMO to load itself.
  1825. // For our standard included DMOs, this is simply the structure accepted by
  1826. // the DMO's SetAllParameters() method - e.g. struct DSFXChorus for Chorus.
  1827. )
  1828. */
  1829. #endif
  1830. #ifdef __cplusplus
  1831. }; /* extern "C" */
  1832. #endif
  1833. #include <poppack.h>
  1834. #endif /* #ifndef _DMUSICF_ */