mute button

This commit is contained in:
2022-07-26 20:34:40 +02:00
parent 5f5e24fa9c
commit c58b6c5624
3 changed files with 34 additions and 2 deletions

View File

@@ -171,4 +171,17 @@ void getVolumeLimit(IAudioEndpointVolume* volumeInterface, float* outMin, float*
{
float dummy;
volumeInterface->GetVolumeRange(outMin, outMax, &dummy);
}
bool isMuted(IAudioEndpointVolume* volumeInterface)
{
BOOL result = false;
if (FAILED(volumeInterface->GetMute(&result))) return false;
return static_cast<bool>(result);
}
void setMuted(IAudioEndpointVolume* volumeInterface, bool newState)
{
volumeInterface->SetMute(static_cast<BOOL>(newState), NULL);
}