main slider cbk, detected minor l_dcpp bug

This commit is contained in:
Hane 2023-08-13 15:25:34 +02:00
commit 833b417441
7 changed files with 49 additions and 22 deletions

View file

@ -48,6 +48,7 @@ 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);
}
return S_OK;
@ -116,11 +117,12 @@ bool Endpoint::getMute(){
*/
void Endpoint::setVolume(int channel, float volume) {
void Endpoint::setVolume(NGuid* guid, int channel, float volume) {
GUID tempMsGuid = NGuidToGUID(guid);
if (channel == ENDPOINT_MASTER_VOLUME) {
if(FAILED(endpointVolume->SetMasterVolumeLevelScalar(volume, NULL))) { log_debugcpp("si"); };
if(FAILED(endpointVolume->SetMasterVolumeLevelScalar(volume, &tempMsGuid))) { log_debugcpp("si"); };
} else {
if(FAILED(endpointVolume->SetChannelVolumeLevelScalar(channel, volume, NULL))) { log_debugcpp("si"); };
if(FAILED(endpointVolume->SetChannelVolumeLevelScalar(channel, volume, &tempMsGuid))) { log_debugcpp("si"); };
}
}