VCM: unmute both cam and mic when we detect that a camera-using app has quitted

This commit is contained in:
yuyoyuppe
2020-10-12 20:02:34 +03:00
parent c48424a3eb
commit 128a305ae4
4 changed files with 9 additions and 4 deletions

View File

@@ -128,6 +128,10 @@ LRESULT Toolbar::WindowProcessMessages(HWND hwnd, UINT msg, WPARAM wparam, LPARA
{
show = toolbar->HideToolbarWhenUnmuted ? toolbar->microphoneMuted || toolbar->cameraMuted : true;
}
else if (toolbar->previouscameraInUse)
{
VideoConferenceModule::unmuteAll();
}
else
{
show = toolbar->microphoneMuted;
@@ -143,7 +147,7 @@ LRESULT Toolbar::WindowProcessMessages(HWND hwnd, UINT msg, WPARAM wparam, LPARA
}
KillTimer(hwnd, toolbar->nTimerId);
toolbar->previouscameraInUse = toolbar->cameraInUse;
break;
}
default:

View File

@@ -42,6 +42,7 @@ private:
bool cameraMuted = false;
bool cameraInUse = false;
bool previouscameraInUse = false;
bool microphoneMuted = false;
std::wstring theme = L"system";

View File

@@ -179,7 +179,7 @@ VideoConferenceModule::VideoConferenceModule()
inline VideoConferenceModule::~VideoConferenceModule()
{
unmuteAll();
instance->unmuteAll();
toolbar.hide();
}
@@ -408,7 +408,7 @@ void VideoConferenceModule::disable()
}
}
unmuteAll();
instance->unmuteAll();
toolbar.hide();
_enabled = false;

View File

@@ -47,6 +47,7 @@ public:
void sendSourceCameraNameUpdate();
void sendOverlayImageUpdate();
static void unmuteAll();
static void reverseMicrophoneMute();
static bool getMicrophoneMuteState();
static void reverseVirtualCameraMuteState();
@@ -54,7 +55,6 @@ public:
static bool getVirtualCameraInUse();
private:
void unmuteAll();
void init_settings();
void updateControlledMicrophones(const std::wstring_view new_mic);
// all callback methods and used by callback have to be static