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.

144 lines
4.7 KiB

  1. #include "resource.h" // main symbols
  2. #include "dSoundObj.h"
  3. #include "dSoundCaptureObj.h"
  4. #define typedef__dxj_DirectPlayVoiceClient LPDIRECTPLAYVOICECLIENT
  5. /////////////////////////////////////////////////////////////////////////////
  6. // Direct
  7. //REVIEW -- using pointers to ID's is necessary because some compilers don't like
  8. //references as template arguments.
  9. class C_dxj_DirectPlayVoiceClientObject :
  10. #ifdef USING_IDISPATCH
  11. public CComDualImpl<I_dxj_DirectPlayVoiceClient, &IID_I_dxj_DirectPlayVoiceClient, &LIBID_DIRECTLib>,
  12. public ISupportErrorInfo,
  13. #else
  14. public I_dxj_DirectPlayVoiceClient,
  15. #endif
  16. public CComObjectRoot
  17. {
  18. public:
  19. C_dxj_DirectPlayVoiceClientObject() ;
  20. virtual ~C_dxj_DirectPlayVoiceClientObject() ;
  21. BEGIN_COM_MAP(C_dxj_DirectPlayVoiceClientObject)
  22. COM_INTERFACE_ENTRY(I_dxj_DirectPlayVoiceClient)
  23. #ifdef USING_IDISPATCH
  24. COM_INTERFACE_ENTRY(IDispatch)
  25. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  26. #endif
  27. END_COM_MAP()
  28. DECLARE_AGGREGATABLE(C_dxj_DirectPlayVoiceClientObject)
  29. #ifdef USING_IDISPATCH
  30. // ISupportsErrorInfo
  31. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  32. #endif
  33. // I_dxj_DirectPlayVoiceClient
  34. public:
  35. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalSetObject(
  36. /* [in] */ IUnknown __RPC_FAR *lpdd);
  37. /* [hidden] */ HRESULT STDMETHODCALLTYPE InternalGetObject(
  38. /* [retval][out] */ IUnknown __RPC_FAR *__RPC_FAR *lpdd);
  39. HRESULT STDMETHODCALLTYPE Initialize (
  40. /* [in] */ IUnknown __RPC_FAR *DplayObj,
  41. /* [in] */ long lFlags);
  42. HRESULT STDMETHODCALLTYPE Connect (
  43. /* [in] */ DVSOUNDDEVICECONFIG_CDESC __RPC_FAR *SoundDeviceConfig,
  44. /* [in] */ DVCLIENTCONFIG_CDESC __RPC_FAR *ClientConfig,
  45. /* [in] */ long lFlags);
  46. HRESULT STDMETHODCALLTYPE Disconnect (
  47. /* [in] */ long lFlags);
  48. HRESULT STDMETHODCALLTYPE GetSessionDesc (
  49. /* [out][in] */ DVSESSIONDESC_CDESC __RPC_FAR *SessionDesc);
  50. HRESULT STDMETHODCALLTYPE GetClientConfig (
  51. /* [out][in] */ DVCLIENTCONFIG_CDESC __RPC_FAR *ClientConfig);
  52. HRESULT STDMETHODCALLTYPE SetClientConfig (
  53. /* [in] */ DVCLIENTCONFIG_CDESC __RPC_FAR *ClientConfig);
  54. HRESULT STDMETHODCALLTYPE GetCaps (
  55. /* [out][in] */ DVCAPS_CDESC __RPC_FAR *Caps);
  56. HRESULT STDMETHODCALLTYPE GetCompressionTypeCount (
  57. /* [retval][out] */ long __RPC_FAR *v1);
  58. HRESULT STDMETHODCALLTYPE GetCompressionType (
  59. /* [in] */ long lIndex,
  60. /* [out][in] */ DVCOMPRESSIONINFO_CDESC __RPC_FAR *Data,
  61. /* [in] */ long lFlags);
  62. HRESULT STDMETHODCALLTYPE SetTransmitTargets (
  63. /* [in] */ SAFEARRAY **playerIDs,
  64. /* [in] */ long lFlags);
  65. HRESULT STDMETHODCALLTYPE GetTransmitTargets (
  66. /* [in] */ long lFlags,
  67. /* [retval][out] */ SAFEARRAY **ret);
  68. HRESULT STDMETHODCALLTYPE SetCurrentSoundDevices (
  69. /* [in] */ I_dxj_DirectSound *DirectSoundObj,
  70. /* [in] */ I_dxj_DirectSoundCapture *DirectCaptureObj);
  71. HRESULT STDMETHODCALLTYPE GetSoundDevices (
  72. /* [in,out] */ I_dxj_DirectSound __RPC_FAR *DirectSoundObj,
  73. /* [in,out] */ I_dxj_DirectSoundCapture __RPC_FAR *DirectCaptureObj);
  74. HRESULT STDMETHODCALLTYPE Create3DSoundBuffer (
  75. /* [in] */ long playerID,
  76. I_dxj_DirectSoundBuffer __RPC_FAR *Buffer,
  77. long lPriority,
  78. long lFlags,
  79. /* [out,retval] */ I_dxj_DirectSound3dBuffer __RPC_FAR **UserBuffer);
  80. HRESULT STDMETHODCALLTYPE Delete3DSoundBuffer (
  81. /* [in] */ long playerID,
  82. /* [in] */ I_dxj_DirectSound3dBuffer __RPC_FAR *UserBuffer);
  83. HRESULT STDMETHODCALLTYPE GetSoundDeviceConfig(
  84. /* [out,retval] */ DVSOUNDDEVICECONFIG_CDESC __RPC_FAR *SoundDeviceConfig);
  85. HRESULT STDMETHODCALLTYPE StartClientNotification(
  86. /* [in] */ I_dxj_DPVoiceEvent __RPC_FAR *event);
  87. HRESULT STDMETHODCALLTYPE UnRegisterMessageHandler();
  88. ////////////////////////////////////////////////////////////////////////
  89. //
  90. // note: this is public for the callbacks
  91. DECL_VARIABLE(_dxj_DirectPlayVoiceClient);
  92. private:
  93. DECL_VARIABLE(_dxj_DirectSound);
  94. DECL_VARIABLE(_dxj_DirectSoundCapture);
  95. HRESULT STDMETHODCALLTYPE FlushBuffer(LONG dwNumMessagesLeft);
  96. public:
  97. DX3J_GLOBAL_LINKS(_dxj_DirectPlayVoiceClient);
  98. DWORD InternalAddRef();
  99. DWORD InternalRelease();
  100. BOOL m_fHandleVoiceClientEvents;
  101. IStream *m_pEventStream;
  102. BOOL m_fInit;
  103. //We need to keep a count of the messages
  104. LONG m_dwMsgCount;
  105. };