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.

70 lines
1.6 KiB

  1. // File: mixer.h
  2. #ifndef _MIXER_H_
  3. #define _MIXER_H_
  4. typedef struct tagMixLine
  5. {
  6. UINT ucChannels;
  7. BOOL fIdValid;
  8. DWORD dwControlId;
  9. DWORD dwLineId; // line ID of destination
  10. DWORD dwCompType; // Component type
  11. DWORD dwConnections; // number of sources associated with this line
  12. } MIXLINE;
  13. class CMixerDevice : public IMixer
  14. {
  15. private:
  16. HMIXER m_hMixer;
  17. MIXERCAPS m_mixerCaps;
  18. MIXLINE m_DstLine;
  19. MIXLINE m_SrcLine;
  20. BOOL Init( HWND hWnd, UINT_PTR uWaveDevId, DWORD dwFlags);
  21. LONG m_lRefCount;
  22. protected:
  23. CMixerDevice() : m_lRefCount(0)
  24. {
  25. m_hMixer = NULL;
  26. ZeroMemory (&m_DstLine, sizeof(m_DstLine));
  27. ZeroMemory (&m_SrcLine, sizeof(m_SrcLine));
  28. }
  29. public:
  30. ~CMixerDevice()
  31. {
  32. if (NULL != m_hMixer)
  33. {
  34. mixerClose(m_hMixer);
  35. }
  36. }
  37. BOOL __stdcall SetVolume (DWORD dwVolume)
  38. {
  39. BOOL fSetMain = SetMainVolume(dwVolume);
  40. BOOL fSetSub = SetSubVolume(dwVolume);
  41. return fSetMain || fSetSub;
  42. }
  43. BOOL __stdcall CanSetVolume () { return m_DstLine.fIdValid || m_SrcLine.fIdValid; }
  44. BOOL __stdcall SetMainVolume(DWORD dwVolume);
  45. BOOL __stdcall SetSubVolume(DWORD dwVolume);
  46. BOOL __stdcall SetAGC(BOOL fOn);
  47. BOOL __stdcall GetMainVolume(LPDWORD pdwVolume);
  48. BOOL __stdcall GetSubVolume(LPDWORD pdwVolume);
  49. BOOL __stdcall GetAGC(BOOL *pfOn);
  50. BOOL __stdcall EnableMicrophone();
  51. BOOL __stdcall UnMuteVolume();
  52. static CMixerDevice* GetMixerForWaveDevice( HWND hWnd, UINT uWaveDevId, DWORD dwFlags);
  53. // IUnknown
  54. HRESULT __stdcall QueryInterface(const IID&, void**);
  55. ULONG __stdcall AddRef();
  56. ULONG __stdcall Release();
  57. };
  58. #endif