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.

163 lines
4.6 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Name: IPConfaudt.h
  4. //
  5. // Description: Definition of the CIPConfAudioCaptureTerminal class and
  6. // CIPConfAudioRenderTerminal class
  7. //
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _IPConfAUDT_H_
  10. #define _IPConfAUDT_H_
  11. // the volume range for the API.
  12. const long MIN_VOLUME = 0;
  13. const long MAX_VOLUME = 0xFFFF;
  14. const long BALANCE_LEFT = -100;
  15. const long BALANCE_RIGHT = 100;
  16. const long BOOST_FACTOR = 100;
  17. // the volume range of the IAMInputMixer
  18. const double MIXER_MIN_VOLUME = 0.0;
  19. const double MIXER_MAX_VOLUME = 1.0;
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CIPConfAudioCaptureTerminal
  22. /////////////////////////////////////////////////////////////////////////////
  23. const DWORD AUDIO_CAPTURE_FILTER_NUMPINS = 1;
  24. class CIPConfAudioCaptureTerminal :
  25. public IDispatchImpl<ITBasicAudioTerminal, &__uuidof(ITBasicAudioTerminal), &LIBID_TAPI3Lib>,
  26. public IDispatchImpl<ITStaticAudioTerminal, &__uuidof(ITStaticAudioTerminal), &LIBID_TAPI3Lib>,
  27. public CIPConfBaseTerminal
  28. {
  29. BEGIN_COM_MAP(CIPConfAudioCaptureTerminal)
  30. COM_INTERFACE_ENTRY(ITBasicAudioTerminal)
  31. COM_INTERFACE_ENTRY(ITStaticAudioTerminal)
  32. COM_INTERFACE_ENTRY_CHAIN(CIPConfBaseTerminal)
  33. END_COM_MAP()
  34. public:
  35. CIPConfAudioCaptureTerminal();
  36. virtual ~CIPConfAudioCaptureTerminal();
  37. static HRESULT CreateTerminal(
  38. IN AudioDeviceInfo *pAudioDevieInfo,
  39. IN MSP_HANDLE htAddress,
  40. OUT ITTerminal **ppTerm
  41. );
  42. HRESULT Initialize (
  43. IN AudioDeviceInfo *pAudioDevieInfo,
  44. IN MSP_HANDLE htAddress
  45. );
  46. STDMETHODIMP DisconnectTerminal(
  47. IN IGraphBuilder * pGraph,
  48. IN DWORD dwReserved
  49. );
  50. // ITBasicAudioTerminal
  51. STDMETHOD(get_Balance)(OUT long *pVal);
  52. STDMETHOD(put_Balance)(IN long newVal);
  53. STDMETHOD(get_Volume) (OUT long *pVal);
  54. STDMETHOD(put_Volume) (IN long newVal);
  55. // ITStaticAudioTerminal
  56. STDMETHOD(get_WaveId) (OUT long * plWaveId);
  57. protected:
  58. HRESULT CreateFilter();
  59. DWORD GetNumExposedPins() const
  60. {
  61. return AUDIO_CAPTURE_FILTER_NUMPINS;
  62. }
  63. HRESULT GetExposedPins(
  64. IN IPin ** ppPins,
  65. IN DWORD dwNumPins
  66. );
  67. protected:
  68. UINT m_WaveID;
  69. GUID m_DSoundGuid;
  70. IAMAudioInputMixer * m_pIAMAudioInputMixer;
  71. };
  72. /////////////////////////////////////////////////////////////////////////////
  73. // CIPConfAudioRenderTerminal
  74. /////////////////////////////////////////////////////////////////////////////
  75. const DWORD AUDIO_RENDER_FILTER_NUMPINS = 5;
  76. class CIPConfAudioRenderTerminal :
  77. public IDispatchImpl<ITBasicAudioTerminal, &__uuidof(ITBasicAudioTerminal), &LIBID_TAPI3Lib>,
  78. public IDispatchImpl<ITStaticAudioTerminal, &__uuidof(ITStaticAudioTerminal), &LIBID_TAPI3Lib>,
  79. public CIPConfBaseTerminal
  80. {
  81. BEGIN_COM_MAP(CIPConfAudioRenderTerminal)
  82. COM_INTERFACE_ENTRY(ITBasicAudioTerminal)
  83. COM_INTERFACE_ENTRY(ITStaticAudioTerminal)
  84. COM_INTERFACE_ENTRY_CHAIN(CIPConfBaseTerminal)
  85. END_COM_MAP()
  86. public:
  87. CIPConfAudioRenderTerminal();
  88. virtual ~CIPConfAudioRenderTerminal();
  89. static HRESULT CreateTerminal(
  90. IN AudioDeviceInfo *pAudioDevieInfo,
  91. IN MSP_HANDLE htAddress,
  92. OUT ITTerminal **ppTerm
  93. );
  94. HRESULT Initialize (
  95. IN AudioDeviceInfo *pAudioDevieInfo,
  96. IN MSP_HANDLE htAddress
  97. );
  98. STDMETHODIMP DisconnectTerminal(
  99. IN IGraphBuilder * pGraph,
  100. IN DWORD dwReserved
  101. );
  102. // ITBasicAudioTerminal
  103. STDMETHOD(get_Balance)(OUT long *pVal);
  104. STDMETHOD(put_Balance)(IN long newVal);
  105. STDMETHOD(get_Volume) (OUT long *pVal);
  106. STDMETHOD(put_Volume) (IN long newVal);
  107. // ITStaticAudioTerminal
  108. STDMETHOD(get_WaveId) (OUT long * plWaveId);
  109. protected:
  110. HRESULT CreateFilter();
  111. DWORD GetNumExposedPins() const
  112. {
  113. return AUDIO_RENDER_FILTER_NUMPINS;
  114. }
  115. HRESULT GetExposedPins(
  116. IN IPin ** ppPins,
  117. IN DWORD dwNumPins
  118. );
  119. protected:
  120. UINT m_WaveID;
  121. GUID m_DSoundGuid;
  122. IBasicAudio * m_pIBasicAudio;
  123. };
  124. #endif // _IPConfAUDT_H_
  125. // eof