add new VideoConference module for muting mic/cam

Co-authored-by: PrzemyslawTusinski <61138537+PrzemyslawTusinski@users.noreply.github.com>
This commit is contained in:
yuyoyuppe
2020-08-24 15:59:41 +02:00
parent 0349383d08
commit 795682242e
116 changed files with 6547 additions and 24 deletions

View File

@@ -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;
}