fixed overload funcs and connect()

This commit is contained in:
Hane 2023-08-12 19:48:22 +02:00
commit a251b4cb6b
3 changed files with 4 additions and 4 deletions

View file

@ -111,6 +111,6 @@ void OverseerHandler::setEndpointWidgets(std::vector<EndpointWidget*> ews){
}
void OverseerHandler::updateMuteCallback(uint64_t idx, bool muted){
epwMuteFunc f = &EndpointWidget::updateMuteC;
epwMuteFunc f = &EndpointWidget::updateMute;
std::invoke(f, endpointWidgets.at(idx), muted);
}

View file

@ -71,14 +71,14 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent) : QWidget(
connect(mainSlider, &QSlider::valueChanged, [this](int newValue){this->eph->setValue(ENDPOINT_MASTER_VOLUME, newValue); });
connect(leftChannelSlider, &QSlider::valueChanged, [this](int newValue){ this->eph->setValue(ENDPOINT_LEFT_CHANNEL_VOLUME, newValue); this->leftChannelLabel->setText(QString::number(newValue)); });
connect(rightChannelSlider, &QSlider::valueChanged, [this](int newValue){ this->eph->setValue(ENDPOINT_RIGHT_CHANNEL_VOLUME, newValue); this->rightChannelLabel->setText(QString::number(newValue)); });
connect(muteButton, &QCheckBox::stateChanged, this, &EndpointWidget::updateMute);
connect<void(QCheckBox::*)(int), void(EndpointWidget::*)(int)>(muteButton, &QCheckBox::stateChanged, this, (&EndpointWidget::updateMute));
/*
* connect(muteButton, &QPushButton::clicked, [this](bool clicked){ log_debugcpp("cliqui" << clicked << "cloqui"); this->eph->setMute(osh->getGuid()); this->muteButton->setText(this->eph->getMute() ? STRING_UNMUTE : STRING_MUTE); });
*/
log_debugcpp("ENDPOINT_WIDGETED");
}
void EndpointWidget::updateMuteC(bool muted){
void EndpointWidget::updateMute(bool muted){
log_debugcpp("cliqui callboqui cloqui");
this->eph->setMute(osh->getGuid(), muted);
this->muteButton->setChecked(eph->getMute() ? true : false);

View file

@ -68,7 +68,7 @@ public:
QSlider *rightChannelSlider = nullptr;
QGridLayout *layout = nullptr;
QGridLayout *mainMuteLayout = nullptr;
void updateMuteC(bool muted);
void updateMute(bool muted);
//void populateEndpointWidget(EndpointHandler *eph);
//void setEndpointHandlers(std::vector<EndpointHandler*> *ephs);
public slots: