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.

75 lines
1.6 KiB

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