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.

95 lines
2.4 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. //
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. //
  7. // Name: msptrmar.h
  8. //
  9. // Description: Definition of the CAudioRenderTerminal class
  10. //
  11. ///////////////////////////////////////////////////////////////////////////////
  12. #ifndef _MSPTRMAR_H_
  13. #define _MSPTRMAR_H_
  14. #define WAVEOUT_NAME L"WaveOut Terminal"
  15. #define MIXER_NAME L"PCM Mixer"
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CAudioRenderTerminal
  18. class CAudioRenderTerminal :
  19. public IDispatchImpl<ITBasicAudioTerminal, &IID_ITBasicAudioTerminal, &LIBID_TAPI3Lib>,
  20. public IDispatchImpl<ITStaticAudioTerminal, &IID_ITStaticAudioTerminal, &LIBID_TAPI3Lib>,
  21. public CSingleFilterStaticTerminal,
  22. public CMSPObjectSafetyImpl
  23. {
  24. public:
  25. CAudioRenderTerminal();
  26. virtual ~CAudioRenderTerminal();
  27. // Helper methods.
  28. HRESULT InitializeDefaultTerminal();
  29. static HRESULT CreateTerminal(
  30. IN CComPtr<IMoniker> pMoniker,
  31. IN MSP_HANDLE htAddress,
  32. OUT ITTerminal **ppTerm
  33. );
  34. HRESULT FindTerminalPin();
  35. BEGIN_COM_MAP(CAudioRenderTerminal)
  36. COM_INTERFACE_ENTRY(IObjectSafety)
  37. COM_INTERFACE_ENTRY(ITBasicAudioTerminal)
  38. COM_INTERFACE_ENTRY(ITStaticAudioTerminal)
  39. COM_INTERFACE_ENTRY_CHAIN(CSingleFilterStaticTerminal)
  40. END_COM_MAP()
  41. DECLARE_VQI()
  42. DECLARE_LOG_ADDREF_RELEASE(CAudioRenderTerminal)
  43. // ITBasicAudioTerminal
  44. public:
  45. STDMETHOD(get_Balance)(OUT long *pVal);
  46. STDMETHOD(put_Balance)(IN long newVal);
  47. STDMETHOD(get_Volume) (OUT long *pVal);
  48. STDMETHOD(put_Volume) (IN long newVal);
  49. // ITStaticAudioTerminal
  50. public:
  51. STDMETHOD(get_WaveId) (OUT long * plWaveId);
  52. // Implementation
  53. public:
  54. // CBaseTerminal overrides
  55. STDMETHODIMP CompleteConnectTerminal(void);
  56. STDMETHODIMP DisconnectTerminal(
  57. IN IGraphBuilder * pGraph,
  58. IN DWORD dwReserved
  59. );
  60. virtual HRESULT AddFiltersToGraph();
  61. virtual DWORD GetSupportedMediaTypes(void)
  62. {
  63. return (DWORD) TAPIMEDIATYPE_AUDIO;
  64. }
  65. HRESULT CreateFilters();
  66. private:
  67. // Keeps track of whether we need to unreserve WaveOut
  68. bool m_bResourceReserved;
  69. CComPtr<IBasicAudio> m_pIBasicAudio;
  70. };
  71. #endif // _MSPTRMAR_H_