Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cSoundVolume.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cSoundVolume_H
7 #define _INC_cSoundVolume_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "cSoundMixer.h"
13 
14 #ifdef _WIN32
15 
16 namespace GrayLib
17 {
18  class cSoundVolume
19  {
23 
24  public:
25  cSoundMixer m_Mixer;
26  DWORD m_dwChannels;
27  DWORD m_dwControls;
28  DWORD m_dwControlIDVol;
29  DWORD m_dwControlIDMute;
30 
31  private:
32  HRESULT AttachLine(DWORD dwLineID);
33 
34  public:
35  cSoundVolume(void);
36  ~cSoundVolume(void);
37 
38  bool isOpen() const
39  {
40  return m_Mixer.isOpen();
41  }
42 
43  HRESULT OpenMic(UINT uMixerDeviceID = 0, DWORD dwOpenFlags = MIXER_OBJECTF_MIXER, DWORD ComponentType = 0);
44  HRESULT OpenMaster(UINT uMixerDeviceID = 0, DWORD dwOpenFlags = MIXER_OBJECTF_MIXER);
45  void CloseMaster();
46 
47  HRESULT get_Volume(SOUND_VOL2_t& rVol) const;
48  HRESULT put_Volume(SOUND_VOL2_t Vol);
49 
50  HRESULT get_Mute(bool& rMute) const;
51  HRESULT put_Mute(bool bMute);
52  };
53 };
54 #endif
55 #endif
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cMesh.h:22
DWORD SOUND_VOL2_t
Stereo linear perceived volume. LOWORD(left) HIWORD(right)
Definition: cSoundBase.h:30