VOLUME~3.H
上传用户:lianyisd
上传日期:2019-11-03
资源大小:5188k
文件大小:2k
源码类别:

midi

开发平台:

Visual C++

  1. // VolumeOutWave.h : Module interface declaration.
  2. // IVolume implementation for wave audio output device
  3. // Developer : Alex Chmut
  4. // Created : 8/11/98
  5. #pragma once
  6. #include "IVolume.h"
  7. ///////////////////////////////////////////////////////////////////////////////////////////////
  8. class CVolumeOutWave
  9. : public IVolume
  10. {
  11. ////////////////////////
  12. // IVolume interface
  13. public:
  14. virtual bool IsAvailable();
  15. virtual void Enable();
  16. virtual void Disable();
  17. virtual DWORD GetVolumeMetric();
  18. virtual DWORD GetMinimalVolume();
  19. virtual DWORD GetMaximalVolume();
  20. virtual DWORD GetCurrentVolume();
  21. virtual void SetCurrentVolume( DWORD dwValue );
  22. virtual void RegisterNotificationSink( PONMICVOULUMECHANGE, DWORD );
  23. public:
  24. CVolumeOutWave();
  25. ~CVolumeOutWave();
  26. private:
  27. bool Init();
  28. void Done();
  29. bool Initialize();
  30. void EnableLine( bool bEnable = true );
  31. private:
  32. // Status Info
  33. bool m_bOK;
  34. bool m_bInitialized;
  35. bool m_bAvailable;
  36. // Mixer Info
  37. UINT m_uMixerID;
  38. DWORD m_dwMixerHandle;
  39. DWORD m_dwLineID;
  40. DWORD m_dwVolumeControlID;
  41. int m_nChannelCount;
  42. HWND m_hWnd;
  43. static LRESULT CALLBACK MixerWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
  44. void OnControlChanged( DWORD dwControlID );
  45. DWORD m_dwMinimalVolume;
  46. DWORD m_dwMaximalVolume;
  47. DWORD m_dwVolumeStep;
  48. // User Info
  49. PONMICVOULUMECHANGE m_pfUserSink;
  50. DWORD m_dwUserValue;
  51. };
  52. typedef CVolumeOutWave* PCVolumeOutWave;
  53. ///////////////////////////////////////////////////////////////////////////////////////////////