Source code of Windows XP (NT5)
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.

226 lines
9.4 KiB

  1. //
  2. // dmusicp.h
  3. //
  4. // Copyright (c) 2000 Microsoft Corporation. All rights reserved.
  5. //
  6. // Private interfaces
  7. #ifndef _DMUSICP_DOT_H_
  8. #define _DMUSICP_DOT_H_
  9. #include <dmusicf.h>
  10. // private guid for script track events
  11. DEFINE_GUID(IID_CScriptTrackEvent, 0x8f42c9da, 0xd37a, 0x499c, 0x85, 0x82, 0x1a, 0x80, 0xeb, 0xf9, 0xb2, 0x3c);
  12. // Stuff used in melody formulation that's currently either not implemented or hidden by Producer.
  13. /* Used to get a playmode to be used for a melody (pParam points to a single byte) */
  14. DEFINE_GUID(GUID_MelodyPlaymode, 0x288ea6ca, 0xaecc, 0x4327, 0x9f, 0x79, 0xfb, 0x46, 0x44, 0x37, 0x4a, 0x65);
  15. #define DMUS_FRAGMENTF_ANTICIPATE (0x1 << 3) /* Anticipate next chord */
  16. #define DMUS_FRAGMENTF_INVERT (0x1 << 4) /* Invert the fragment */
  17. #define DMUS_FRAGMENTF_REVERSE (0x1 << 5) /* Reverse the fragment */
  18. #define DMUS_FRAGMENTF_SCALE (0x1 << 6) /* Align MIDI values with scale intervals */
  19. #define DMUS_FRAGMENTF_CHORD (0x1 << 7) /* Align MIDI values with chord intervals */
  20. #define DMUS_FRAGMENTF_USE_PLAYMODE (0x1 << 8) /* Use playmode to compute MIDI values */
  21. #define DMUS_CONNECTIONF_GHOST 0x1 /* Use ghost notes for transitions */
  22. // flags used in ComposeSegmentFromTemplateEx
  23. typedef enum enumDMUS_COMPOSE_TEMPLATEF_FLAGS
  24. {
  25. DMUS_COMPOSE_TEMPLATEF_ACTIVITY = 0x1, // Use activity level (dx7 default)
  26. DMUS_COMPOSE_TEMPLATEF_CLONE = 0x2 // Clone a segment from the template (dx7 default)
  27. } DMUS_COMPOSE_TEMPLATEF_FLAGS;
  28. // Interfaces/methods removed from Direct Music Performance layer:
  29. // IDirectMusicSegment8P
  30. interface IDirectMusicSegment8P : IUnknown
  31. {
  32. // IUnknown
  33. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *)=0;
  34. virtual ULONG STDMETHODCALLTYPE AddRef()=0;
  35. virtual ULONG STDMETHODCALLTYPE Release()=0;
  36. // IDirectMusicSegment8P
  37. virtual HRESULT STDMETHODCALLTYPE GetObjectInPath(
  38. DWORD dwPChannel, /* PChannel to search. */
  39. DWORD dwStage, /* Which stage in the path. */
  40. DWORD dwBuffer, /* Which buffer to address, if more than one. */
  41. REFGUID guidObject, /* ClassID of object. */
  42. DWORD dwIndex, /* Which object of that class. */
  43. REFGUID iidInterface,/* Requested COM interface. */
  44. void ** ppObject)=0; /* Pointer to interface. */
  45. virtual HRESULT STDMETHODCALLTYPE GetHeaderChunk(
  46. DWORD *pdwSize, /* Size of passed header chunk. Also, returns size written. */
  47. DMUS_IO_SEGMENT_HEADER *pHeader)=0; /* Header chunk to fill. */
  48. virtual HRESULT STDMETHODCALLTYPE SetHeaderChunk(
  49. DWORD dwSize, /* Size of passed header chunk. */
  50. DMUS_IO_SEGMENT_HEADER *pHeader)=0; /* Header chunk to fill. */
  51. virtual HRESULT STDMETHODCALLTYPE SetTrackPriority(
  52. REFGUID rguidTrackClassID, /* ClassID of Track. */
  53. DWORD dwGroupBits, /* Group bits. */
  54. DWORD dwIndex, /* Nth track. */
  55. DWORD dwPriority) = 0; /* Priority to set. */
  56. virtual HRESULT STDMETHODCALLTYPE SetAudioPathConfig(
  57. IUnknown *pAudioPathConfig) = 0; /* Audio path config, from file. */
  58. };
  59. // IDirectMusicComposer8P
  60. interface IDirectMusicComposer8P : IUnknown
  61. {
  62. // IUnknown
  63. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *)=0;
  64. virtual ULONG STDMETHODCALLTYPE AddRef()=0;
  65. virtual ULONG STDMETHODCALLTYPE Release()=0;
  66. // IDirectMusicComposer8P
  67. // Use style to get embellishment lengths
  68. virtual HRESULT STDMETHODCALLTYPE ComposeTemplateFromShapeEx(
  69. WORD wNumMeasures,
  70. WORD wShape,
  71. BOOL fIntro,
  72. BOOL fEnd,
  73. IDirectMusicStyle* pStyle,
  74. IDirectMusicSegment** ppTemplate)=0;
  75. // New flags DWORD (discard activity level; compose in place)
  76. virtual HRESULT STDMETHODCALLTYPE ComposeSegmentFromTemplateEx(
  77. IDirectMusicStyle* pStyle,
  78. IDirectMusicSegment* pTemplate,
  79. DWORD dwFlags,
  80. DWORD dwActivity,
  81. IDirectMusicChordMap* pChordMap,
  82. IDirectMusicSegment** ppSegment)=0;
  83. };
  84. // IDirectMusicStyle8P
  85. interface IDirectMusicStyle8P : IUnknown
  86. {
  87. // IUnknown
  88. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *)=0;
  89. virtual ULONG STDMETHODCALLTYPE AddRef()=0;
  90. virtual ULONG STDMETHODCALLTYPE Release()=0;
  91. // IDirectMusicStyle8P
  92. virtual HRESULT STDMETHODCALLTYPE ComposeMelodyFromTemplate(
  93. IDirectMusicStyle* pStyle,
  94. IDirectMusicSegment* pTemplate,
  95. IDirectMusicSegment** ppSegment)=0;
  96. };
  97. // IDirectMusicLoader8P
  98. interface IDirectMusicLoader8P : IUnknown
  99. {
  100. // IUnknown
  101. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *)=0;
  102. virtual ULONG STDMETHODCALLTYPE AddRef()=0;
  103. virtual ULONG STDMETHODCALLTYPE Release()=0;
  104. // IDirectMusicLoader8P
  105. virtual HRESULT STDMETHODCALLTYPE GetDynamicallyReferencedObject(
  106. IDirectMusicObject *pSourceObject,
  107. LPDMUS_OBJECTDESC pDesc,
  108. REFIID riid,
  109. LPVOID FAR *ppv)=0;
  110. virtual HRESULT STDMETHODCALLTYPE ReportDynamicallyReferencedObject(
  111. IDirectMusicObject *pSourceObject,
  112. IUnknown *pReferencedObject)=0;
  113. // These should probably never be exposed publicly.
  114. // Scripts hold a reference to the loader because they need to be able to inform it
  115. // when they set variables to reference DirectMusic objects the loader tracks for
  116. // garbage collection. However, that would create a circular reference because the
  117. // loader also holds a reference to scripts in its cache. Garbage collection can't break
  118. // a circular reference that the loader itself is involved in. Instead we use these private
  119. // ref count methods. When the app is no longer using the loader (public Release drops
  120. // to zero) then the loader can clear its cache. This releases references to scripts
  121. // (and also to streams, which use the same technique), triggering them to do ReleaseP
  122. // and everything gets cleaned up.
  123. virtual ULONG STDMETHODCALLTYPE AddRefP() = 0; // Private AddRef, for scripts.
  124. virtual ULONG STDMETHODCALLTYPE ReleaseP() = 0; // Private Release, for scripts.
  125. };
  126. // IDirectMusicBandP
  127. interface IDirectMusicBandP : IUnknown
  128. {
  129. // IUnknown
  130. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *)=0;
  131. virtual ULONG STDMETHODCALLTYPE AddRef()=0;
  132. virtual ULONG STDMETHODCALLTYPE Release()=0;
  133. // IDirectMusicBandP
  134. virtual HRESULT STDMETHODCALLTYPE DownloadEx(IUnknown *pAudioPath)=0;
  135. virtual HRESULT STDMETHODCALLTYPE UnloadEx(IUnknown *pAudioPath)=0;
  136. };
  137. // IDirectMusicObjectP
  138. interface IDirectMusicObjectP : IUnknown
  139. {
  140. // IUnknown
  141. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *)=0;
  142. virtual ULONG STDMETHODCALLTYPE AddRef()=0;
  143. virtual ULONG STDMETHODCALLTYPE Release()=0;
  144. // IDirectMusicObjectP
  145. virtual void STDMETHODCALLTYPE Zombie()=0;
  146. };
  147. // IDirectMusicPerformanceP
  148. interface IDirectMusicPerformanceP : IUnknown
  149. {
  150. // IUnknown
  151. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *)=0;
  152. virtual ULONG STDMETHODCALLTYPE AddRef()=0;
  153. virtual ULONG STDMETHODCALLTYPE Release()=0;
  154. // IDirectMusicPerformanceP
  155. virtual HRESULT STDMETHODCALLTYPE GetPortAndFlags(DWORD dwPChannel,IDirectMusicPort **ppPort,DWORD * pdwFlags) = 0;
  156. };
  157. #define DM_PORTFLAGS_GM 1 /* Synth has GM set locally. */
  158. #define DM_PORTFLAGS_GS 2 /* Synth has GS set locally. */
  159. #define DM_PORTFLAGS_XG 4 /* Synth has XG set locally. */
  160. // Private path stage to access the sink.
  161. #define DMUS_PATH_SINK 0x5000 /* Access the DSound Sink interface. */
  162. // GUIDs for new performance layer private interfaces
  163. DEFINE_GUID(IID_IDirectMusicSegment8P, 0x4bd7fb35, 0x8253, 0x48e0, 0x90, 0x64, 0x8a, 0x20, 0x89, 0x82, 0x37, 0xcb);
  164. DEFINE_GUID(IID_IDirectMusicComposer8P, 0xabaf70dc, 0xdfba, 0x4adf, 0xbf, 0xa9, 0x7b, 0x0, 0xe4, 0x19, 0xeb, 0xbb);
  165. DEFINE_GUID(IID_IDirectMusicStyle8P, 0x2b7c5f39, 0x990a, 0x4fd7, 0x9b, 0x70, 0x1e, 0xa3, 0xde, 0x31, 0x55, 0xa5);
  166. DEFINE_GUID(IID_IDirectMusicLoader8P, 0x3939facd, 0xf6ed, 0x4619, 0xbd, 0x16, 0x56, 0x60, 0x3f, 0x1, 0x51, 0xca);
  167. DEFINE_GUID(IID_IDirectMusicBandP, 0xf2e00137, 0xa131, 0x4289, 0xaa, 0x6c, 0xa9, 0x60, 0x7d, 0x4, 0x85, 0xf5);
  168. DEFINE_GUID(IID_IDirectMusicObjectP, 0x6a20c217, 0xeb3e, 0x40ec, 0x9f, 0x3a, 0x92, 0x5, 0x8, 0x70, 0x2b, 0x5e);
  169. DEFINE_GUID(IID_IDirectMusicPerformanceP, 0xe583be58, 0xe93f, 0x4316, 0xbb, 0x6b, 0xcb, 0x2c, 0x71, 0x96, 0x40, 0x44);
  170. /* DMUS_PMSGT_PRIVATE_TYPES fill the DMUS_PMSG's dwType member */
  171. /* These start at 15000 in order to avoid conflicting with public DMUS_PMSGT_TYPES. */
  172. typedef enum enumDMUS_PMSGT_PRIVATE_TYPES
  173. {
  174. DMUS_PMSGT_SCRIPTTRACKERROR = 15000, /* Sent by the script track when an error occurs in the script. */
  175. } DMUS_PMSGT_PRIVATE_TYPES;
  176. /* DMUS_SCRIPT_TRACK_ERROR_PMSG */
  177. /* These PMsgs are sent by the script track if there is a syntax error in a script it tries to connect to or
  178. if a routine it calls fails. */
  179. typedef struct _DMUS_SCRIPT_TRACK_ERROR_PMSG
  180. {
  181. /* begin DMUS_PMSG_PART */
  182. DMUS_PMSG_PART
  183. /* end DMUS_PMSG_PART */
  184. DMUS_SCRIPT_ERRORINFO ErrorInfo; /* The error that occured. Same as structure returned by IDirectMusicScript's Init and CallRoutine members. */
  185. } DMUS_SCRIPT_TRACK_ERROR_PMSG;
  186. /* Track param type guids */
  187. /* Use (call SetParam on the script track) to turn on PMsgs (DMUS_SCRIPT_TRACK_ERROR_PMSG) the script track sends if there
  188. is a syntax error in the script it tries to connect to or if one of the routines it calls fails. */
  189. DEFINE_GUID(GUID_EnableScriptTrackError,0x1cc7e0bf, 0x981c, 0x4b9f, 0xbe, 0x17, 0xd5, 0x72, 0xfc, 0x5f, 0xa9, 0x33); // {1CC7E0BF-981C-4b9f-BE17-D572FC5FA933}
  190. #endif // _DMUSICP_DOT_H_