Compare commits
2 commits
78fabd3917
...
76d0afe672
| Author | SHA1 | Date | |
|---|---|---|---|
| 76d0afe672 | |||
| d801be1f61 |
3 changed files with 23 additions and 19 deletions
|
|
@ -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,17 +282,14 @@ 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; }
|
||||
|
||||
|
||||
IAudioSessionEnumerator* sessionEnumerator = nullptr;
|
||||
if (FAILED(sessionManager->GetSessionEnumerator(&sessionEnumerator))) { log_wdebugcpp(L"sesEnumeratorBros..."); return; }
|
||||
|
||||
endpointSessions.resize(1, nullptr);
|
||||
int sessionCount;
|
||||
sessionEnumerator->GetCount(&sessionCount);
|
||||
for (int i = 0; i < sessionCount; i++) {
|
||||
|
|
@ -304,7 +301,8 @@ void Endpoint::activateEndpointSessions() {
|
|||
sessionControl->AddRef();
|
||||
sessionControlTmp->Release();
|
||||
Session* session = new Session(this, sessionControl, (size_t)i);
|
||||
endpointSessions.push_back(session);
|
||||
if (sessionControl->IsSystemSoundsSession() == S_OK) endpointSessions[0] = session;
|
||||
else endpointSessions.push_back(session);
|
||||
}
|
||||
sessionEnumerator->Release();
|
||||
}
|
||||
|
|
@ -419,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));
|
||||
|
|
@ -646,6 +644,7 @@ void Overseer::reloadEndpoints(Flows flow) {
|
|||
captureDevices.at(j)->assignRoles((Roles)(1 << i));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -233,8 +233,6 @@ private:
|
|||
QAction *trayIconMenuOpenCP;
|
||||
QTimer *ewsUpdateTimer;
|
||||
static constexpr uint64_t ewsUpdateTimerFrequency = 500;
|
||||
//TODO: Test
|
||||
//TODO: Come back here and check all are parametrized
|
||||
double widthRatio = 0.28;
|
||||
|
||||
QScrollArea *scrollArea;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue