various fixes
This commit is contained in:
parent
e278280c4b
commit
24110624fb
9 changed files with 163 additions and 137 deletions
|
|
@ -39,7 +39,6 @@ HRESULT EndpointVolumeCallback::QueryInterface(REFIID riid, VOID **ppvInterface)
|
|||
HRESULT EndpointVolumeCallback::OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA pNotify) {
|
||||
if (pNotify == NULL) return E_INVALIDARG;
|
||||
|
||||
//TODO: el default = objcopy frees?
|
||||
//delete osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->caller;
|
||||
//osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->caller.freeData4();
|
||||
//Could've made a function or = override to hide this within Nguid, but back in cont = bad.
|
||||
|
|
@ -142,7 +141,7 @@ uint8_t Endpoint::getState(){
|
|||
}
|
||||
|
||||
|
||||
void Endpoint::setVolume(NGuid* guid, int channel, float volume) {
|
||||
void Endpoint::setVolume(NGuid guid, int channel, float volume) {
|
||||
//TIP: There used to be log messages here. Now, it's a ghost town.
|
||||
GUID tempMsGuid = NGuidToGUID(guid);
|
||||
if (channel == AudioChannel::CHANNEL_MAIN) {
|
||||
|
|
@ -152,7 +151,7 @@ void Endpoint::setVolume(NGuid* guid, int channel, float volume) {
|
|||
}
|
||||
}
|
||||
|
||||
void Endpoint::setMute(NGuid* guid, bool muted) {
|
||||
void Endpoint::setMute(NGuid guid, bool muted) {
|
||||
GUID tempMsGuid = NGuidToGUID(guid);
|
||||
if(FAILED(endpointVolume->SetMute(muted, &tempMsGuid))) { /* TIP: Above */ };
|
||||
}
|
||||
|
|
@ -197,6 +196,10 @@ void Overseer::initCOMLibrary() {
|
|||
GUID tempGuid;
|
||||
if(FAILED(CoCreateGuid(&tempGuid))) { log_debugcpp("Failed to obtain GUID: " ); };
|
||||
this->guid = GUIDToNGuid(&tempGuid);
|
||||
|
||||
//if(FAILED(CoCreateInstance(__uuidof(CPolicyConfigClient),
|
||||
// NULL, CLSCTX_ALL, __uuidof(IPolicyConfig10), (LPVOID *)&policyConfig))) {exit(-1);}
|
||||
|
||||
//TODO: Release lpguid?
|
||||
//TODO: Uninitialize COM
|
||||
}
|
||||
|
|
@ -244,9 +247,9 @@ void Overseer::reloadEndpoints() {
|
|||
LPWSTR id = nullptr;
|
||||
|
||||
for (unsigned int j = 0; j < numPlaybackEndpoints; j++){
|
||||
std::wstring test = playbackDevices.at(j)->getId();
|
||||
std::wstring eptId = playbackDevices.at(j)->getId();
|
||||
temp->GetId(&id);
|
||||
int comparison = CompareStringEx(LOCALE_NAME_USER_DEFAULT, 0, test.c_str(), -987, id, -987, NULL, NULL, 0);
|
||||
int comparison = CompareStringEx(LOCALE_NAME_USER_DEFAULT, 0, eptId.c_str(), -987, id, -987, NULL, NULL, 0);
|
||||
if (comparison - 2 == 0) {
|
||||
log_wdebugcpp("ola defaul de " << i << " es " << id);
|
||||
playbackDevices.at(j)->setRoles((1 << i));
|
||||
|
|
@ -273,9 +276,8 @@ Overseer::Overseer(){
|
|||
|
||||
//int Overseer::getDefaultCaptureEndpoint(Endpoint** defaultEndpoint);
|
||||
|
||||
//TODO guid
|
||||
NGuid* Overseer::getGuid() {
|
||||
return &guid;
|
||||
NGuid Overseer::getGuid() {
|
||||
return guid;
|
||||
}
|
||||
|
||||
std::vector<Endpoint*> Overseer::getPlaybackEndpoints() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue