dmusicf.h 77 KB

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