#include "system.h" // for SAFE_RELEASE
#include "utils/log.h"
#include "cores/AudioEngine/AEFactory.h"
+#include "powermanagement/windows/Win32PowerSyscall.h"
class CMMNotificationClient : public IMMNotificationClient
{
break;
case eCommunications:
pszRole = "eCommunications";
- CAEFactory::DeviceChange();
+ NotifyAE();
break;
}
HRESULT STDMETHODCALLTYPE OnDeviceAdded(LPCWSTR pwstrDeviceId)
{
CLog::Log(LOGDEBUG, "%s: Added device: %s", __FUNCTION__, pwstrDeviceId);
- CAEFactory::DeviceChange();
+ NotifyAE();
return S_OK;
}
HRESULT STDMETHODCALLTYPE OnDeviceRemoved(LPCWSTR pwstrDeviceId)
{
CLog::Log(LOGDEBUG, "%s: Removed device: %s", __FUNCTION__, pwstrDeviceId);
- CAEFactory::DeviceChange();
+ NotifyAE();
return S_OK;
}
break;
}
CLog::Log(LOGDEBUG, "%s: New device state is DEVICE_STATE_%s", __FUNCTION__, pszState);
- CAEFactory::DeviceChange();
+ NotifyAE();
return S_OK;
}
key.pid);
return S_OK;
}
+
+ void STDMETHODCALLTYPE NotifyAE()
+ {
+ if(!CWin32PowerSyscall::IsSuspending())
+ CAEFactory::DeviceChange();
+ }
};
\ No newline at end of file