mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 20:20:38 +01:00
add new VideoConference module for muting mic/cam
Co-authored-by: PrzemyslawTusinski <61138537+PrzemyslawTusinski@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#include "pch.h"
|
||||
#include "CVolumeNotification.h"
|
||||
|
||||
CVolumeNotification::CVolumeNotification(void) :
|
||||
m_RefCount(1)
|
||||
{
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG __stdcall) CVolumeNotification::AddRef()
|
||||
{
|
||||
return InterlockedIncrement(&m_RefCount);
|
||||
}
|
||||
|
||||
STDMETHODIMP_(ULONG __stdcall) CVolumeNotification::Release()
|
||||
{
|
||||
LONG ref = InterlockedDecrement(&m_RefCount);
|
||||
if (ref == 0)
|
||||
delete this;
|
||||
return ref;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(HRESULT __stdcall) CVolumeNotification::QueryInterface(REFIID IID, void** ReturnValue)
|
||||
{
|
||||
if (IID == IID_IUnknown || IID == __uuidof(IAudioEndpointVolumeCallback))
|
||||
{
|
||||
*ReturnValue = static_cast<IUnknown*>(this);
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
*ReturnValue = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(HRESULT __stdcall) CVolumeNotification::OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA NotificationData)
|
||||
{
|
||||
Overlay::setMicrophoneMute(NotificationData->bMuted);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user