mute city boton momento
This commit is contained in:
parent
6213f9250d
commit
308a0486b6
7 changed files with 50 additions and 7 deletions
|
|
@ -8,6 +8,7 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent) : QWidget(
|
|||
log_debugcpp("olaW");
|
||||
if (parent == nullptr) { log_debugcpp("owo?"); }
|
||||
|
||||
muteButton = new QPushButton();
|
||||
mainLabel = new QLabel(eph->getName());
|
||||
leftChannelLabel = new QLabel("88");
|
||||
rightChannelLabel = new QLabel("77");
|
||||
|
|
@ -15,9 +16,9 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent) : QWidget(
|
|||
leftChannelSlider = new QSlider(Qt::Horizontal);
|
||||
rightChannelSlider = new QSlider(Qt::Horizontal);
|
||||
|
||||
muteButton->setStyleSheet("background-color: #A3C1DA; color: red");
|
||||
mainSlider->setFocusPolicy(Qt::StrongFocus);
|
||||
mainSlider->setTickPosition(QSlider::TicksBothSides);
|
||||
|
||||
mainSlider->setTickInterval(5);
|
||||
mainSlider->setSingleStep(1);
|
||||
mainSlider->setRange(0,100);
|
||||
|
|
@ -27,7 +28,8 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent) : QWidget(
|
|||
rightChannelSlider->setTickInterval(5);
|
||||
rightChannelSlider->setSingleStep(1);
|
||||
rightChannelSlider->setRange(0,100);
|
||||
|
||||
|
||||
muteButton->setText(eph->getMute() ? STRING_UNMUTE : STRING_MUTE);
|
||||
float volume = eph->getVolume(ENDPOINT_MASTER_VOLUME) * 100;
|
||||
mainSlider->setValue((int)volume);
|
||||
volume = eph->getVolume(ENDPOINT_LEFT_CHANNEL_VOLUME) * 100;
|
||||
|
|
@ -38,7 +40,10 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent) : QWidget(
|
|||
rightChannelLabel->setText(QString::number(volume));
|
||||
log_debugcpp("ENDPOINT SET WITH VOLUME " << volume);
|
||||
|
||||
layout->addWidget(mainLabel, 0, 0);
|
||||
mainMuteLayout = new QGridLayout();
|
||||
layout->addLayout(mainMuteLayout, 0, 0);
|
||||
mainMuteLayout->addWidget(mainLabel, 0, 0);
|
||||
mainMuteLayout->addWidget(muteButton, 0, 1);
|
||||
layout->addWidget(mainSlider, 0, 1);
|
||||
layout->addWidget(leftChannelSlider, 1, 0);
|
||||
layout->addWidget(leftChannelLabel, 2, 0);
|
||||
|
|
@ -53,6 +58,7 @@ 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, &QPushButton::clicked, [this](bool clicked){ log_debugcpp("cliqui" << clicked << "cloqui"); this->eph->setMute(); this->muteButton->setText(this->eph->getMute() ? STRING_UNMUTE : STRING_MUTE); });
|
||||
log_debugcpp("ENDPOINT_WIDGETED");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue