Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

240 lines
11 KiB

  1. // autodoc's for stuff that's in the public header files
  2. // @doc EXTERNAL
  3. /*
  4. @struct DMUS_PMSG | DMUS_PMSG structure. This is the base message for all
  5. messages queued to the Performance. DMUS_PMSG's are created by calling
  6. <om IDirectMusicPerformance.AllocPMsg>.
  7. */
  8. typedef struct DMUS_PMSG
  9. {
  10. void* pvReserved; // @field Reserved for use by the Performance. Do not modify.
  11. DWORD dwSize; // @field Stores the full size of the message. Do not modify.
  12. REFERENCE_TIME rtTime; // @field The message time, in <t REFERENCE_TIME> format.
  13. // This field is considered valid only if the dwFlags
  14. // field has DMUS_PMSGF_REFTIME set.
  15. MUSIC_TIME mtTime; // @field The message time, in <t MUSIC_TIME> format.
  16. // This field is considered valid only if the dwFlags
  17. // field has DMUS_PMSGF_MUSICTIME set.
  18. DWORD dwFlags; // @field Various bits. See <t DMUS_PMSGF_FLAGS>.
  19. DWORD dwPChannel; // @field Performance Channel. The Performance can
  20. // use this to determine the port/channel.
  21. DWORD dwVirtualTrackID; // @field Virtual track ID. This identifies the exact
  22. // <i IDirectMusicTrack> that created this message. May
  23. // be 0 if this message was not created by a Track.
  24. IDirectMusicTool* pTool; // @field <i IDirectMusicTool> pointer. This is normally set
  25. // by calling <om IDirectMusicGraph.StampPMsg>.
  26. IDirectMusicGraph* pGraph; // @field <i IDirectMusicGraph> pointer. This is normally
  27. // set by calling <om IDirectMusicGraph.StampPMsg>.
  28. DWORD dwType; // @field message type. See <t DMUS_PMSGT_TYPES>.
  29. IUnknown* punkUser; // @field User com pointer, auto released upon a call
  30. // to <om IDirectMusicPerformance.FreePMsg>.
  31. } DMUS_PMSG;
  32. /*
  33. @enum DMUS_PMSGF_FLAGS | <t DMUS_PMSGF_FLAGS> are used inside the dwFlags
  34. member of the <t DMUS_PMSG>.
  35. */
  36. typedef enum enumDMUS_PMSGF_FLAGS
  37. {
  38. DMUS_PMSGF_REFTIME = 1, // @emem Set if rtTime is valid.
  39. DMUS_PMSGF_MUSICTIME = 2, // @emem Set if mtTime is valid.
  40. DMUS_PMSGF_TOOL_IMMEDIATE = 4, // @emem Set if the message should execute right away, regardless of its time-stamp. See
  41. // <om IDirectMusicPerformance.SendPMsg>.
  42. DMUS_PMSGF_TOOL_QUEUE = 8, // @emem Set if the message should execute just prior to its time-stamp. See
  43. // <om IDirectMusicPerformance.SendPMsg>.
  44. DMUS_PMSGF_TOOL_ATTIME = 16 // @emem Set if message should execute exactly at its time-stamp. See
  45. // <om IDirectMusicPerformance.SendPMsg>.
  46. DMUS_PMSGF_TOOL_FLUSH = 32 // @emem Set if the message is being flushed.
  47. } DMUS_PMSGF_FLAGS;
  48. // DMUS_PMSGT_TYPES defines
  49. // @enum DMUS_PMSGT_TYPES | <t DMUS_PMSGT_TYPES> are used inside the dwType
  50. // member of the <t DMUS_PMSG>, and identify the type of message.
  51. typedef enum enumDMUS_PMSGT_TYPES
  52. {
  53. DMUS_PMSGT_MIDI = 0, // @emem MIDI short message
  54. DMUS_PMSGT_NOTE = 1, // @emem Interactive Music Note
  55. DMUS_PMSGT_SYSEX = 2, // @emem MIDI long message (system exclusive message)
  56. DMUS_PMSGT_NOTIFICATION = 3, // @emem Notification message
  57. DMUS_PMSGT_TEMPO = 4, // @emem Tempo message
  58. DMUS_PMSGT_CURVE = 5, // @emem Control change / pitch bend, etc. curve
  59. DMUS_PMSGT_TIMESIG = 6, // @emem Time signature
  60. DMUS_PMSGT_PATCH = 7, // @emem Patch changes
  61. DMUS_PMSGT_USER = 255 // @emem User message
  62. } DMUS_PMSGT_TYPES;
  63. /* The following flags are sent in the IDirectMusicTrack::Play() method */
  64. /* inside the dwFlags parameter */
  65. typedef enum enumDMUS_TRACKF_FLAGS
  66. {
  67. DMUS_TRACKF_SEEK = 1, /* set on a seek */
  68. DMUS_TRACKF_LOOP = 2, /* set on a loop (repeat) */
  69. DMUS_TRACKF_START = 4, /* set on first call to Play */
  70. DMUS_TRACKF_FLUSH = 8 /* set when this call is in response to a flush on the perfomance */
  71. } DMUS_TRACKF_FLAGS;
  72. /*
  73. @struct DMUS_NOTE_PMSG | Based off of <t DMUS_PMSG>, the <t DMUS_NOTE_PMSG>
  74. represents an interactive music note.
  75. */
  76. typedef struct DMUS_NOTE_PMSG : DMUS_PMSG
  77. {
  78. MUSIC_TIME mtDuration; // @field Duration
  79. WORD wMusicValue; // @field Description of note in chord and key.
  80. WORD wMeasure; // @field Measure in which this note occurs
  81. short nOffset; // @field Offset from grid at which this note occurs
  82. BYTE bBeat; // @field Beat (in measure) at which this note occurs
  83. BYTE bGrid; // @field Grid offset from beat at which this note occurs
  84. BYTE bVelocity; // @field Note velocity
  85. BYTE bFlags; // @field See <t DMNoteEventFlags>
  86. BYTE bTimeRange; // @field Range to randomize time.
  87. BYTE bDurRange; // @field Range to randomize duration.
  88. BYTE bVelRange; // @field Range to randomize velocity.
  89. BYTE bInversionID; // @field Identifies inversion group to which this note belongs
  90. BYTE bPlayModeFlags; // @field Play mode.
  91. BYTE bMidiValue; // @field The MIDI note value, converted from wMusicValue.
  92. } DMUS_NOTE_PMSG;
  93. /*
  94. @enum DMUS_NOTEF_FLAGS | Used in the bFlags field of <t DMUS_NOTE_PMSG>.
  95. Currently there is only one flag, DMUS_NOTEF_NOTEON. If it is set, the <t DMUS_NOTE_PMSG>
  96. represents a MIDI Note On. If it is not set, it represents a MIDI Note Off. When
  97. a <t DMUS_NOTE_PMSG> is first queued via <om IDirectMusicPerformance.SendPMsg>,
  98. this flag should be set. The <t DMUS_NOTE_PMSG> will flow through the <i IDirectMusicGraph>
  99. and any <i IDirectMusicTool>'s in the graph, until it reaches the final MIDI Output Tool.
  100. The final MIDI Output Tool looks at the <t DMUS_NOTE_PMSG>'s bFlags field. When it sees
  101. that DMUS_NOTEF_NOTEON is set, it sends a MIDI Note On message to the correct Port (according to
  102. the <t DMUS_NOTE_PMSG>'s <t DMUS_PMSG>'s dwPChannel. It then clears the DMUS_NOTEF_NOTEON
  103. flag, adds mtDuration to the mtTime, and requeues the message.
  104. */
  105. typedef enum enumDMUS_NOTEF_FLAGS
  106. {
  107. DMUS_NOTEF_NOTEON = 1, // @emem Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off.
  108. } DMUS_NOTEF_FLAGS;
  109. /*
  110. @struct DMUS_MIDI_PMSG | Based off of <t DMUS_PMSG>, <t DMUS_MIDI_PMSG> performs a standard MIDI message.
  111. */
  112. typedef struct DMUS_MIDI_PMSG : DMUS_PMSG
  113. {
  114. BYTE bStatus; // @field Standard MIDI status byte.
  115. BYTE bByte1; // @field Standard MIDI message first byte field. Ignored for MIDI
  116. // messages that don't require it.
  117. BYTE bByte2; // @field Standard MIDI message second byte field. Ignored for MIDI
  118. // messages that don't require it.
  119. BYTE bPad[1];
  120. } DMUS_MIDI_PMSG;
  121. /* DMUS_PATCH_PMSG */
  122. typedef struct DMUS_PATCH_PMSG
  123. {
  124. /* begin DMUS_PMSG_PART */
  125. DMUS_PMSG_PART
  126. /* end DMUS_PMSG_PART */
  127. BYTE byInstrument;
  128. BYTE byMSB;
  129. BYTE byLSB;
  130. BYTE byPad[1];
  131. DWORD dwGroup;
  132. DWORD dwMChannel;
  133. } DMUS_PATCH_PMSG;
  134. // DMUS_TEMPO_PMSG
  135. /*
  136. @struct DMUS_TEMPO_PMSG | Based off of <t DMUS_PMSG>, <t DMUS_TEMPO_PMSG> controls the performance's tempo.
  137. */
  138. typedef struct DMUS_TEMPO_PMSG : DMUS_PMSG
  139. {
  140. double dblTempo; // @field The tempo.
  141. } DMUS_TEMPO_PMSG;
  142. #define TEMPO_MAX 350
  143. #define TEMPO_MIN 10
  144. #define RELTEMPO_MAX 200
  145. #define RELTEMPO_MIN 0
  146. // DMUS_SYSEX_PMSG
  147. /*
  148. @struct DMUS_SYSEX_PMSG | Based off of <t DMUS_PMSG>, <t DMUS_SYSEX_PMSG> represents a System Exclusive message.
  149. */
  150. typedef struct DMUS_SYSEX_PMSG : DMUS_PMSG
  151. {
  152. DWORD dwLen; // @field Length of the data.
  153. BYTE* abData; // @field Array of data, with length equal to dwLen.
  154. } DMUS_SYSEX_PMSG;
  155. // DMUS_CURVE_PMSG
  156. /*
  157. @struct DMUS_CURVE_PMSG | Based off of <t DMUS_PMSG>, <t DMUS_CURVE_PMSG> represents a curve (e.g., a sequence of
  158. Continuous Controller messages.
  159. */
  160. typedef struct DMUS_CURVE_PMSG : DMUS_PMSG
  161. {
  162. MUSIC_TIME mtDuration; // @field How long this curve lasts.
  163. MUSIC_TIME mtOriginalStart; // @field Must be set to either zero when this message
  164. // is created or to the original mtTime of the curve.
  165. short nStartValue; // @field The curve's start value.
  166. short nEndValue; // @field The curve's end value.
  167. short nResetValue; // @field The curve's reset value, sent after mtResetDuration or
  168. // upon a flush or invalidation.
  169. WORD wMeasure; // @field Measure in which this curve occurs.
  170. short nOffset; // @field Offset from grid at which this curve occurs.
  171. BYTE bBeat; // @field Beat (in measure) at which this curve occurs.
  172. BYTE bGrid; // @field Grid offset from beat at which this curve occurs.
  173. BYTE bType; // @field Type of curve.
  174. BYTE bCurveShape; // @field Shape of curve.
  175. BYTE bCCData; // @field CC# if this is a control change type.
  176. BYTE bFlags; // @field Set to 1 if the nResetValue must be sent when the
  177. // time is reached or an invalidate occurs because
  178. // of a transition. If 0, the curve stays
  179. // permanently stuck at the new value. All other bits in this field are reserved.
  180. } DMUS_CURVE_PMSG;
  181. // DMUS_TIMESIG_PMSG
  182. /*
  183. @struct DMUS_TIMESIG_PMSG | Based off of <t DMUS_PMSG>, <t DMUS_TIMESIG_PMSG> represents a time signature.
  184. */
  185. typedef struct DMUS_TIMESIG_PMSG : DMUS_PMSG
  186. {
  187. // Time signatures define how many beats per measure, which note receives
  188. // the beat, and the grid resolution.
  189. BYTE bBeatsPerMeasure; // @field Beats per measure (top of the time signature).
  190. BYTE bBeat; // @field What note receives the beat (bottom of time
  191. // signature).
  192. // We can assume that 0 means 256th note.
  193. WORD wGridsPerBeat; // @field Grids per beat.
  194. } DMUS_TIMESIG_PMSG;
  195. // DMUS_NOTIFICATION_PMSG
  196. /*
  197. @struct DMUS_NOTIFICATION_PMSG | Based off of <t DMUS_PMSG>, <t DMUS_NOTIFICATION_PMSG> represents a notification.
  198. */
  199. typedef struct DMUS_NOTIFICATION_PMSG : DMUS_PMSG
  200. {
  201. DWORD dwNotifyType; // @field Type of notification.
  202. DWORD dwField1; // @field Extra data specific to the type of notification.
  203. DWORD dwField2; // @field Extra data specific to the type of notification.
  204. } DMUS_NOTIFICATION_PMSG;
  205. /*
  206. GUID_Global_Data | Global Data Guids
  207. GUID_PerfRelTempo | Get/Set relative tempo on the <i IDirectMusicPerformance>.
  208. Relative tempo spans all segments. Valid values range from 0 to 200, with 0 meaning
  209. half-tempo, 100 meaning normal tempo, and 200 meaning double-tempo. The data type
  210. associated with the global value is a DWORD.
  211. GUID_PerfRelVolume | Get/Set relative volume on the <i IDirectMusicPerformance>.
  212. Relative volume spans all segments.
  213. <om IDirectMusicPerformance.GetGlobal>, <om IDirectMusicPerformance.SetGlobal>
  214. */
  215. GUID_EnableTempo
  216. GUID_DisableTempo
  217. Send these GUID's to SetParam() and IsParamSupported() to disable sending and supporting
  218. Tempo. Note that if a Track has received
  219. GUID_DisableTempo, it will no longer return S_OK for GUID_DisableTempo or GUID_TempoTrack
  220. from IsParamSupported(), but will return S_OK for GUID_EnableTempo. After reenabling, it
  221. will return to its original state of supporting Tempos.
  222. DMUS_E_TYPE_DISABLED will be returned from GetParam() and SetParam()
  223. if the type is currently disabled.