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));
|
//memcpy(osh->callbackInfo[idx]->caller, osh->getGuid(), sizeof(NGuid));
|
||||||
|
|
||||||
//TODO: el default = objcopy frees?
|
//TODO: el default = objcopy frees?
|
||||||
|
//Todo: like fr pregunta
|
||||||
eph->getCallbackInfo()->caller = osh->getGuid();
|
eph->getCallbackInfo()->caller = osh->getGuid();
|
||||||
mainSlider->blockSignals(false);
|
mainSlider->blockSignals(false);
|
||||||
muteButton->blockSignals(false);
|
muteButton->blockSignals(false);
|
||||||
|
|
@ -213,7 +214,7 @@ void MainWindow::removeEndpointWidget(EndpointWidgetEvent<uint64_t>* ev){
|
||||||
//delete ews.at(index);
|
//delete ews.at(index);
|
||||||
while ((i + 1) < ews.size()) {
|
while ((i + 1) < ews.size()) {
|
||||||
ews.at(i) = ews.at(i + 1);
|
ews.at(i) = ews.at(i + 1);
|
||||||
ews.at(i)->updateFrontIndex(i);
|
ews.at(i)->setIndex(i);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
ews.pop_back();
|
ews.pop_back();
|
||||||
|
|
@ -272,20 +273,26 @@ EndpointHandler* EndpointWidget::getEndpointHandler(){
|
||||||
return this->eph;
|
return this->eph;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EndpointWidget::updateFrontIndex(uint64_t index){
|
/*
|
||||||
this->idx = index;
|
* void EndpointWidget::updateFrontIndex(uint64_t index){
|
||||||
this->eph->setFrontVisibilityInfo(EndpointState::ENDPOINT_ACTIVE, index);
|
* this->idx = index;
|
||||||
}
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
void EndpointWidget::setIndex(uint64_t idx){
|
void EndpointWidget::setIndex(uint64_t idx){
|
||||||
this->idx = idx;
|
this->idx = idx;
|
||||||
|
this->eph->setFrontVisibilityInfo(EndpointState::ENDPOINT_ACTIVE, this->idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t EndpointWidget::getIndex(){
|
uint64_t EndpointWidget::getIndex(){
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::map<Roles, ExtendedCheckBox*> EndpointWidget::getDefaultRolesWidgets() {
|
||||||
|
return defaultRolesCheckBoxes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
||||||
// setWindowState(Qt::WindowFullScreen);
|
// setWindowState(Qt::WindowFullScreen);
|
||||||
// setCentralWidget(centralWidget);
|
// setCentralWidget(centralWidget);
|
||||||
|
|
@ -335,16 +342,16 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
||||||
*/
|
*/
|
||||||
if (epw->getEndpointHandler()->getId() == endpointId) {
|
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
|
//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->getEndpointHandler()->assignRoles(role);
|
||||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(false);
|
epw->getDefaultRolesWidgets().at(role)->blockSignals(false);
|
||||||
QCoreApplication::instance()->postEvent(epw->defaultRolesCheckBoxes.at(role), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
QCoreApplication::instance()->postEvent(epw->getDefaultRolesWidgets().at(role), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||||
//epw->defaultRolesCheckBoxes.at(role)->postEnableChange();
|
//epw->defaultRolesCheckBoxes.at(role)->postEnableChange();
|
||||||
/*
|
/*
|
||||||
* And were you THE default?
|
* And were you THE default?
|
||||||
*/
|
*/
|
||||||
if (epw->getEndpointHandler()->getRoles() == Roles::ROLE_ALL) {
|
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?
|
* Are you the dethroned king?
|
||||||
|
|
@ -354,14 +361,14 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
||||||
* And were you THE default up until now?
|
* And were you THE default up until now?
|
||||||
*/
|
*/
|
||||||
if (epw->getEndpointHandler()->getRoles() == Roles::ROLE_ALL) {
|
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...
|
//Same as before. ini-san will come...
|
||||||
epw->getEndpointHandler()->removeRoles(role);
|
epw->getEndpointHandler()->removeRoles(role);
|
||||||
epw->defaultRolesCheckBoxes.at(role)->blockSignals(false);
|
epw->getDefaultRolesWidgets().at(role)->blockSignals(false);
|
||||||
QCoreApplication::instance()->postEvent(epw->defaultRolesCheckBoxes.at(role), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
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);
|
EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *parent = nullptr);
|
||||||
|
|
||||||
EndpointHandler* getEndpointHandler();
|
EndpointHandler* getEndpointHandler();
|
||||||
void updateFrontIndex(uint64_t index);
|
std::map<Roles, ExtendedCheckBox*> getDefaultRolesWidgets();
|
||||||
|
|
||||||
void setIndex(uint64_t idx);
|
void setIndex(uint64_t idx);
|
||||||
uint64_t getIndex();
|
uint64_t getIndex();
|
||||||
|
|
||||||
void setVolume(int channel, float volume);
|
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();
|
~EndpointWidget();
|
||||||
|
|
||||||
//void updateMainVolume(float newValue);
|
//void updateMainVolume(float newValue);
|
||||||
|
|
@ -121,6 +112,16 @@ public slots:
|
||||||
void updateMute(int checked);
|
void updateMute(int checked);
|
||||||
|
|
||||||
private:
|
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;
|
EndpointHandler* eph;
|
||||||
size_t defaultRolesVectorSize = 4;
|
size_t defaultRolesVectorSize = 4;
|
||||||
QTimer* timer = nullptr;
|
QTimer* timer = nullptr;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue