diff --git a/src/back/backlasses.cpp b/src/back/backlasses.cpp index 029ff61..f307361 100644 --- a/src/back/backlasses.cpp +++ b/src/back/backlasses.cpp @@ -248,7 +248,7 @@ Endpoint::Endpoint(IMMDevice* ep, uint64_t idx){ * Only shows most relevant flag according to MS, i.e. 0110 sends 0010 */ //todo: preguntitas owindows dword no es uint32_t even tho mingw mingas - if(FAILED(endpoint->GetState(&this->endpointState))) {exit(-1);}; + if(FAILED(endpoint->GetState(&this->endpointState))) {exit(-2);}; if(this->endpointState == EndpointState::ENDPOINT_ACTIVE) { activateEndpointVolume(); @@ -282,10 +282,6 @@ Endpoint::Endpoint(IMMDevice* ep, uint64_t idx){ } } -/* - * Endpoint::Endpoint(IMMDevice* endpoint) : Endpoint(endpoint, 0) {}; - */ - void Endpoint::activateEndpointSessions() { //sessionManager; if (FAILED(endpoint->Activate(__uuidof(IAudioSessionManager2), CLSCTX_ALL, NULL, (void**) &sessionManager))) { log_wdebugcpp(L"sesionbros..."); return; } @@ -421,7 +417,7 @@ Roles Endpoint::getRoles(){ } void Endpoint::setRoles(Roles role){ - //otro exe momento + //todo: otro exe momento STARTUPINFOEXW startupConfig; PROCESS_INFORMATION processInfo; SecureZeroMemory(&startupConfig, sizeof(STARTUPINFOEXW)); @@ -648,6 +644,7 @@ void Overseer::reloadEndpoints(Flows flow) { captureDevices.at(j)->assignRoles((Roles)(1 << i)); } } + } } } diff --git a/src/qt/qtclasses.cpp b/src/qt/qtclasses.cpp index a004043..4b8f044 100644 --- a/src/qt/qtclasses.cpp +++ b/src/qt/qtclasses.cpp @@ -104,10 +104,10 @@ void MainWindow::compose() { */ uint64_t windowHeight = 0; int left = 0, top = 0, right = 0, bottom = 0; - for (auto *epw : this->ews) { - if (!epw) continue; - epw->layout()->getContentsMargins(&left, &top, &right, &bottom); - windowHeight += epw->sizeHint().height(); + for (int i = 0; i < 2; i++) { + if (!ews[i]) continue; + ews[i]->layout()->getContentsMargins(&left, &top, &right, &bottom); + windowHeight += ews[i]->sizeHint().height(); windowHeight += top; windowHeight += bottom; } @@ -806,17 +806,24 @@ void MainWindow::trayIconActivated(QSystemTrayIcon::ActivationReason reason) { } void MainWindow::reloadEndpointWidgets() { - size_t i = 0; + size_t i = 2; + ews.resize(2); //widgetLayout->addItem(&lastRowSpacer, i++, 0); for (size_t epwIndex = 0; i < (osh->getPlaybackEndpointHandlers().size()); i++) { if (osh->getPlaybackEndpointHandlers().at(i)->getState() == EndpointState::ENDPOINT_ACTIVE){ log_debugcpp("EPWidget creation"); //osh->getPlaybackEndpointHandlers().at(i)->getCallbackInfo()->caller = osh->getGuid(); EndpointWidget *epw = new EndpointWidget(epwIndex, osh->getPlaybackEndpointHandlers().at(i), widget); - epwIndex++; - //alfinal estoes solopara inicializarlmao - ews.push_back(epw); - widgetLayout->addWidget(epw, i, 0); + if ((epw->getEndpointHandler()->getRoles() & Roles::ROLE_ALL) || + (epw->getEndpointHandler()->getRoles() & Roles::ROLE_MULTIMEDIA)) + { ews[0] = epw; widgetLayout->addWidget(epw, 0, 0); } + else if (epw->getEndpointHandler()->getRoles() & Roles::ROLE_CONSOLE) + { ews[0] = epw; widgetLayout->addWidget(epw, 1, 0); } + else { + epwIndex++; + //alfinal estoes solopara inicializarlmao + ews.push_back(epw); + widgetLayout->addWidget(epw, i, 0); } } } //todo:: tas aqui tirao, no me gustas y probablemente yo a ti tampoco