main slider cbk, detected minor l_dcpp bug
This commit is contained in:
parent
a251b4cb6b
commit
679ad34f84
7 changed files with 49 additions and 22 deletions
|
|
@ -1,4 +1,4 @@
|
|||
GUID NGuidToGUID(NGuid* guid){
|
||||
GUID NGuidToGUID(NGuid* guid) {
|
||||
GUID msGuid = GUID();
|
||||
msGuid.Data1 = guid->data1;
|
||||
msGuid.Data2 = guid->data2;
|
||||
|
|
@ -6,12 +6,12 @@ GUID NGuidToGUID(NGuid* guid){
|
|||
msGuid.Data1 = guid->data1;
|
||||
for (int i = 0; i < 8; i++){
|
||||
msGuid.Data4[i] = guid->data4[i];
|
||||
log_debugcpp("MSGUID DATA4 BYTE " << i << ": ");
|
||||
log_debugcpp(print_as_binary(8, uint32_t, msGuid.Data4[i]));
|
||||
//log_debugcpp("MSGUID DATA4 BYTE " << i << ": ");
|
||||
//log_debugcpp(print_as_binary(8, uint32_t, msGuid.Data4[i]));
|
||||
}
|
||||
log_debugcpp("MSGUID DATA1: " << msGuid.Data1);
|
||||
log_debugcpp("MSGUID DATA2: " << msGuid.Data2);
|
||||
log_debugcpp("MSGUID DATA3: " << msGuid.Data3);
|
||||
//log_debugcpp("MSGUID DATA1: " << msGuid.Data1);
|
||||
//log_debugcpp("MSGUID DATA2: " << msGuid.Data2);
|
||||
//log_debugcpp("MSGUID DATA3: " << msGuid.Data3);
|
||||
|
||||
return msGuid;
|
||||
}
|
||||
|
|
@ -23,11 +23,11 @@ NGuid GUIDToNGuid(LPGUID msGuid){
|
|||
guid.data3 = msGuid->Data3;
|
||||
for (int i = 0; i < 8; i++){
|
||||
guid.data4[i] = msGuid->Data4[i];
|
||||
log_debugcpp("GUID DATA4 BYTE " << i << ": ");
|
||||
log_debugcpp(print_as_binary(8, uint32_t, guid.data4[i]));
|
||||
//log_debugcpp("GUID DATA4 BYTE " << i << ": ");
|
||||
//log_debugcpp(print_as_binary(8, uint32_t, guid.data4[i]));
|
||||
}
|
||||
log_debugcpp("GUID DATA1: " << guid.data1);
|
||||
log_debugcpp("GUID DATA2: " << guid.data2);
|
||||
log_debugcpp("GUID DATA3: " << guid.data3);
|
||||
//log_debugcpp("GUID DATA1: " << guid.data1);
|
||||
//log_debugcpp("GUID DATA2: " << guid.data2);
|
||||
//log_debugcpp("GUID DATA3: " << guid.data3);
|
||||
return guid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"); };
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Endpoint {
|
|||
Endpoint(IMMDevice* endpoint);
|
||||
uint64_t getIndex();
|
||||
void setIndex(uint64_t idx);
|
||||
void setVolume(int channel, float volume);
|
||||
void setVolume(NGuid* guid, int channel, float volume);
|
||||
/* float getLeftChannelVolume(); */
|
||||
/* float getRightChannelVolume(); */
|
||||
float getVolume(int channel);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue