code cleanup; channels callback coalesced again

This commit is contained in:
Hane 2023-08-15 17:03:23 +02:00
commit 831dceb89a
6 changed files with 58 additions and 55 deletions

View file

@ -56,15 +56,15 @@ HRESULT EndpointCallback::OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA pNotify) {
log_debugcpp("Onnanokotify says Stored: " << guid->data1);
log_debugcpp("Onnanokotify says Grace of God: " << eventData.guidEventContext.Data1);
osh->updateMuteCallback(this->ep->getIndex(), eventData.bMuted);
osh->updateMainVolumeCallback(this->ep->getIndex(), eventData.fMasterVolume);
osh->updateVolumeCallback(this->ep->getIndex(), AudioChannel::CHANNEL_MAIN ,eventData.fMasterVolume);
log_debugcpp("Onnanokotify says Reported Channel Qty: " << eventData.nChannels);
if(multiChannel)
for(UINT i = 0; i < eventData.nChannels; i++) {
osh->updateChannelVolumeCallback(this->ep->getIndex(), (uint32_t)i, extraChannelVol[i]);
osh->updateVolumeCallback(this->ep->getIndex(), (uint32_t)i, extraChannelVol[i]);
}
else
osh->updateChannelVolumeCallback(this->ep->getIndex(), (uint32_t)0, pNotify->afChannelVolumes[0]);
osh->updateVolumeCallback(this->ep->getIndex(), (uint32_t)0, pNotify->afChannelVolumes[0]);
}
return S_OK;