Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-8 authored Mar 2, 2024
1 parent a7808ea commit 7f9b58e
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions cppsrc/win/win-sound-mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ float Device::GetVolume()
{
float volume;
HRESULT res = endpointVolume->GetMasterVolumeLevelScalar(&volume);
if (res != S_OK) {
if (res != S_OK)
{
return 0.F;
}
return volume;
Expand All @@ -392,9 +393,11 @@ bool Device::GetMute()
{
BOOL mute;
HRESULT res = endpointVolume->GetMute(&mute);
if (res != S_OK) {
// if we can't retrieve the GetMute state, there is probably something wrong with the audio endpoint
// and the user can't hear it anyway, so just return true for the mute state.
if (res != S_OK)
{
// if we can't retrieve the GetMute state, there is probably something
// wrong with the audio endpoint and the user can't hear it anyway, so
// just return true for the mute state.
return true;
}
return (bool)mute;
Expand Down Expand Up @@ -431,14 +434,18 @@ VolumeBalance Device::GetVolumeBalance()
return result;
}
result.stereo = true;
HRESULT res1 = endpointVolume->GetChannelVolumeLevelScalar(RIGHT, &result.right);
if (res1 != S_OK) {
HRESULT res1
= endpointVolume->GetChannelVolumeLevelScalar(RIGHT, &result.right);
if (res1 != S_OK)
{
result.right = 0.F; // revert right volume
return result;
}

HRESULT res2 = endpointVolume->GetChannelVolumeLevelScalar(LEFT, &result.left);
if (res2 != S_OK) {
HRESULT res2
= endpointVolume->GetChannelVolumeLevelScalar(LEFT, &result.left);
if (res2 != S_OK)
{
result.left = 0.F; // revert left volume
return result;
}
Expand Down

0 comments on commit 7f9b58e

Please sign in to comment.