uuh... peak?
This commit is contained in:
parent
6d2f981d35
commit
f92df42995
2 changed files with 34 additions and 26 deletions
|
|
@ -172,6 +172,7 @@ EndpointWidget::EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *pare
|
|||
//memcpy(osh->callbackInfo[idx]->caller, osh->getGuid(), sizeof(NGuid));
|
||||
|
||||
//TODO: el default = objcopy frees?
|
||||
//Todo: like fr pregunta
|
||||
eph->getCallbackInfo()->caller = osh->getGuid();
|
||||
mainSlider->blockSignals(false);
|
||||
muteButton->blockSignals(false);
|
||||
|
|
@ -213,7 +214,7 @@ void MainWindow::removeEndpointWidget(EndpointWidgetEvent<uint64_t>* ev){
|
|||
//delete ews.at(index);
|
||||
while ((i + 1) < ews.size()) {
|
||||
ews.at(i) = ews.at(i + 1);
|
||||
ews.at(i)->updateFrontIndex(i);
|
||||
ews.at(i)->setIndex(i);
|
||||
i++;
|
||||
}
|
||||
ews.pop_back();
|
||||
|
|
@ -272,20 +273,26 @@ EndpointHandler* EndpointWidget::getEndpointHandler(){
|
|||
return this->eph;
|
||||
}
|
||||
|
||||
void EndpointWidget::updateFrontIndex(uint64_t index){
|
||||
this->idx = index;
|
||||
this->eph->setFrontVisibilityInfo(EndpointState::ENDPOINT_ACTIVE, index);
|
||||
}
|
||||
|
||||
/*
|
||||
* void EndpointWidget::updateFrontIndex(uint64_t index){
|
||||
* this->idx = index;
|
||||
* }
|
||||
*/
|
||||
|
||||
void EndpointWidget::setIndex(uint64_t idx){
|
||||
this->idx = idx;
|
||||
this->eph->setFrontVisibilityInfo(EndpointState::ENDPOINT_ACTIVE, this->idx);
|
||||
}
|
||||
|
||||
uint64_t EndpointWidget::getIndex(){
|
||||
return idx;
|
||||
}
|
||||
|
||||
std::map<Roles, ExtendedCheckBox*> EndpointWidget::getDefaultRolesWidgets() {
|
||||
return defaultRolesCheckBoxes;
|
||||
}
|
||||
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
||||
// setWindowState(Qt::WindowFullScreen);
|
||||
// setCentralWidget(centralWidget);
|
||||
|
|
@ -335,16 +342,16 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||
*/
|
||||
if (epw->getEndpointHandler()->getId() == endpointId) {
|
||||
//not necessary to keep endpointState flags up to date right now, but updating it will allow for later config files / profiles
|
||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(true);
|
||||
epw->getDefaultRolesWidgets().at(role)->blockSignals(true);
|
||||
epw->getEndpointHandler()->assignRoles(role);
|
||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(false);
|
||||
QCoreApplication::instance()->postEvent(epw->defaultRolesCheckBoxes.at(role), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
epw->getDefaultRolesWidgets().at(role)->blockSignals(false);
|
||||
QCoreApplication::instance()->postEvent(epw->getDefaultRolesWidgets().at(role), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
//epw->defaultRolesCheckBoxes.at(role)->postEnableChange();
|
||||
/*
|
||||
* And were you THE default?
|
||||
*/
|
||||
if (epw->getEndpointHandler()->getRoles() == Roles::ROLE_ALL) {
|
||||
QCoreApplication::instance()->postEvent(epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
QCoreApplication::instance()->postEvent(epw->getDefaultRolesWidgets().at(Roles::ROLE_ALL), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
}
|
||||
/*
|
||||
* Are you the dethroned king?
|
||||
|
|
@ -354,14 +361,14 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||
* And were you THE default up until now?
|
||||
*/
|
||||
if (epw->getEndpointHandler()->getRoles() == Roles::ROLE_ALL) {
|
||||
QCoreApplication::instance()->postEvent(epw->defaultRolesCheckBoxes.at(Roles::ROLE_ALL), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
QCoreApplication::instance()->postEvent(epw->getDefaultRolesWidgets().at(Roles::ROLE_ALL), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
}
|
||||
|
||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(true);
|
||||
epw->getDefaultRolesWidgets().at(role)->blockSignals(true);
|
||||
//Same as before. ini-san will come...
|
||||
epw->getEndpointHandler()->removeRoles(role);
|
||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(false);
|
||||
QCoreApplication::instance()->postEvent(epw->defaultRolesCheckBoxes.at(role), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
epw->getDefaultRolesWidgets().at(role)->blockSignals(false);
|
||||
QCoreApplication::instance()->postEvent(epw->getDefaultRolesWidgets().at(role), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,21 +92,12 @@ public:
|
|||
EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *parent = nullptr);
|
||||
|
||||
EndpointHandler* getEndpointHandler();
|
||||
void updateFrontIndex(uint64_t index);
|
||||
|
||||
std::map<Roles, ExtendedCheckBox*> getDefaultRolesWidgets();
|
||||
|
||||
void setIndex(uint64_t idx);
|
||||
uint64_t getIndex();
|
||||
|
||||
void setVolume(int channel, float volume);
|
||||
|
||||
QCheckBox *muteButton = nullptr;
|
||||
QLabel *mainLabel = nullptr, *leftChannelLabel = nullptr, *rightChannelLabel = nullptr;
|
||||
QSlider *mainSlider = nullptr;
|
||||
std::vector<QSlider*> channelSliders;
|
||||
std::vector<QLabel*> channelLabels;
|
||||
QGridLayout *layout = nullptr;
|
||||
QGridLayout *mainMuteLayout = nullptr;
|
||||
std::map<Roles, ExtendedCheckBox*> defaultRolesCheckBoxes;
|
||||
|
||||
~EndpointWidget();
|
||||
|
||||
//void updateMainVolume(float newValue);
|
||||
|
|
@ -121,6 +112,16 @@ public slots:
|
|||
void updateMute(int checked);
|
||||
|
||||
private:
|
||||
QCheckBox *muteButton = nullptr;
|
||||
QLabel *mainLabel = nullptr, *leftChannelLabel = nullptr, *rightChannelLabel = nullptr;
|
||||
QSlider *mainSlider = nullptr;
|
||||
std::vector<QSlider*> channelSliders;
|
||||
std::vector<QLabel*> channelLabels;
|
||||
QGridLayout *layout = nullptr;
|
||||
QGridLayout *mainMuteLayout = nullptr;
|
||||
std::map<Roles, ExtendedCheckBox*> defaultRolesCheckBoxes;
|
||||
|
||||
|
||||
EndpointHandler* eph;
|
||||
size_t defaultRolesVectorSize = 4;
|
||||
QTimer* timer = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue