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.

327 lines
11 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: dmperformanceobj.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // d3drmLightObj.h : Declaration of the C_dxj_DirectMusicPerformanceObject
  11. #include "dmusici.h"
  12. #include "dmusicc.h"
  13. #include "dmusicf.h"
  14. #include "resource.h" // main symbols
  15. #define typedef__dxj_DirectMusicPerformance IDirectMusicPerformance8*
  16. /////////////////////////////////////////////////////////////////////////////
  17. // Direct
  18. //REVIEW -- using pointers to ID's is necessary because some compilers don't like
  19. //references as template arguments.
  20. class C_dxj_DirectMusicPerformanceObject :
  21. public I_dxj_DirectMusicPerformance,
  22. //public CComCoClass<C_dxj_DirectMusicPerformanceObject, &CLSID__dxj_DirectMusicPerformance>,
  23. public CComObjectRoot
  24. {
  25. public:
  26. C_dxj_DirectMusicPerformanceObject();
  27. virtual ~C_dxj_DirectMusicPerformanceObject();
  28. BEGIN_COM_MAP(C_dxj_DirectMusicPerformanceObject)
  29. COM_INTERFACE_ENTRY(I_dxj_DirectMusicPerformance)
  30. END_COM_MAP()
  31. //DECLARE_REGISTRY(CLSID__dxj_DirectMusicPerformance, "DIRECT.DirectMusicPerformance.1", "DIRECT.Direct3dRMLight.3", IDS_D3DRMLIGHT_DESC, THREADFLAGS_BOTH)
  32. DECLARE_AGGREGATABLE(C_dxj_DirectMusicPerformanceObject)
  33. public:
  34. STDMETHOD(InternalSetObject)(IUnknown *lpdd);
  35. STDMETHOD(InternalGetObject)(IUnknown **lpdd);
  36. #if 0
  37. HRESULT STDMETHODCALLTYPE init(
  38. /* [in] */ I_dxj_DirectSound __RPC_FAR *DirectSound,
  39. /* [in] */ long hWnd,
  40. I_dxj_DirectMusic **ret);
  41. #endif
  42. HRESULT STDMETHODCALLTYPE closeDown( void);
  43. HRESULT STDMETHODCALLTYPE playSegment(
  44. /* [in] */ I_dxj_DirectMusicSegment __RPC_FAR *segment,
  45. /* [in] */ long lFlags,
  46. /* [in] */ long startTime,
  47. /* [retval][out] */ I_dxj_DirectMusicSegmentState __RPC_FAR *__RPC_FAR *segmentState);
  48. HRESULT STDMETHODCALLTYPE stop(
  49. /* [in] */ I_dxj_DirectMusicSegment __RPC_FAR *segment,
  50. /* [in] */ I_dxj_DirectMusicSegmentState __RPC_FAR *segmentState,
  51. /* [in] */ long mtTime,
  52. /* [in] */ long lFlags);
  53. HRESULT STDMETHODCALLTYPE getSegmentState(
  54. /* [in] */ long mtTime,
  55. /* [retval][out] */ I_dxj_DirectMusicSegmentState __RPC_FAR *__RPC_FAR *ret);
  56. HRESULT STDMETHODCALLTYPE invalidate(
  57. /* [in] */ long mtTime,
  58. /* [in] */ long flags);
  59. HRESULT STDMETHODCALLTYPE isPlaying(
  60. /* [in] */ I_dxj_DirectMusicSegment __RPC_FAR *segment,
  61. /* [in] */ I_dxj_DirectMusicSegmentState __RPC_FAR *segmentState,
  62. /* [retval][out] */ VARIANT_BOOL __RPC_FAR *b);
  63. HRESULT STDMETHODCALLTYPE addNotificationType(
  64. /* [in] */ CONST_DMUS_NOTIFICATION_TYPE type);
  65. HRESULT STDMETHODCALLTYPE removeNotificationType(
  66. /* [in] */ CONST_DMUS_NOTIFICATION_TYPE type);
  67. #ifdef _WIN64
  68. HRESULT STDMETHODCALLTYPE setNotificationHandle(
  69. /* [in] */ HWND hnd);
  70. #else
  71. HRESULT STDMETHODCALLTYPE setNotificationHandle(
  72. /* [in] */ long hnd);
  73. #endif
  74. HRESULT STDMETHODCALLTYPE getNotificationPMSG(
  75. /* [out][in] */ DMUS_NOTIFICATION_PMSG_CDESC __RPC_FAR *message, VARIANT_BOOL *b);
  76. HRESULT STDMETHODCALLTYPE musicToClockTime(
  77. /* [in] */ long mtTime,
  78. /* [retval][out] */ long __RPC_FAR *rtTime);
  79. HRESULT STDMETHODCALLTYPE clockToMusicTime(
  80. /* [in] */ long rtTime,
  81. /* [retval][out] */ long __RPC_FAR *mtTime);
  82. HRESULT STDMETHODCALLTYPE getMusicTime(
  83. /* [retval][out] */ long __RPC_FAR *ret);
  84. HRESULT STDMETHODCALLTYPE getClockTime(
  85. /* [retval][out] */ long __RPC_FAR *ret);
  86. HRESULT STDMETHODCALLTYPE getPrepareTime(
  87. /* [retval][out] */ long __RPC_FAR *lMilliSeconds);
  88. HRESULT STDMETHODCALLTYPE getBumperLength(
  89. /* [retval][out] */ long __RPC_FAR *lMilliSeconds);
  90. HRESULT STDMETHODCALLTYPE getLatencyTime(
  91. /* [retval][out] */ long __RPC_FAR *rtTime0);
  92. HRESULT STDMETHODCALLTYPE getQueueTime(
  93. /* [retval][out] */ long __RPC_FAR *rtTime);
  94. HRESULT STDMETHODCALLTYPE getResolvedTime(
  95. /* [in] */ long rtTime,
  96. /* [in] */ long flags,
  97. /* [retval][out] */ long __RPC_FAR *ret);
  98. HRESULT STDMETHODCALLTYPE setPrepareTime(
  99. /* [in] */ long lMilliSeconds);
  100. HRESULT STDMETHODCALLTYPE setBumperLength(
  101. /* [in] */ long lMilliSeconds);
  102. HRESULT STDMETHODCALLTYPE adjustTime(
  103. /* [in] */ long rtAmount);
  104. HRESULT STDMETHODCALLTYPE setMasterAutoDownload(
  105. /* [in] */ VARIANT_BOOL b);
  106. HRESULT STDMETHODCALLTYPE getMasterAutoDownload(
  107. /* [retval][out] */ VARIANT_BOOL __RPC_FAR *b);
  108. HRESULT STDMETHODCALLTYPE setMasterTempo(
  109. /* [in] */ float tempo);
  110. HRESULT STDMETHODCALLTYPE getMasterTempo(
  111. /* [retval][out] */ float __RPC_FAR *tempo);
  112. HRESULT STDMETHODCALLTYPE setMasterVolume(
  113. /* [in] */ long vol);
  114. HRESULT STDMETHODCALLTYPE getMasterVolume(
  115. /* [retval][out] */ long __RPC_FAR *v);
  116. HRESULT STDMETHODCALLTYPE setMasterGrooveLevel(
  117. /* [in] */ short level);
  118. HRESULT STDMETHODCALLTYPE getMasterGrooveLevel(
  119. /* [retval][out] */ __RPC_FAR short *level);
  120. HRESULT STDMETHODCALLTYPE Reset(long flags);
  121. HRESULT STDMETHODCALLTYPE getStyle(
  122. /* [in] */ long mtTime,
  123. /* [out][in] */ long __RPC_FAR *mtUntil,
  124. /* [retval][out] */ I_dxj_DirectMusicStyle __RPC_FAR *__RPC_FAR *ret);
  125. HRESULT STDMETHODCALLTYPE getChordMap(
  126. /* [in] */ long mtTime,
  127. /* [out][in] */ long __RPC_FAR *mtUntil,
  128. /* [retval][out] */ I_dxj_DirectMusicChordMap __RPC_FAR *__RPC_FAR *ret);
  129. HRESULT STDMETHODCALLTYPE getCommand(
  130. /* [in] */ long mtTime,
  131. /* [out][in] */ long __RPC_FAR *mtUntil,
  132. /* [retval][out] */ Byte __RPC_FAR *command);
  133. HRESULT STDMETHODCALLTYPE getGrooveLevel(
  134. /* [in] */ long mtTime,
  135. /* [out][in] */ long __RPC_FAR *mtUntil,
  136. /* [retval][out] */ Byte __RPC_FAR *level);
  137. HRESULT STDMETHODCALLTYPE getTempo(
  138. /* [in] */ long mtTime,
  139. /* [out][in] */ long __RPC_FAR *mtUntil,
  140. /* [retval][out] */ double __RPC_FAR *tempo);
  141. HRESULT STDMETHODCALLTYPE getTimeSig(
  142. /* [in] */ long mtTime,
  143. /* [out][in] */ long __RPC_FAR *mtUntil,
  144. /* [out][in] */ DMUS_TIMESIGNATURE_CDESC __RPC_FAR *timeSig);
  145. HRESULT STDMETHODCALLTYPE sendNotePMSG(
  146. /* [in] */ long mtTime,
  147. /* [in] */ long flags,
  148. /* [in] */ long channel,
  149. /* [in] */ DMUS_NOTE_PMSG_CDESC __RPC_FAR *msg);
  150. HRESULT STDMETHODCALLTYPE sendCurvePMSG(
  151. /* [in] */ long mtTime,
  152. /* [in] */ long flags,
  153. /* [in] */ long channel,
  154. /* [in] */ DMUS_CURVE_PMSG_CDESC __RPC_FAR *msg);
  155. HRESULT STDMETHODCALLTYPE sendMIDIPMSG(
  156. /* [in] */ long mtTime,
  157. /* [in] */ long flags,
  158. /* [in] */ long channel,
  159. /* [in] */ Byte status,
  160. /* [in] */ Byte byte1,
  161. /* [in] */ Byte byte2);
  162. HRESULT STDMETHODCALLTYPE sendPatchPMSG(
  163. /* [in] */ long mtTime,
  164. /* [in] */ long flags,
  165. /* [in] */ long channel,
  166. /* [in] */ Byte instrument,
  167. /* [in] */ Byte byte1,
  168. /* [in] */ Byte byte2);
  169. HRESULT STDMETHODCALLTYPE sendTempoPMSG(
  170. /* [in] */ long mtTime,
  171. /* [in] */ long flags,
  172. // /* [in] */ long channel,
  173. /* [in] */ double tempo);
  174. HRESULT STDMETHODCALLTYPE sendTransposePMSG(
  175. /* [in] */ long mtTime,
  176. /* [in] */ long flags,
  177. /* [in] */ long channel,
  178. /* [in] */ short transpose);
  179. HRESULT STDMETHODCALLTYPE sendTimeSigPMSG(
  180. /* [in] */ long mtTime,
  181. /* [in] */ long flags,
  182. /* [in] */ DMUS_TIMESIGNATURE_CDESC __RPC_FAR *timesig);
  183. #if 0
  184. HRESULT STDMETHODCALLTYPE getPortName(
  185. /* [in] */ long i,
  186. /* [retval][out] */ BSTR __RPC_FAR *name);
  187. HRESULT STDMETHODCALLTYPE getPortCount(
  188. /* [retval][out] */ long __RPC_FAR *c);
  189. HRESULT STDMETHODCALLTYPE getPortCaps( long i,
  190. /* [out][in] */ DMUS_PORTCAPS_CDESC __RPC_FAR *caps);
  191. HRESULT STDMETHODCALLTYPE setPort(
  192. /* [in] */ long portid,
  193. /* [in] */ long numGroups);
  194. #endif
  195. #ifdef _WIN64
  196. HRESULT STDMETHODCALLTYPE InitAudio(HWND hWnd,
  197. long lFlags,
  198. DMUS_AUDIOPARAMS_CDESC *AudioParams,
  199. I_dxj_DirectSound **DirectSound,
  200. long lDefaultPathType,
  201. long lPChannelCount);
  202. #else
  203. HRESULT STDMETHODCALLTYPE InitAudio(long hWnd,
  204. long lFlags,
  205. DMUS_AUDIOPARAMS_CDESC *AudioParams,
  206. I_dxj_DirectSound **DirectSound,
  207. long lDefaultPathType,
  208. long lPChannelCount);
  209. #endif
  210. HRESULT STDMETHODCALLTYPE PlaySegmentEx(IUnknown *Source,
  211. long lFlags,
  212. long StartTime,
  213. IUnknown *From,
  214. IUnknown *AudioPath,
  215. #if 0
  216. BSTR SegmentName,
  217. IUnknown *Transition,
  218. #endif
  219. I_dxj_DirectMusicSegmentState **ppSegmentState);
  220. HRESULT STDMETHODCALLTYPE StopEx(IUnknown *ObjectToStop,
  221. long lStopTime,
  222. long lFlags);
  223. HRESULT STDMETHODCALLTYPE CreateAudioPath(IUnknown *SourceConfig, VARIANT_BOOL fActive,
  224. I_dxj_DirectMusicAudioPath **ppNewPath);
  225. HRESULT STDMETHODCALLTYPE CreateStandardAudioPath(long lType, long lPChannelCount, VARIANT_BOOL fActive,
  226. I_dxj_DirectMusicAudioPath **ppNewPath);
  227. HRESULT STDMETHODCALLTYPE SetDefaultAudioPath(I_dxj_DirectMusicAudioPath *AudioPath);
  228. HRESULT STDMETHODCALLTYPE GetDefaultAudioPath(I_dxj_DirectMusicAudioPath **ppAudioPath);
  229. #if 0
  230. HRESULT STDMETHODCALLTYPE AddPort(I_dxj_DirectMusicPort *port);
  231. HRESULT STDMETHODCALLTYPE RemovePort(I_dxj_DirectMusicPort *port);
  232. HRESULT STDMETHODCALLTYPE AssignPChannel(long lPChannel, I_dxj_DirectMusicPort *Port, long lGroup, long lMChannel);
  233. HRESULT STDMETHODCALLTYPE AssignPChannelBlock(long lPChannel, I_dxj_DirectMusicPort *Port, long lGroup);
  234. HRESULT STDMETHODCALLTYPE PChannelInfo(long lPChannel, I_dxj_DirectMusicPort *Port, long *lGroup, long *lMChannel);
  235. #endif
  236. ////////////////////////////////////////////////////////////////////////////////////
  237. //
  238. private:
  239. HRESULT InternalInit();
  240. HRESULT InternalCleanup();
  241. IDirectMusic8 *m_pDM;
  242. IDirectMusicPort8 *m_pPort;
  243. DECL_VARIABLE(_dxj_DirectMusicPerformance);
  244. long m_portid;
  245. long m_number_of_groups;
  246. public:
  247. DX3J_GLOBAL_LINKS( _dxj_DirectMusicPerformance)
  248. };