My Project
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 #pragma once 00029 #include "define.h" 00030 #include <ddraw.h> 00031 #include <strmif.h> 00032 #include <mmdeviceapi.h> 00033 #include <endpointvolume.h> 00034 #include "Config.h" 00035 #include "VolumeControl.h" 00036 #include "VolumeNotification.h" 00037 #include "ParameterNotificationOSM.h" 00038 00039 namespace SallyAPI 00040 { 00041 namespace Sound 00042 { 00043 namespace Volume 00044 { 00053 00054 class DLL_API_SALLY CVolumeManager 00055 { 00056 private: 00057 static SallyAPI::Sound::Volume::CVolumeManager* m_pObject; 00058 00059 std::vector<SallyAPI::GUI::CControl*> m_vListeners; 00060 00061 // XP 00062 HMIXER m_hMixer; 00063 MIXERCAPS m_mxcaps; 00064 DWORD m_dwMuteControlID; 00065 00066 // Vista + 00067 SallyAPI::Sound::Volume::CVolumeNotification* m_pVolumeNotification; 00068 IAudioEndpointVolume* m_pEndpointVolume; 00069 00070 CVolumeManager(); 00071 ~CVolumeManager(); 00072 public: 00073 static SallyAPI::Sound::Volume::CVolumeManager* GetInstance(); 00074 static void DeleteInstance(); 00075 00076 int GetVolume(); 00077 bool IsMuted(); 00078 00079 void SetMuted(bool muted); 00080 void SetVolume(int volume); 00081 00082 void RegisterListener(SallyAPI::GUI::CControl* control); 00083 void UnregisterListener(SallyAPI::GUI::CControl* control); 00084 00085 void OnVolumeChange(); 00086 00087 bool IsWindowsVistaVolumeManagerAvailable(); 00088 }; 00089 } 00090 } 00091 }