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.

269 lines
8.9 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 IDirectMusicPerformance*
  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. HRESULT STDMETHODCALLTYPE init(
  37. /* [in] */ I_dxj_DirectSound __RPC_FAR *DirectSound,
  38. /* [in] */ long hWnd);
  39. HRESULT STDMETHODCALLTYPE closeDown( void);
  40. HRESULT STDMETHODCALLTYPE playSegment(
  41. /* [in] */ I_dxj_DirectMusicSegment __RPC_FAR *segment,
  42. /* [in] */ long lFlags,
  43. /* [in] */ long startTime,
  44. /* [retval][out] */ I_dxj_DirectMusicSegmentState __RPC_FAR *__RPC_FAR *segmentState);
  45. HRESULT STDMETHODCALLTYPE stop(
  46. /* [in] */ I_dxj_DirectMusicSegment __RPC_FAR *segment,
  47. /* [in] */ I_dxj_DirectMusicSegmentState __RPC_FAR *segmentState,
  48. /* [in] */ long mtTime,
  49. /* [in] */ long lFlags);
  50. HRESULT STDMETHODCALLTYPE getSegmentState(
  51. /* [in] */ long mtTime,
  52. /* [retval][out] */ I_dxj_DirectMusicSegmentState __RPC_FAR *__RPC_FAR *ret);
  53. HRESULT STDMETHODCALLTYPE invalidate(
  54. /* [in] */ long mtTime,
  55. /* [in] */ long flags);
  56. HRESULT STDMETHODCALLTYPE isPlaying(
  57. /* [in] */ I_dxj_DirectMusicSegment __RPC_FAR *segment,
  58. /* [in] */ I_dxj_DirectMusicSegmentState __RPC_FAR *segmentState,
  59. /* [retval][out] */ VARIANT_BOOL __RPC_FAR *b);
  60. HRESULT STDMETHODCALLTYPE addNotificationType(
  61. /* [in] */ CONST_DMUS_NOTIFICATION_TYPE type);
  62. HRESULT STDMETHODCALLTYPE removeNotificationType(
  63. /* [in] */ CONST_DMUS_NOTIFICATION_TYPE type);
  64. HRESULT STDMETHODCALLTYPE setNotificationHandle(
  65. /* [in] */ long hnd);
  66. HRESULT STDMETHODCALLTYPE getNotificationPMSG(
  67. /* [out][in] */ DMUS_NOTIFICATION_PMSG_CDESC __RPC_FAR *message, VARIANT_BOOL *b);
  68. HRESULT STDMETHODCALLTYPE musicToClockTime(
  69. /* [in] */ long mtTime,
  70. /* [retval][out] */ long __RPC_FAR *rtTime);
  71. HRESULT STDMETHODCALLTYPE clockToMusicTime(
  72. /* [in] */ long rtTime,
  73. /* [retval][out] */ long __RPC_FAR *mtTime);
  74. HRESULT STDMETHODCALLTYPE getMusicTime(
  75. /* [retval][out] */ long __RPC_FAR *ret);
  76. HRESULT STDMETHODCALLTYPE getClockTime(
  77. /* [retval][out] */ long __RPC_FAR *ret);
  78. HRESULT STDMETHODCALLTYPE getPrepareTime(
  79. /* [retval][out] */ long __RPC_FAR *lMilliSeconds);
  80. HRESULT STDMETHODCALLTYPE getBumperLength(
  81. /* [retval][out] */ long __RPC_FAR *lMilliSeconds);
  82. HRESULT STDMETHODCALLTYPE getLatencyTime(
  83. /* [retval][out] */ long __RPC_FAR *rtTime0);
  84. HRESULT STDMETHODCALLTYPE getQueueTime(
  85. /* [retval][out] */ long __RPC_FAR *rtTime);
  86. HRESULT STDMETHODCALLTYPE getResolvedTime(
  87. /* [in] */ long rtTime,
  88. /* [in] */ long flags,
  89. /* [retval][out] */ long __RPC_FAR *ret);
  90. HRESULT STDMETHODCALLTYPE setPrepareTime(
  91. /* [in] */ long lMilliSeconds);
  92. HRESULT STDMETHODCALLTYPE setBumperLength(
  93. /* [in] */ long lMilliSeconds);
  94. HRESULT STDMETHODCALLTYPE adjustTime(
  95. /* [in] */ long rtAmount);
  96. HRESULT STDMETHODCALLTYPE setMasterAutoDownload(
  97. /* [in] */ VARIANT_BOOL b);
  98. HRESULT STDMETHODCALLTYPE getMasterAutoDownload(
  99. /* [retval][out] */ VARIANT_BOOL __RPC_FAR *b);
  100. HRESULT STDMETHODCALLTYPE setMasterTempo(
  101. /* [in] */ float tempo);
  102. HRESULT STDMETHODCALLTYPE getMasterTempo(
  103. /* [retval][out] */ float __RPC_FAR *tempo);
  104. HRESULT STDMETHODCALLTYPE setMasterVolume(
  105. /* [in] */ long vol);
  106. HRESULT STDMETHODCALLTYPE getMasterVolume(
  107. /* [retval][out] */ long __RPC_FAR *v);
  108. HRESULT STDMETHODCALLTYPE setMasterGrooveLevel(
  109. /* [in] */ short level);
  110. HRESULT STDMETHODCALLTYPE getMasterGrooveLevel(
  111. /* [retval][out] */ __RPC_FAR short *level);
  112. HRESULT STDMETHODCALLTYPE Reset(long flags);
  113. HRESULT STDMETHODCALLTYPE getStyle(
  114. /* [in] */ long mtTime,
  115. /* [out][in] */ long __RPC_FAR *mtUntil,
  116. /* [retval][out] */ I_dxj_DirectMusicStyle __RPC_FAR *__RPC_FAR *ret);
  117. HRESULT STDMETHODCALLTYPE getChordMap(
  118. /* [in] */ long mtTime,
  119. /* [out][in] */ long __RPC_FAR *mtUntil,
  120. /* [retval][out] */ I_dxj_DirectMusicChordMap __RPC_FAR *__RPC_FAR *ret);
  121. HRESULT STDMETHODCALLTYPE getCommand(
  122. /* [in] */ long mtTime,
  123. /* [out][in] */ long __RPC_FAR *mtUntil,
  124. /* [retval][out] */ Byte __RPC_FAR *command);
  125. HRESULT STDMETHODCALLTYPE getGrooveLevel(
  126. /* [in] */ long mtTime,
  127. /* [out][in] */ long __RPC_FAR *mtUntil,
  128. /* [retval][out] */ Byte __RPC_FAR *level);
  129. HRESULT STDMETHODCALLTYPE getTempo(
  130. /* [in] */ long mtTime,
  131. /* [out][in] */ long __RPC_FAR *mtUntil,
  132. /* [retval][out] */ double __RPC_FAR *tempo);
  133. HRESULT STDMETHODCALLTYPE getTimeSig(
  134. /* [in] */ long mtTime,
  135. /* [out][in] */ long __RPC_FAR *mtUntil,
  136. /* [out][in] */ DMUS_TIMESIGNATURE_CDESC __RPC_FAR *timeSig);
  137. HRESULT STDMETHODCALLTYPE sendNotePMSG(
  138. /* [in] */ long mtTime,
  139. /* [in] */ long flags,
  140. /* [in] */ long channel,
  141. /* [in] */ DMUS_NOTE_PMSG_CDESC __RPC_FAR *msg);
  142. HRESULT STDMETHODCALLTYPE sendCurvePMSG(
  143. /* [in] */ long mtTime,
  144. /* [in] */ long flags,
  145. /* [in] */ long channel,
  146. /* [in] */ DMUS_CURVE_PMSG_CDESC __RPC_FAR *msg);
  147. HRESULT STDMETHODCALLTYPE sendMIDIPMSG(
  148. /* [in] */ long mtTime,
  149. /* [in] */ long flags,
  150. /* [in] */ long channel,
  151. /* [in] */ Byte status,
  152. /* [in] */ Byte byte1,
  153. /* [in] */ Byte byte2);
  154. HRESULT STDMETHODCALLTYPE sendPatchPMSG(
  155. /* [in] */ long mtTime,
  156. /* [in] */ long flags,
  157. /* [in] */ long channel,
  158. /* [in] */ Byte instrument,
  159. /* [in] */ Byte byte1,
  160. /* [in] */ Byte byte2);
  161. HRESULT STDMETHODCALLTYPE sendTempoPMSG(
  162. /* [in] */ long mtTime,
  163. /* [in] */ long flags,
  164. // /* [in] */ long channel,
  165. /* [in] */ double tempo);
  166. HRESULT STDMETHODCALLTYPE sendTransposePMSG(
  167. /* [in] */ long mtTime,
  168. /* [in] */ long flags,
  169. /* [in] */ long channel,
  170. /* [in] */ short transpose);
  171. HRESULT STDMETHODCALLTYPE sendTimeSigPMSG(
  172. /* [in] */ long mtTime,
  173. /* [in] */ long flags,
  174. /* [in] */ DMUS_TIMESIGNATURE_CDESC __RPC_FAR *timesig);
  175. HRESULT STDMETHODCALLTYPE getPortName(
  176. /* [in] */ long i,
  177. /* [retval][out] */ BSTR __RPC_FAR *name);
  178. HRESULT STDMETHODCALLTYPE getPortCount(
  179. /* [retval][out] */ long __RPC_FAR *c);
  180. HRESULT STDMETHODCALLTYPE getPortCaps( long i,
  181. /* [out][in] */ DMUS_PORTCAPS_CDESC __RPC_FAR *caps);
  182. HRESULT STDMETHODCALLTYPE setPort(
  183. /* [in] */ long portid,
  184. /* [in] */ long numGroups);
  185. ////////////////////////////////////////////////////////////////////////////////////
  186. //
  187. private:
  188. HRESULT InternalInit();
  189. HRESULT InternalCleanup();
  190. IDirectMusic *m_pDM;
  191. IDirectMusicPort *m_pPort;
  192. DECL_VARIABLE(_dxj_DirectMusicPerformance);
  193. long m_portid;
  194. long m_number_of_groups;
  195. public:
  196. DX3J_GLOBAL_LINKS( _dxj_DirectMusicPerformance)
  197. };