PageRenderTime 60ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/common/dx9/include/dmusici.h

https://bitbucket.org/ayufan/ayuine2b
C Header | 1883 lines | 1397 code | 198 blank | 288 comment | 0 complexity | b047a014fb70ce92d3cb2f6787283126 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. /************************************************************************
  2. * *
  3. * dmusici.h -- This module contains the API for the *
  4. * DirectMusic performance layer *
  5. * *
  6. * Copyright (c) Microsoft Corporation. All rights reserved. *
  7. * *
  8. ************************************************************************/
  9. #ifndef _DMUSICI_
  10. #define _DMUSICI_
  11. #include <windows.h>
  12. #define COM_NO_WINDOWS_H
  13. #include <objbase.h>
  14. #include <mmsystem.h>
  15. #include <dmusicc.h>
  16. /* plugin (track and tool) interfaces. This #include will eventually go away. */
  17. #include <dmplugin.h>
  18. #include <pshpack8.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. typedef WORD TRANSITION_TYPE;
  23. typedef __int64 REFERENCE_TIME;
  24. typedef long MUSIC_TIME;
  25. #define MT_MIN 0x80000000 /* Minimum music time value. */
  26. #define MT_MAX 0x7FFFFFFF /* Maximum music time value. */
  27. #define DMUS_PPQ 768 /* parts per quarter note */
  28. interface IDirectMusicTrack;
  29. interface IDirectMusicPerformance;
  30. interface IDirectMusicPerformance8;
  31. interface IDirectMusicTool;
  32. interface IDirectMusicSegment;
  33. interface IDirectMusicSegment8;
  34. interface IDirectMusicSegmentState;
  35. interface IDirectMusicSegmentState8;
  36. interface IDirectMusicGraph;
  37. interface IDirectMusicBuffer;
  38. interface IDirectMusicInstrument;
  39. interface IDirectMusicDownloadedInstrument;
  40. interface IDirectMusicBand;
  41. interface IDirectMusicChordMap;
  42. interface IDirectMusicLoader;
  43. interface IDirectMusicLoader8;
  44. interface IDirectMusicScript;
  45. interface IDirectMusicObject;
  46. interface IDirectMusicStyle8;
  47. interface IDirectMusicPatternTrack;
  48. interface IDirectMusicContainer;
  49. interface IDirectMusicTool8;
  50. interface IDirectMusicTrack8;
  51. interface IDirectMusicAudioPath;
  52. #ifndef __cplusplus
  53. typedef interface IDirectMusicTrack IDirectMusicTrack;
  54. typedef interface IDirectMusicPerformance IDirectMusicPerformance;
  55. typedef interface IDirectMusicPerformance8 IDirectMusicPerformance8;
  56. typedef interface IDirectMusicTool IDirectMusicTool;
  57. typedef interface IDirectMusicSegment IDirectMusicSegment;
  58. typedef interface IDirectMusicSegment8 IDirectMusicSegment8;
  59. typedef interface IDirectMusicSegmentState IDirectMusicSegmentState;
  60. typedef interface IDirectMusicSegmentState8 IDirectMusicSegmentState8;
  61. typedef interface IDirectMusicGraph IDirectMusicGraph;
  62. typedef interface IDirectMusicBuffer IDirectMusicBuffer;
  63. typedef interface IDirectMusicInstrument IDirectMusicInstrument;
  64. typedef interface IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument;
  65. typedef interface IDirectMusicBand IDirectMusicBand;
  66. typedef interface IDirectMusicChordMap IDirectMusicChordMap;
  67. typedef interface IDirectMusicObject IDirectMusicObject;
  68. typedef interface IDirectMusicLoader IDirectMusicLoader;
  69. typedef interface IDirectMusicLoader8 IDirectMusicLoader8;
  70. typedef interface IDirectMusicScript IDirectMusicScript;
  71. typedef interface IDirectMusicStyle8 IDirectMusicStyle8;
  72. typedef interface IDirectMusicPatternTrack IDirectMusicPatternTrack;
  73. typedef interface IDirectMusicContainer IDirectMusicContainer;
  74. typedef interface IDirectMusicTool8 IDirectMusicTool8;
  75. typedef interface IDirectMusicTrack8 IDirectMusicTrack8;
  76. typedef interface IDirectMusicAudioPath IDirectMusicAudioPath;
  77. #endif
  78. typedef enum enumDMUS_STYLET_TYPES
  79. {
  80. DMUS_STYLET_PATTERN = 0,
  81. DMUS_STYLET_MOTIF = 1,
  82. } DMUS_STYLET_TYPES;
  83. typedef enum enumDMUS_COMMANDT_TYPES
  84. {
  85. DMUS_COMMANDT_GROOVE = 0,
  86. DMUS_COMMANDT_FILL = 1,
  87. DMUS_COMMANDT_INTRO = 2,
  88. DMUS_COMMANDT_BREAK = 3,
  89. DMUS_COMMANDT_END = 4,
  90. DMUS_COMMANDT_ENDANDINTRO = 5
  91. } DMUS_COMMANDT_TYPES;
  92. typedef enum enumDMUS_SHAPET_TYPES
  93. {
  94. DMUS_SHAPET_FALLING = 0,
  95. DMUS_SHAPET_LEVEL = 1,
  96. DMUS_SHAPET_LOOPABLE = 2,
  97. DMUS_SHAPET_LOUD = 3,
  98. DMUS_SHAPET_QUIET = 4,
  99. DMUS_SHAPET_PEAKING = 5,
  100. DMUS_SHAPET_RANDOM = 6,
  101. DMUS_SHAPET_RISING = 7,
  102. DMUS_SHAPET_SONG = 8
  103. } DMUS_SHAPET_TYPES;
  104. typedef enum enumDMUS_COMPOSEF_FLAGS
  105. {
  106. DMUS_COMPOSEF_NONE = 0,
  107. DMUS_COMPOSEF_ALIGN = 0x1,
  108. DMUS_COMPOSEF_OVERLAP = 0x2,
  109. DMUS_COMPOSEF_IMMEDIATE = 0x4,
  110. DMUS_COMPOSEF_GRID = 0x8,
  111. DMUS_COMPOSEF_BEAT = 0x10,
  112. DMUS_COMPOSEF_MEASURE = 0x20,
  113. DMUS_COMPOSEF_AFTERPREPARETIME = 0x40,
  114. DMUS_COMPOSEF_VALID_START_BEAT = 0x80, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any beat. */
  115. DMUS_COMPOSEF_VALID_START_GRID = 0x100, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any grid. */
  116. DMUS_COMPOSEF_VALID_START_TICK = 0x200, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur any time. */
  117. DMUS_COMPOSEF_SEGMENTEND = 0x400, /* Play the transition at the end of the current segment. */
  118. DMUS_COMPOSEF_MARKER = 0x800, /* Play the transition at the next marker in the current segment. */
  119. DMUS_COMPOSEF_MODULATE = 0x1000,
  120. DMUS_COMPOSEF_LONG = 0x2000,
  121. DMUS_COMPOSEF_ENTIRE_TRANSITION = 0x4000, /* play the entire transition pattern */
  122. DMUS_COMPOSEF_1BAR_TRANSITION = 0x8000, /* play one bar of the transition pattern */
  123. DMUS_COMPOSEF_ENTIRE_ADDITION = 0x10000, /* play the additional pattern in its entirety */
  124. DMUS_COMPOSEF_1BAR_ADDITION = 0x20000, /* play one bar of the additional pattern */
  125. DMUS_COMPOSEF_VALID_START_MEASURE = 0x40000, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any bar. */
  126. DMUS_COMPOSEF_DEFAULT = 0x80000, /* Use segment's default boundary */
  127. DMUS_COMPOSEF_NOINVALIDATE = 0x100000, /* Play without invalidating the currently playing segment(s) */
  128. DMUS_COMPOSEF_USE_AUDIOPATH = 0x200000, /* Uses the audio paths that are embedded in the segments */
  129. DMUS_COMPOSEF_INVALIDATE_PRI = 0x400000 /* Invalidate only the current primary seg state */
  130. } DMUS_COMPOSEF_FLAGS;
  131. #define DMUS_PMSG_PART \
  132. DWORD dwSize; \
  133. REFERENCE_TIME rtTime; /* real time (in 100 nanosecond increments) */ \
  134. MUSIC_TIME mtTime; /* music time */ \
  135. DWORD dwFlags; /* various bits (see DMUS_PMSGF_FLAGS enumeration) */ \
  136. DWORD dwPChannel; /* Performance Channel. The Performance can */ \
  137. /* use this to determine the port/channel. */ \
  138. DWORD dwVirtualTrackID; /* virtual track ID */ \
  139. IDirectMusicTool* pTool; /* tool interface pointer */ \
  140. IDirectMusicGraph* pGraph; /* tool graph interface pointer */ \
  141. DWORD dwType; /* PMSG type (see DMUS_PMSGT_TYPES defines) */ \
  142. DWORD dwVoiceID; /* unique voice id which allows synthesizers to */ \
  143. /* identify a specific event. For DirectX 6.0, */ \
  144. /* this field should always be 0. */ \
  145. DWORD dwGroupID; /* Track group id */ \
  146. IUnknown* punkUser; /* user com pointer, auto released upon PMSG free */
  147. /* every DMUS_PMSG is based off of this structure. The Performance needs
  148. to access these members consistently in every PMSG that goes through it. */
  149. typedef struct _DMUS_PMSG
  150. {
  151. /* begin DMUS_PMSG_PART */
  152. DMUS_PMSG_PART
  153. /* end DMUS_PMSG_PART */
  154. } DMUS_PMSG;
  155. #define DMUS_PCHANNEL_BROADCAST_PERFORMANCE 0xFFFFFFFF /* PMsg is sent on all PChannels of the performance. */
  156. #define DMUS_PCHANNEL_BROADCAST_AUDIOPATH 0xFFFFFFFE /* PMsg is sent on all PChannels of the audio path. */
  157. #define DMUS_PCHANNEL_BROADCAST_SEGMENT 0xFFFFFFFD /* PMsg is sent on all PChannels of the segment. */
  158. #define DMUS_PCHANNEL_BROADCAST_GROUPS 0xFFFFFFFC /* A duplicate PMsg is for each Channels Groups in the performance. */
  159. /* The DMUS_PATH constants are used in conjunction with GetObjectInPath to find a requested
  160. interface at a particular stage in the audio path.
  161. */
  162. #define DMUS_PATH_SEGMENT 0x1000 /* Get the segment itself (from a segment state.) */
  163. #define DMUS_PATH_SEGMENT_TRACK 0x1100 /* Look in Track List of Segment. */
  164. #define DMUS_PATH_SEGMENT_GRAPH 0x1200 /* Get the segment's tool graph. */
  165. #define DMUS_PATH_SEGMENT_TOOL 0x1300 /* Look in Tool Graph of Segment. */
  166. #define DMUS_PATH_AUDIOPATH 0x2000 /* Get the audiopath itself (from a segment state.) */
  167. #define DMUS_PATH_AUDIOPATH_GRAPH 0x2200 /* Get the audiopath's tool graph. */
  168. #define DMUS_PATH_AUDIOPATH_TOOL 0x2300 /* Look in Tool Graph of Audio Path. */
  169. #define DMUS_PATH_PERFORMANCE 0x3000 /* Access the performance. */
  170. #define DMUS_PATH_PERFORMANCE_GRAPH 0x3200 /* Get the performance's tool graph. */
  171. #define DMUS_PATH_PERFORMANCE_TOOL 0x3300 /* Look in Tool Graph of Performance. */
  172. #define DMUS_PATH_PORT 0x4000 /* Access the synth. */
  173. #define DMUS_PATH_BUFFER 0x6000 /* Look in DirectSoundBuffer. */
  174. #define DMUS_PATH_BUFFER_DMO 0x6100 /* Access a DMO in the buffer. */
  175. #define DMUS_PATH_MIXIN_BUFFER 0x7000 /* Look in a global mixin buffer. */
  176. #define DMUS_PATH_MIXIN_BUFFER_DMO 0x7100 /* Access a DMO in a global mixin buffer. */
  177. #define DMUS_PATH_PRIMARY_BUFFER 0x8000 /* Access the primary buffer. */
  178. /* To ignore PChannels when calling GetObjectInPath(), use the DMUS_PCHANNEL_ALL constant. */
  179. #define DMUS_PCHANNEL_ALL 0xFFFFFFFB
  180. /* The DMUS_APATH types are used in conjunction with CreateStandardAudioPath to
  181. build default path types. _SHARED_ means the same buffer is shared across multiple
  182. instantiations of the audiopath type. _DYNAMIC_ means a unique buffer is created
  183. every time.
  184. */
  185. #define DMUS_APATH_SHARED_STEREOPLUSREVERB 1 /* A standard music set up with stereo outs and reverb. */
  186. #define DMUS_APATH_DYNAMIC_3D 6 /* An audio path with one dynamic bus from the synth feeding to a dynamic 3d buffer. Does not send to env reverb. */
  187. #define DMUS_APATH_DYNAMIC_MONO 7 /* An audio path with one dynamic bus from the synth feeding to a dynamic mono buffer. */
  188. #define DMUS_APATH_DYNAMIC_STEREO 8 /* An audio path with two dynamic buses from the synth feeding to a dynamic stereo buffer. */
  189. typedef struct _DMUS_AUDIOPARAMS
  190. {
  191. DWORD dwSize; /* Size of this structure. */
  192. BOOL fInitNow; /* If true, the sink and synth are created immediately and results returned in this structure. */
  193. DWORD dwValidData; /* Flags indicating which fields below are valid. */
  194. DWORD dwFeatures; /* Required DMUS_AUDIOF features. */
  195. DWORD dwVoices; /* Required number of voices. */
  196. DWORD dwSampleRate; /* Sample rate of synths and sink. */
  197. CLSID clsidDefaultSynth; /* Class ID of default synthesizer. */
  198. } DMUS_AUDIOPARAMS;
  199. /* dwFeatures flags. These indicate which features are required for the audio environment. */
  200. #define DMUS_AUDIOF_3D 0x1 /* Require 3D buffers. */
  201. #define DMUS_AUDIOF_ENVIRON 0x2 /* Require environmental modeling. */
  202. #define DMUS_AUDIOF_EAX 0x4 /* Require use of EAX effects. */
  203. #define DMUS_AUDIOF_DMOS 0x8 /* Require use of additional DMOs. */
  204. #define DMUS_AUDIOF_STREAMING 0x10 /* Require support for streaming waves. */
  205. #define DMUS_AUDIOF_BUFFERS 0x20 /* Require support for multiple buffers (all above cases need this.) */
  206. #define DMUS_AUDIOF_ALL 0x3F /* Requires everything. */
  207. /* dwValidData flags. These indicate which fields in DMUS_AUDIOPARAMS have been filled in. If fInitNow is set, these also return what was allocated. */
  208. #define DMUS_AUDIOPARAMS_FEATURES 0x00000001
  209. #define DMUS_AUDIOPARAMS_VOICES 0x00000002
  210. #define DMUS_AUDIOPARAMS_SAMPLERATE 0x00000004
  211. #define DMUS_AUDIOPARAMS_DEFAULTSYNTH 0x00000008
  212. /* DMUS_PMSGF_FLAGS fill the DMUS_PMSG's dwFlags member */
  213. typedef enum enumDMUS_PMSGF_FLAGS
  214. {
  215. DMUS_PMSGF_REFTIME = 1, /* if rtTime is valid */
  216. DMUS_PMSGF_MUSICTIME = 2, /* if mtTime is valid */
  217. DMUS_PMSGF_TOOL_IMMEDIATE = 4, /* if PMSG should be processed immediately */
  218. DMUS_PMSGF_TOOL_QUEUE = 8, /* if PMSG should be processed a little early, at Queue time */
  219. DMUS_PMSGF_TOOL_ATTIME = 0x10, /* if PMSG should be processed at the time stamp */
  220. DMUS_PMSGF_TOOL_FLUSH = 0x20, /* if PMSG is being flushed */
  221. DMUS_PMSGF_LOCKTOREFTIME = 0x40, /* if rtTime can not be overriden by a tempo change. */
  222. DMUS_PMSGF_DX8 = 0x80 /* if the message has DX8 or later extensions. */
  223. /* The values of DMUS_TIME_RESOLVE_FLAGS may also be used inside the */
  224. /* DMUS_PMSG's dwFlags member. */
  225. } DMUS_PMSGF_FLAGS;
  226. /* DMUS_PMSGT_TYPES fill the DMUS_PMSG's dwType member */
  227. typedef enum enumDMUS_PMSGT_TYPES
  228. {
  229. DMUS_PMSGT_MIDI = 0, /* MIDI short message */
  230. DMUS_PMSGT_NOTE = 1, /* Interactive Music Note */
  231. DMUS_PMSGT_SYSEX = 2, /* MIDI long message (system exclusive message) */
  232. DMUS_PMSGT_NOTIFICATION = 3, /* Notification message */
  233. DMUS_PMSGT_TEMPO = 4, /* Tempo message */
  234. DMUS_PMSGT_CURVE = 5, /* Control change / pitch bend, etc. curve */
  235. DMUS_PMSGT_TIMESIG = 6, /* Time signature */
  236. DMUS_PMSGT_PATCH = 7, /* Patch changes */
  237. DMUS_PMSGT_TRANSPOSE = 8, /* Transposition messages */
  238. DMUS_PMSGT_CHANNEL_PRIORITY = 9, /* Channel priority */
  239. DMUS_PMSGT_STOP = 10, /* Stop message */
  240. DMUS_PMSGT_DIRTY = 11, /* Tells Tools that cache GetParam() info to refresh */
  241. DMUS_PMSGT_WAVE = 12, /* Carries control information for playing a wave. */
  242. DMUS_PMSGT_LYRIC = 13, /* Lyric message from lyric track. */
  243. DMUS_PMSGT_SCRIPTLYRIC = 14, /* Lyric message sent by a script with the Trace function. */
  244. DMUS_PMSGT_USER = 255 /* User message */
  245. } DMUS_PMSGT_TYPES;
  246. /* DMUS_SEGF_FLAGS correspond to IDirectMusicPerformance::PlaySegment, and other API */
  247. typedef enum enumDMUS_SEGF_FLAGS
  248. {
  249. DMUS_SEGF_REFTIME = 1<<6, /* 0x40 Time parameter is in reference time */
  250. DMUS_SEGF_SECONDARY = 1<<7, /* 0x80 Secondary segment */
  251. DMUS_SEGF_QUEUE = 1<<8, /* 0x100 Queue at the end of the primary segment queue (primary only) */
  252. DMUS_SEGF_CONTROL = 1<<9, /* 0x200 Play as a control track (secondary segments only) */
  253. DMUS_SEGF_AFTERPREPARETIME = 1<<10, /* 0x400 Play after the prepare time (See IDirectMusicPerformance::GetPrepareTime) */
  254. DMUS_SEGF_GRID = 1<<11, /* 0x800 Play on grid boundary */
  255. DMUS_SEGF_BEAT = 1<<12, /* 0x1000 Play on beat boundary */
  256. DMUS_SEGF_MEASURE = 1<<13, /* 0x2000 Play on measure boundary */
  257. DMUS_SEGF_DEFAULT = 1<<14, /* 0x4000 Use segment's default boundary */
  258. DMUS_SEGF_NOINVALIDATE = 1<<15, /* 0x8000 Play without invalidating the currently playing segment(s) */
  259. DMUS_SEGF_ALIGN = 1<<16, /* 0x10000 Align segment with requested boundary, but switch at first valid point */
  260. DMUS_SEGF_VALID_START_BEAT = 1<<17, /* 0x20000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any beat. */
  261. DMUS_SEGF_VALID_START_GRID = 1<<18, /* 0x40000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any grid. */
  262. DMUS_SEGF_VALID_START_TICK = 1<<19, /* 0x80000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur any time. */
  263. DMUS_SEGF_AUTOTRANSITION = 1<<20, /* 0x100000 Compose and play a transition segment, using the transition template. */
  264. DMUS_SEGF_AFTERQUEUETIME = 1<<21, /* 0x200000 Make sure to play after the queue time. This is default for primary segments */
  265. DMUS_SEGF_AFTERLATENCYTIME = 1<<22, /* 0x400000 Make sure to play after the latency time. This is true for all segments, so this is a nop */
  266. DMUS_SEGF_SEGMENTEND = 1<<23, /* 0x800000 Play at the next end of segment. */
  267. DMUS_SEGF_MARKER = 1<<24, /* 0x1000000 Play at next marker in the primary segment. If there are no markers, default to any other resolution requests. */
  268. DMUS_SEGF_TIMESIG_ALWAYS = 1<<25, /* 0x2000000 Even if there is no primary segment, align start time with current time signature. */
  269. DMUS_SEGF_USE_AUDIOPATH = 1<<26, /* 0x4000000 Uses the audio path that is embedded in the segment. */
  270. DMUS_SEGF_VALID_START_MEASURE = 1<<27, /* 0x8000000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any bar. */
  271. DMUS_SEGF_INVALIDATE_PRI = 1<<28 /* 0x10000000 invalidate only the current primary seg state */
  272. } DMUS_SEGF_FLAGS;
  273. #define DMUS_SEG_REPEAT_INFINITE 0xFFFFFFFF /* For IDirectMusicSegment::SetRepeat*/
  274. #define DMUS_SEG_ALLTRACKS 0x80000000 /* For IDirectMusicSegment::SetParam() and SetTrackConfig() - selects all tracks instead on nth index. */
  275. #define DMUS_SEG_ANYTRACK 0x80000000 /* For IDirectMusicSegment::GetParam() - checks each track until it finds one that returns data (not DMUS_E_NOT_FOUND.) */
  276. /* DMUS_TIME_RESOLVE_FLAGS correspond to IDirectMusicPerformance::GetResolvedTime, and can */
  277. /* also be used interchangeably with the corresponding DMUS_SEGF_FLAGS, since their values */
  278. /* are intentionally the same */
  279. typedef enum enumDMUS_TIME_RESOLVE_FLAGS
  280. {
  281. DMUS_TIME_RESOLVE_AFTERPREPARETIME = DMUS_SEGF_AFTERPREPARETIME,
  282. DMUS_TIME_RESOLVE_AFTERQUEUETIME = DMUS_SEGF_AFTERQUEUETIME,
  283. DMUS_TIME_RESOLVE_AFTERLATENCYTIME = DMUS_SEGF_AFTERLATENCYTIME,
  284. DMUS_TIME_RESOLVE_GRID = DMUS_SEGF_GRID,
  285. DMUS_TIME_RESOLVE_BEAT = DMUS_SEGF_BEAT,
  286. DMUS_TIME_RESOLVE_MEASURE = DMUS_SEGF_MEASURE,
  287. DMUS_TIME_RESOLVE_MARKER = DMUS_SEGF_MARKER,
  288. DMUS_TIME_RESOLVE_SEGMENTEND = DMUS_SEGF_SEGMENTEND,
  289. } DMUS_TIME_RESOLVE_FLAGS;
  290. /* The following flags are sent inside the DMUS_CHORD_KEY.dwFlags parameter */
  291. typedef enum enumDMUS_CHORDKEYF_FLAGS
  292. {
  293. DMUS_CHORDKEYF_SILENT = 1, /* is the chord silent? */
  294. } DMUS_CHORDKEYF_FLAGS;
  295. #define DMUS_MAXSUBCHORD 8
  296. typedef struct _DMUS_SUBCHORD
  297. {
  298. DWORD dwChordPattern; /* Notes in the subchord */
  299. DWORD dwScalePattern; /* Notes in the scale */
  300. DWORD dwInversionPoints; /* Where inversions can occur */
  301. DWORD dwLevels; /* Which levels are supported by this subchord */
  302. BYTE bChordRoot; /* Root of the subchord */
  303. BYTE bScaleRoot; /* Root of the scale */
  304. } DMUS_SUBCHORD;
  305. typedef struct _DMUS_CHORD_KEY
  306. {
  307. WCHAR wszName[16]; /* Name of the chord */
  308. WORD wMeasure; /* Measure this falls on */
  309. BYTE bBeat; /* Beat this falls on */
  310. BYTE bSubChordCount; /* Number of chords in the list of subchords */
  311. DMUS_SUBCHORD SubChordList[DMUS_MAXSUBCHORD]; /* List of sub chords */
  312. DWORD dwScale; /* Scale underlying the entire chord */
  313. BYTE bKey; /* Key underlying the entire chord */
  314. BYTE bFlags; /* Miscelaneous flags */
  315. } DMUS_CHORD_KEY;
  316. /* DMUS_NOTE_PMSG */
  317. typedef struct _DMUS_NOTE_PMSG
  318. {
  319. /* begin DMUS_PMSG_PART */
  320. DMUS_PMSG_PART
  321. /* end DMUS_PMSG_PART */
  322. MUSIC_TIME mtDuration; /* duration */
  323. WORD wMusicValue; /* Description of note in chord and key. */
  324. WORD wMeasure; /* Measure in which this note occurs */
  325. short nOffset; /* Offset from grid at which this note occurs */
  326. BYTE bBeat; /* Beat (in measure) at which this note occurs */
  327. BYTE bGrid; /* Grid offset from beat at which this note occurs */
  328. BYTE bVelocity; /* Note velocity */
  329. BYTE bFlags; /* see DMUS_NOTEF_FLAGS */
  330. BYTE bTimeRange; /* Range to randomize time. */
  331. BYTE bDurRange; /* Range to randomize duration. */
  332. BYTE bVelRange; /* Range to randomize velocity. */
  333. BYTE bPlayModeFlags; /* Play mode */
  334. BYTE bSubChordLevel; /* Which subchord level this note uses. */
  335. BYTE bMidiValue; /* The MIDI note value, converted from wMusicValue */
  336. char cTranspose; /* Transposition to add to midi note value after converted from wMusicValue. */
  337. } DMUS_NOTE_PMSG;
  338. typedef enum enumDMUS_NOTEF_FLAGS
  339. {
  340. DMUS_NOTEF_NOTEON = 1, /* Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off */
  341. /* DX8 flags: */
  342. DMUS_NOTEF_NOINVALIDATE = 2, /* Don't invalidate this note off. */
  343. DMUS_NOTEF_NOINVALIDATE_INSCALE = 4,/* Don't invalidate if still within the scale. */
  344. DMUS_NOTEF_NOINVALIDATE_INCHORD = 8,/* Don't invalidate if still within the chord. */
  345. DMUS_NOTEF_REGENERATE = 0x10, /* Regenerate the note on an invalidate. */
  346. } DMUS_NOTEF_FLAGS;
  347. /* The DMUS_PLAYMODE_FLAGS are used to determine how to convert wMusicValue
  348. into the appropriate bMidiValue.
  349. */
  350. typedef enum enumDMUS_PLAYMODE_FLAGS
  351. {
  352. DMUS_PLAYMODE_KEY_ROOT = 1, /* Transpose on top of the key root. */
  353. DMUS_PLAYMODE_CHORD_ROOT = 2, /* Transpose on top of the chord root. */
  354. DMUS_PLAYMODE_SCALE_INTERVALS = 4, /* Use scale intervals from scale pattern. */
  355. DMUS_PLAYMODE_CHORD_INTERVALS = 8, /* Use chord intervals from chord pattern. */
  356. DMUS_PLAYMODE_NONE = 16, /* No mode. Indicates the parent part's mode should be used. */
  357. } DMUS_PLAYMODE_FLAGS;
  358. /* The following are playback modes that can be created by combining the DMUS_PLAYMODE_FLAGS
  359. in various ways:
  360. */
  361. /* Fixed. wMusicValue holds final MIDI note value. This is used for drums, sound effects, and sequenced
  362. notes that should not be transposed by the chord or scale.
  363. */
  364. #define DMUS_PLAYMODE_FIXED 0
  365. /* In fixed to key, the musicvalue is again a fixed MIDI value, but it
  366. is transposed on top of the key root.
  367. */
  368. #define DMUS_PLAYMODE_FIXEDTOKEY DMUS_PLAYMODE_KEY_ROOT
  369. /* In fixed to chord, the musicvalue is also a fixed MIDI value, but it
  370. is transposed on top of the chord root.
  371. */
  372. #define DMUS_PLAYMODE_FIXEDTOCHORD DMUS_PLAYMODE_CHORD_ROOT
  373. /* In Pedalpoint, the key root is used and the notes only track the intervals in
  374. the scale. The chord root and intervals are completely ignored. This is useful
  375. for melodic lines that play relative to the key root.
  376. */
  377. #define DMUS_PLAYMODE_PEDALPOINT (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS)
  378. /* In the Melodic mode, the chord root is used but the notes only track the intervals in
  379. the scale. The key root and chord intervals are completely ignored. This is useful
  380. for melodic lines that play relative to the chord root.
  381. */
  382. #define DMUS_PLAYMODE_MELODIC (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS)
  383. /* Normal chord mode is the prevalent playback mode.
  384. The notes track the intervals in the chord, which is based on the chord root.
  385. If there is a scale component to the MusicValue, the additional intervals
  386. are pulled from the scale and added.
  387. If the chord does not have an interval to match the chord component of
  388. the MusicValue, the note is silent.
  389. */
  390. #define DMUS_PLAYMODE_NORMALCHORD (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS)
  391. /* If it is desirable to play a note that is above the top of the chord, the
  392. always play mode (known as "purpleized" in a former life) finds a position
  393. for the note by using intervals from the scale. Essentially, this mode is
  394. a combination of the Normal and Melodic playback modes, where a failure
  395. in Normal causes a second try in Melodic mode.
  396. */
  397. #define DMUS_PLAYMODE_ALWAYSPLAY (DMUS_PLAYMODE_MELODIC | DMUS_PLAYMODE_NORMALCHORD)
  398. /* These playmodes are new for dx8. */
  399. /* In PedalpointChord, the key root is used and the notes only track the intervals in
  400. the chord. The chord root and scale intervals are completely ignored. This is useful
  401. for chordal lines that play relative to the key root.
  402. */
  403. #define DMUS_PLAYMODE_PEDALPOINTCHORD (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS)
  404. /* For completeness, here's a mode that tries for pedalpointchord, but if it fails
  405. uses scale intervals
  406. */
  407. #define DMUS_PLAYMODE_PEDALPOINTALWAYS (DMUS_PLAYMODE_PEDALPOINT | DMUS_PLAYMODE_PEDALPOINTCHORD)
  408. /* Legacy names for modes... */
  409. #define DMUS_PLAYMODE_PURPLEIZED DMUS_PLAYMODE_ALWAYSPLAY
  410. #define DMUS_PLAYMODE_SCALE_ROOT DMUS_PLAYMODE_KEY_ROOT
  411. #define DMUS_PLAYMODE_FIXEDTOSCALE DMUS_PLAYMODE_FIXEDTOKEY
  412. /* DMUS_MIDI_PMSG */
  413. typedef struct _DMUS_MIDI_PMSG
  414. {
  415. /* begin DMUS_PMSG_PART */
  416. DMUS_PMSG_PART
  417. /* end DMUS_PMSG_PART */
  418. BYTE bStatus;
  419. BYTE bByte1;
  420. BYTE bByte2;
  421. BYTE bPad[1];
  422. } DMUS_MIDI_PMSG;
  423. /* DMUS_PATCH_PMSG */
  424. typedef struct _DMUS_PATCH_PMSG
  425. {
  426. /* begin DMUS_PMSG_PART */
  427. DMUS_PMSG_PART
  428. /* end DMUS_PMSG_PART */
  429. BYTE byInstrument;
  430. BYTE byMSB;
  431. BYTE byLSB;
  432. BYTE byPad[1];
  433. } DMUS_PATCH_PMSG;
  434. /* DMUS_TRANSPOSE_PMSG */
  435. typedef struct _DMUS_TRANSPOSE_PMSG
  436. {
  437. /* begin DMUS_PMSG_PART */
  438. DMUS_PMSG_PART
  439. /* end DMUS_PMSG_PART */
  440. short nTranspose;
  441. /* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) */
  442. WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/
  443. } DMUS_TRANSPOSE_PMSG;
  444. /* DMUS_CHANNEL_PRIORITY_PMSG */
  445. typedef struct _DMUS_CHANNEL_PRIORITY_PMSG
  446. {
  447. /* begin DMUS_PMSG_PART */
  448. DMUS_PMSG_PART
  449. /* end DMUS_PMSG_PART */
  450. DWORD dwChannelPriority;
  451. } DMUS_CHANNEL_PRIORITY_PMSG;
  452. /* DMUS_TEMPO_PMSG */
  453. typedef struct _DMUS_TEMPO_PMSG
  454. {
  455. /* begin DMUS_PMSG_PART */
  456. DMUS_PMSG_PART
  457. /* end DMUS_PMSG_PART */
  458. double dblTempo; /* the tempo */
  459. } DMUS_TEMPO_PMSG;
  460. #define DMUS_TEMPO_MAX 1000
  461. #define DMUS_TEMPO_MIN 1
  462. #define DMUS_MASTERTEMPO_MAX 100.0f
  463. #define DMUS_MASTERTEMPO_MIN 0.01f
  464. /* DMUS_SYSEX_PMSG */
  465. typedef struct _DMUS_SYSEX_PMSG
  466. {
  467. /* begin DMUS_PMSG_PART */
  468. DMUS_PMSG_PART
  469. /* end DMUS_PMSG_PART */
  470. DWORD dwLen; /* length of the data */
  471. BYTE abData[1]; /* array of data, length equal to dwLen */
  472. } DMUS_SYSEX_PMSG;
  473. /* DMUS_CURVE_PMSG */
  474. typedef struct _DMUS_CURVE_PMSG
  475. {
  476. /* begin DMUS_PMSG_PART */
  477. DMUS_PMSG_PART
  478. /* end DMUS_PMSG_PART */
  479. MUSIC_TIME mtDuration; /* how long this curve lasts */
  480. MUSIC_TIME mtOriginalStart; /* must be set to either zero when this PMSG is created or to the original mtTime of the curve */
  481. MUSIC_TIME mtResetDuration; /* how long after the curve is finished to allow a flush or
  482. invalidation to reset to the reset value, nResetValue */
  483. short nStartValue; /* curve's start value */
  484. short nEndValue; /* curve's end value */
  485. short nResetValue; /* curve's reset value, set when a flush or invalidation
  486. occurs within mtDuration + mtResetDuration */
  487. WORD wMeasure; /* Measure in which this curve occurs */
  488. short nOffset; /* Offset from grid at which this curve occurs */
  489. BYTE bBeat; /* Beat (in measure) at which this curve occurs */
  490. BYTE bGrid; /* Grid offset from beat at which this curve occurs */
  491. BYTE bType; /* type of curve */
  492. BYTE bCurveShape; /* shape of curve */
  493. BYTE bCCData; /* CC# if this is a control change type */
  494. BYTE bFlags; /* Curve reset and start from current value flags. */
  495. /* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) */
  496. WORD wParamType; /* RPN or NRPN parameter number. */
  497. WORD wMergeIndex; /* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/
  498. } DMUS_CURVE_PMSG;
  499. typedef enum enumDMUS_CURVE_FLAGS
  500. {
  501. DMUS_CURVE_RESET = 1, /* When set, the nResetValue must be sent when the
  502. time is reached or an invalidate occurs because
  503. of a transition. If not set, the curve stays
  504. permanently stuck at the new value. */
  505. DMUS_CURVE_START_FROM_CURRENT = 2/* Ignore Start, start the curve at the current value.
  506. This only works for volume, expression, and pitchbend. */
  507. } DMUS_CURVE_FLAGS;
  508. #define DMUS_CURVE_RESET 1
  509. /* Curve shapes */
  510. enum
  511. {
  512. DMUS_CURVES_LINEAR = 0,
  513. DMUS_CURVES_INSTANT = 1,
  514. DMUS_CURVES_EXP = 2,
  515. DMUS_CURVES_LOG = 3,
  516. DMUS_CURVES_SINE = 4
  517. };
  518. /* curve types */
  519. #define DMUS_CURVET_PBCURVE 0x03 /* Pitch bend curve. */
  520. #define DMUS_CURVET_CCCURVE 0x04 /* Control change curve. */
  521. #define DMUS_CURVET_MATCURVE 0x05 /* Mono aftertouch curve. */
  522. #define DMUS_CURVET_PATCURVE 0x06 /* Poly aftertouch curve. */
  523. #define DMUS_CURVET_RPNCURVE 0x07 /* RPN curve with curve type in wParamType. */
  524. #define DMUS_CURVET_NRPNCURVE 0x08 /* NRPN curve with curve type in wParamType. */
  525. /* DMUS_TIMESIG_PMSG */
  526. typedef struct _DMUS_TIMESIG_PMSG
  527. {
  528. /* begin DMUS_PMSG_PART */
  529. DMUS_PMSG_PART
  530. /* end DMUS_PMSG_PART */
  531. /* Time signatures define how many beats per measure, which note receives */
  532. /* the beat, and the grid resolution. */
  533. BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */
  534. BYTE bBeat; /* what note receives the beat (bottom of time sig.) */
  535. /* we can assume that 0 means 256th note */
  536. WORD wGridsPerBeat; /* grids per beat */
  537. } DMUS_TIMESIG_PMSG;
  538. /* notification type values */
  539. /* The following correspond to GUID_NOTIFICATION_SEGMENT */
  540. #define DMUS_NOTIFICATION_SEGSTART 0
  541. #define DMUS_NOTIFICATION_SEGEND 1
  542. #define DMUS_NOTIFICATION_SEGALMOSTEND 2
  543. #define DMUS_NOTIFICATION_SEGLOOP 3
  544. #define DMUS_NOTIFICATION_SEGABORT 4
  545. /* The following correspond to GUID_NOTIFICATION_PERFORMANCE */
  546. #define DMUS_NOTIFICATION_MUSICSTARTED 0
  547. #define DMUS_NOTIFICATION_MUSICSTOPPED 1
  548. #define DMUS_NOTIFICATION_MUSICALMOSTEND 2
  549. /* The following corresponds to GUID_NOTIFICATION_MEASUREANDBEAT */
  550. #define DMUS_NOTIFICATION_MEASUREBEAT 0
  551. /* The following corresponds to GUID_NOTIFICATION_CHORD */
  552. #define DMUS_NOTIFICATION_CHORD 0
  553. /* The following correspond to GUID_NOTIFICATION_COMMAND */
  554. #define DMUS_NOTIFICATION_GROOVE 0
  555. #define DMUS_NOTIFICATION_EMBELLISHMENT 1
  556. /* The following corresponds to GUID_NOTIFICATION_RECOMPOSE */
  557. #define DMUS_NOTIFICATION_RECOMPOSE 0
  558. /* DMUS_NOTIFICATION_PMSG */
  559. typedef struct _DMUS_NOTIFICATION_PMSG
  560. {
  561. /* begin DMUS_PMSG_PART */
  562. DMUS_PMSG_PART
  563. /* end DMUS_PMSG_PART */
  564. GUID guidNotificationType;
  565. DWORD dwNotificationOption;
  566. DWORD dwField1;
  567. DWORD dwField2;
  568. } DMUS_NOTIFICATION_PMSG;
  569. /* DMUS_WAVE_PMSG */
  570. typedef struct _DMUS_WAVE_PMSG
  571. {
  572. /* begin DMUS_PMSG_PART */
  573. DMUS_PMSG_PART
  574. /* end DMUS_PMSG_PART */
  575. REFERENCE_TIME rtStartOffset; /* How far into the wave to start, in reference time units only. */
  576. REFERENCE_TIME rtDuration; /* Duration of the wave, in either reference time or music time. */
  577. long lOffset; /* Offset from actual time to logical time, in music or ref time. */
  578. long lVolume; /* Initial volume, in 100ths of a dB. */
  579. long lPitch; /* Initial pitch, in 100ths of a semitone. */
  580. BYTE bFlags; /* Flags, including DMUS_WAVEF_OFF... */
  581. } DMUS_WAVE_PMSG;
  582. #define DMUS_WAVEF_OFF 1 /* If wave is playing and this is the off message. */
  583. #define DMUS_WAVEF_STREAMING 2 /* If wave is streaming. */
  584. #define DMUS_WAVEF_NOINVALIDATE 4 /* Don't invalidate this wave. */
  585. #define DMUS_WAVEF_NOPREROLL 8 /* Don't preroll any wave data. */
  586. #define DMUS_WAVEF_IGNORELOOPS 0x20 /* Ignore segment looping. */
  587. /* DMUS_LYRIC_PMSG */
  588. typedef struct _DMUS_LYRIC_PMSG
  589. {
  590. /* begin DMUS_PMSG_PART */
  591. DMUS_PMSG_PART
  592. /* end DMUS_PMSG_PART */
  593. WCHAR wszString[1]; /* null-terminated Unicode lyric string (structure is actually larger than size 1) */
  594. } DMUS_LYRIC_PMSG;
  595. #define DMUS_MAX_NAME 64 /* Maximum object name length. */
  596. #define DMUS_MAX_CATEGORY 64 /* Maximum object category name length. */
  597. #define DMUS_MAX_FILENAME MAX_PATH
  598. typedef struct _DMUS_VERSION {
  599. DWORD dwVersionMS;
  600. DWORD dwVersionLS;
  601. }DMUS_VERSION, FAR *LPDMUS_VERSION;
  602. /* Time Signature structure, used by IDirectMusicStyle */
  603. /* Also used as a parameter for GetParam() and SetParam */
  604. typedef struct _DMUS_TIMESIGNATURE
  605. {
  606. MUSIC_TIME mtTime;
  607. BYTE bBeatsPerMeasure; /* beats per measure (top of time sig) */
  608. BYTE bBeat; /* what note receives the beat (bottom of time sig.) */
  609. /* we can assume that 0 means 256th note */
  610. WORD wGridsPerBeat; /* grids per beat */
  611. } DMUS_TIMESIGNATURE;
  612. typedef struct _DMUS_VALID_START_PARAM
  613. {
  614. MUSIC_TIME mtTime; /* Time of the first legal start
  615. point after (or including) the requested time.
  616. This is a returned value.
  617. Time format is the relative offset from requested time. */
  618. } DMUS_VALID_START_PARAM;
  619. typedef struct _DMUS_PLAY_MARKER_PARAM
  620. {
  621. MUSIC_TIME mtTime; /* Time of the first legal segment play
  622. marker before (or including) the requested time.
  623. This is a returned value.
  624. Time format is the relative offset from requested time. */
  625. } DMUS_PLAY_MARKER_PARAM;
  626. /* The DMUSOBJECTDESC structure is used to communicate everything you could */
  627. /* possibly use to describe a DirectMusic object. */
  628. typedef struct _DMUS_OBJECTDESC
  629. {
  630. DWORD dwSize; /* Size of this structure. */
  631. DWORD dwValidData; /* Flags indicating which fields below are valid. */
  632. GUID guidObject; /* Unique ID for this object. */
  633. GUID guidClass; /* GUID for the class of object. */
  634. FILETIME ftDate; /* Last edited date of object. */
  635. DMUS_VERSION vVersion; /* Version. */
  636. WCHAR wszName[DMUS_MAX_NAME]; /* Name of object. */
  637. WCHAR wszCategory[DMUS_MAX_CATEGORY]; /* Category for object (optional). */
  638. WCHAR wszFileName[DMUS_MAX_FILENAME]; /* File path. */
  639. LONGLONG llMemLength; /* Size of Memory data. */
  640. LPBYTE pbMemData; /* Memory pointer for data. */
  641. IStream * pStream; /* Stream with data. */
  642. } DMUS_OBJECTDESC;
  643. typedef DMUS_OBJECTDESC *LPDMUS_OBJECTDESC;
  644. /* Flags for dwValidData. When set, a flag indicates that the */
  645. /* corresponding field in DMUSOBJECTDESC holds valid data. */
  646. #define DMUS_OBJ_OBJECT (1 << 0) /* Object GUID is valid. */
  647. #define DMUS_OBJ_CLASS (1 << 1) /* Class GUID is valid. */
  648. #define DMUS_OBJ_NAME (1 << 2) /* Name is valid. */
  649. #define DMUS_OBJ_CATEGORY (1 << 3) /* Category is valid. */
  650. #define DMUS_OBJ_FILENAME (1 << 4) /* File path is valid. */
  651. #define DMUS_OBJ_FULLPATH (1 << 5) /* Path is full path. */
  652. #define DMUS_OBJ_URL (1 << 6) /* Path is URL. */
  653. #define DMUS_OBJ_VERSION (1 << 7) /* Version is valid. */
  654. #define DMUS_OBJ_DATE (1 << 8) /* Date is valid. */
  655. #define DMUS_OBJ_LOADED (1 << 9) /* Object is currently loaded in memory. */
  656. #define DMUS_OBJ_MEMORY (1 << 10) /* Object is pointed to by pbMemData. */
  657. #define DMUS_OBJ_STREAM (1 << 11) /* Object is stored in pStream. */
  658. /* The DMUS_SCRIPT_ERRORINFO structure describes an error that occurred in a script.
  659. It is returned by methods in IDirectMusicScript. */
  660. typedef struct _DMUS_SCRIPT_ERRORINFO
  661. {
  662. DWORD dwSize; /* Size of this structure. */
  663. HRESULT hr;
  664. ULONG ulLineNumber;
  665. LONG ichCharPosition;
  666. WCHAR wszSourceFile[DMUS_MAX_FILENAME];
  667. WCHAR wszSourceComponent[DMUS_MAX_FILENAME];
  668. WCHAR wszDescription[DMUS_MAX_FILENAME];
  669. WCHAR wszSourceLineText[DMUS_MAX_FILENAME];
  670. } DMUS_SCRIPT_ERRORINFO;
  671. /* Track configuration flags, used with IDirectMusicSegment8::SetTrackConfig() */
  672. #define DMUS_TRACKCONFIG_OVERRIDE_ALL 1 /* This track should get parameters from this segment before controlling and primary tracks. */
  673. #define DMUS_TRACKCONFIG_OVERRIDE_PRIMARY 2 /* This track should get parameters from this segment before the primary segment tracks. */
  674. #define DMUS_TRACKCONFIG_FALLBACK 4 /* This track should get parameters from this segment if the primary and controlling segments don't succeed. */
  675. #define DMUS_TRACKCONFIG_CONTROL_ENABLED 8 /* GetParam() enabled for this track. */
  676. #define DMUS_TRACKCONFIG_PLAY_ENABLED 0x10 /* Play() enabled for this track. */
  677. #define DMUS_TRACKCONFIG_NOTIFICATION_ENABLED 0x20 /* Notifications enabled for this track. */
  678. #define DMUS_TRACKCONFIG_PLAY_CLOCKTIME 0x40 /* This track plays in clock time, not music time. */
  679. #define DMUS_TRACKCONFIG_PLAY_COMPOSE 0x80 /* This track should regenerate data each time it starts playing. */
  680. #define DMUS_TRACKCONFIG_LOOP_COMPOSE 0x100 /* This track should regenerate data each time it repeats. */
  681. #define DMUS_TRACKCONFIG_COMPOSING 0x200 /* This track is used to compose other tracks. */
  682. #define DMUS_TRACKCONFIG_CONTROL_PLAY 0x10000 /* This track, when played in a controlling segment, overrides playback of primary segment tracks. */
  683. #define DMUS_TRACKCONFIG_CONTROL_NOTIFICATION 0x20000 /* This track, when played in a controlling segment, overrides notification of primary segment tracks. */
  684. /* Additional track config flags for composing transitions */
  685. #define DMUS_TRACKCONFIG_TRANS1_FROMSEGSTART 0x400 /* Get track info from start of From segment */
  686. #define DMUS_TRACKCONFIG_TRANS1_FROMSEGCURRENT 0x800 /* Get track info from current place in From segment */
  687. #define DMUS_TRACKCONFIG_TRANS1_TOSEGSTART 0x1000 /* Get track info from start of To segment */
  688. #define DMUS_TRACKCONFIG_DEFAULT (DMUS_TRACKCONFIG_CONTROL_ENABLED | DMUS_TRACKCONFIG_PLAY_ENABLED | DMUS_TRACKCONFIG_NOTIFICATION_ENABLED)
  689. /* Get/SetParam structs for commands */
  690. /* PARAM structures, used by GetParam() and SetParam() */
  691. typedef struct _DMUS_COMMAND_PARAM
  692. {
  693. BYTE bCommand;
  694. BYTE bGrooveLevel;
  695. BYTE bGrooveRange;
  696. BYTE bRepeatMode;
  697. } DMUS_COMMAND_PARAM;
  698. typedef struct _DMUS_COMMAND_PARAM_2
  699. {
  700. MUSIC_TIME mtTime;
  701. BYTE bCommand;
  702. BYTE bGrooveLevel;
  703. BYTE bGrooveRange;
  704. BYTE bRepeatMode;
  705. } DMUS_COMMAND_PARAM_2;
  706. typedef IDirectMusicObject __RPC_FAR *LPDMUS_OBJECT;
  707. typedef IDirectMusicLoader __RPC_FAR *LPDMUS_LOADER;
  708. typedef IDirectMusicBand __RPC_FAR *LPDMUS_BAND;
  709. #define DMUSB_LOADED (1 << 0) /* Set when band has been loaded */
  710. #define DMUSB_DEFAULT (1 << 1) /* Set when band is default band for a style */
  711. /*////////////////////////////////////////////////////////////////////
  712. // IDirectMusicBand */
  713. #undef INTERFACE
  714. #define INTERFACE IDirectMusicBand
  715. DECLARE_INTERFACE_(IDirectMusicBand, IUnknown)
  716. {
  717. /* IUnknown */
  718. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  719. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  720. STDMETHOD_(ULONG,Release) (THIS) PURE;
  721. /* IDirectMusicBand */
  722. STDMETHOD(CreateSegment) (THIS_ IDirectMusicSegment** ppSegment) PURE;
  723. STDMETHOD(Download) (THIS_ IDirectMusicPerformance* pPerformance) PURE;
  724. STDMETHOD(Unload) (THIS_ IDirectMusicPerformance* pPerformance) PURE;
  725. };
  726. typedef IDirectMusicBand IDirectMusicBand8;
  727. /*////////////////////////////////////////////////////////////////////
  728. // IDirectMusicObject */
  729. #undef INTERFACE
  730. #define INTERFACE IDirectMusicObject
  731. DECLARE_INTERFACE_(IDirectMusicObject, IUnknown)
  732. {
  733. /* IUnknown */
  734. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  735. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  736. STDMETHOD_(ULONG,Release) (THIS) PURE;
  737. /* IDirectMusicObject */
  738. STDMETHOD(GetDescriptor) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE;
  739. STDMETHOD(SetDescriptor) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE;
  740. STDMETHOD(ParseDescriptor) (THIS_ LPSTREAM pStream,
  741. LPDMUS_OBJECTDESC pDesc) PURE;
  742. };
  743. typedef IDirectMusicObject IDirectMusicObject8;
  744. /*////////////////////////////////////////////////////////////////////
  745. // IDirectMusicLoader */
  746. #undef INTERFACE
  747. #define INTERFACE IDirectMusicLoader
  748. DECLARE_INTERFACE_(IDirectMusicLoader, IUnknown)
  749. {
  750. /* IUnknown */
  751. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  752. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  753. STDMETHOD_(ULONG,Release) (THIS) PURE;
  754. /* IDirectMusicLoader */
  755. STDMETHOD(GetObject) (THIS_ LPDMUS_OBJECTDESC pDesc,
  756. REFIID riid,
  757. LPVOID FAR *ppv) PURE;
  758. STDMETHOD(SetObject) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE;
  759. STDMETHOD(SetSearchDirectory) (THIS_ REFGUID rguidClass,
  760. WCHAR *pwzPath,
  761. BOOL fClear) PURE;
  762. STDMETHOD(ScanDirectory) (THIS_ REFGUID rguidClass,
  763. WCHAR *pwzFileExtension,
  764. WCHAR *pwzScanFileName) PURE;
  765. STDMETHOD(CacheObject) (THIS_ IDirectMusicObject * pObject) PURE;
  766. STDMETHOD(ReleaseObject) (THIS_ IDirectMusicObject * pObject) PURE;
  767. STDMETHOD(ClearCache) (THIS_ REFGUID rguidClass) PURE;
  768. STDMETHOD(EnableCache) (THIS_ REFGUID rguidClass,
  769. BOOL fEnable) PURE;
  770. STDMETHOD(EnumObject) (THIS_ REFGUID rguidClass,
  771. DWORD dwIndex,
  772. LPDMUS_OBJECTDESC pDesc) PURE;
  773. };
  774. /*////////////////////////////////////////////////////////////////////
  775. // IDirectMusicLoader8 */
  776. #undef INTERFACE
  777. #define INTERFACE IDirectMusicLoader8
  778. DECLARE_INTERFACE_(IDirectMusicLoader8, IDirectMusicLoader)
  779. {
  780. /* IUnknown */
  781. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  782. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  783. STDMETHOD_(ULONG,Release) (THIS) PURE;
  784. /* IDirectMusicLoader */
  785. STDMETHOD(GetObject) (THIS_ LPDMUS_OBJECTDESC pDesc,
  786. REFIID riid,
  787. LPVOID FAR *ppv) PURE;
  788. STDMETHOD(SetObject) (THIS_ LPDMUS_OBJECTDESC pDesc) PURE;
  789. STDMETHOD(SetSearchDirectory) (THIS_ REFGUID rguidClass,
  790. WCHAR *pwzPath,
  791. BOOL fClear) PURE;
  792. STDMETHOD(ScanDirectory) (THIS_ REFGUID rguidClass,
  793. WCHAR *pwzFileExtension,
  794. WCHAR *pwzScanFileName) PURE;
  795. STDMETHOD(CacheObject) (THIS_ IDirectMusicObject * pObject) PURE;
  796. STDMETHOD(ReleaseObject) (THIS_ IDirectMusicObject * pObject) PURE;
  797. STDMETHOD(ClearCache) (THIS_ REFGUID rguidClass) PURE;
  798. STDMETHOD(EnableCache) (THIS_ REFGUID rguidClass,
  799. BOOL fEnable) PURE;
  800. STDMETHOD(EnumObject) (THIS_ REFGUID rguidClass,
  801. DWORD dwIndex,
  802. LPDMUS_OBJECTDESC pDesc) PURE;
  803. /* IDirectMusicLoader8 */
  804. STDMETHOD_(void, CollectGarbage) (THIS) PURE;
  805. STDMETHOD(ReleaseObjectByUnknown) (THIS_ IUnknown *pObject) PURE;
  806. STDMETHOD(LoadObjectFromFile) (THIS_ REFGUID rguidClassID,
  807. REFIID iidInterfaceID,
  808. WCHAR *pwzFilePath,
  809. void ** ppObject) PURE;
  810. };
  811. /* Stream object supports IDirectMusicGetLoader interface to access loader while file parsing. */
  812. #undef INTERFACE
  813. #define INTERFACE IDirectMusicGetLoader
  814. DECLARE_INTERFACE_(IDirectMusicGetLoader, IUnknown)
  815. {
  816. /* IUnknown */
  817. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  818. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  819. STDMETHOD_(ULONG,Release) (THIS) PURE;
  820. /* IDirectMusicGetLoader */
  821. STDMETHOD(GetLoader) (THIS_ IDirectMusicLoader ** ppLoader) PURE;
  822. };
  823. typedef IDirectMusicGetLoader IDirectMusicGetLoader8;
  824. /*////////////////////////////////////////////////////////////////////
  825. // IDirectMusicSegment */
  826. #undef INTERFACE
  827. #define INTERFACE IDirectMusicSegment
  828. DECLARE_INTERFACE_(IDirectMusicSegment, IUnknown)
  829. {
  830. /* IUnknown */
  831. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  832. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  833. STDMETHOD_(ULONG,Release) (THIS) PURE;
  834. /* IDirectMusicSegment */
  835. STDMETHOD(GetLength) (THIS_ MUSIC_TIME* pmtLength) PURE;
  836. STDMETHOD(SetLength) (THIS_ MUSIC_TIME mtLength) PURE;
  837. STDMETHOD(GetRepeats) (THIS_ DWORD* pdwRepeats) PURE;
  838. STDMETHOD(SetRepeats) (THIS_ DWORD dwRepeats) PURE;
  839. STDMETHOD(GetDefaultResolution) (THIS_ DWORD* pdwResolution) PURE;
  840. STDMETHOD(SetDefaultResolution) (THIS_ DWORD dwResolution) PURE;
  841. STDMETHOD(GetTrack) (THIS_ REFGUID rguidType,
  842. DWORD dwGroupBits,
  843. DWORD dwIndex,
  844. IDirectMusicTrack** ppTrack) PURE;
  845. STDMETHOD(GetTrackGroup) (THIS_ IDirectMusicTrack* pTrack,
  846. DWORD* pdwGroupBits) PURE;
  847. STDMETHOD(InsertTrack) (THIS_ IDirectMusicTrack* pTrack,
  848. DWORD dwGroupBits) PURE;
  849. STDMETHOD(RemoveTrack) (THIS_ IDirectMusicTrack* pTrack) PURE;
  850. STDMETHOD(InitPlay) (THIS_ IDirectMusicSegmentState** ppSegState,
  851. IDirectMusicPerformance* pPerformance,
  852. DWORD dwFlags) PURE;
  853. STDMETHOD(GetGraph) (THIS_ IDirectMusicGraph** ppGraph) PURE;
  854. STDMETHOD(SetGraph) (THIS_ IDirectMusicGraph* pGraph) PURE;
  855. STDMETHOD(AddNotificationType) (THIS_ REFGUID rguidNotificationType) PURE;
  856. STDMETHOD(RemoveNotificationType) (THIS_ REFGUID rguidNotificationType) PURE;
  857. STDMETHOD(GetParam) (THIS_ REFGUID rguidType,

Large files files are truncated, but you can click here to view the full file