Source code of Windows XP (NT5)
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.

50 lines
1.6 KiB

  1. // SoundCtl.h : Declaration of the CSoundCtl
  2. #ifndef __SOUNDCTL_H_
  3. #define __SOUNDCTL_H_
  4. #include "resource.h" // main symbols
  5. #include <atlctl.h>
  6. #include <mmsystem.h>
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CSoundCtl
  9. class ATL_NO_VTABLE CSoundCtl :
  10. public CComObjectRootEx<CComSingleThreadModel>,
  11. public CComCoClass<CSoundCtl, &CLSID_SoundCtl>,
  12. public IDispatchImpl<ISoundCtl, &IID_ISoundCtl, &LIBID_SNDCTLLib>,
  13. public IObjectSafetyImpl<CSoundCtl, (INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACESAFE_FOR_UNTRUSTED_DATA)>
  14. {
  15. public:
  16. CSoundCtl();
  17. DECLARE_REGISTRY_RESOURCEID(IDR_SOUNDCTL)
  18. DECLARE_PROTECT_FINAL_CONSTRUCT()
  19. BEGIN_COM_MAP(CSoundCtl)
  20. COM_INTERFACE_ENTRY(ISoundCtl)
  21. COM_INTERFACE_ENTRY(IDispatch)
  22. COM_INTERFACE_ENTRY(IObjectSafety)
  23. END_COM_MAP()
  24. // ISoundCtl
  25. public:
  26. STDMETHOD(get_ComponentType)(/*[out, retval]*/ long *pVal);
  27. STDMETHOD(put_ComponentType)(/*[in]*/ long newVal);
  28. STDMETHOD(get_Mute)(/*[out, retval]*/ VARIANT_BOOL *pVal);
  29. STDMETHOD(put_Mute)(/*[in]*/ VARIANT_BOOL newVal);
  30. STDMETHOD(get_Volume)(/*[out, retval]*/ DWORD *pVal);
  31. STDMETHOD(put_Volume)(/*[in]*/ DWORD newVal);
  32. private:
  33. MMRESULT AdjustLineVolume(HMIXEROBJ hmx, MIXERCONTROL *pmxctrl, DWORD cChannels, DWORD dwValue);
  34. MMRESULT AdjustLineMute(HMIXEROBJ hmx, MIXERCONTROL *pmxctrl, DWORD cChannels, DWORD dwValue);
  35. MMRESULT AdjustLine(HMIXEROBJ hmx, MIXERLINE *pmxl, DWORD dwControlType, DWORD dwValue);
  36. MMRESULT AdjustSound(DWORD dwComponentType, DWORD dwControlType, DWORD dwValue);
  37. private:
  38. DWORD m_dwComponentType;
  39. };
  40. #endif //__SOUNDCTL_H_