Correctly update channel sliders
This commit is contained in:
parent
5bb37eb9fd
commit
9b1c251a3c
2 changed files with 16 additions and 14 deletions
|
|
@ -108,23 +108,24 @@ void EndpointWidget::updateMainVolume(float newValue){
|
|||
|
||||
void EndpointWidget::updateChannelVolume(uint32_t channel, float newValue){
|
||||
this->blockSignals(true);
|
||||
if (channel == (uint32_t)AudioChannel::CHANNEL_MAIN) {
|
||||
if (channel == (uint32_t)AudioChannel::CHANNEL_MAIN)
|
||||
updateMainVolume(newValue);
|
||||
} else {
|
||||
int newVal = newValue * 100;
|
||||
log_debugcpp("chanel: " << channel << " volcallback int: " << newVal);
|
||||
//TODO: Above
|
||||
//this->channelSliders.at(channel)->blockSignals(true);
|
||||
|
||||
int newVal = newValue * 100;
|
||||
log_debugcpp("chanel: " << channel << " volcallback int: " << newVal);
|
||||
|
||||
for (size_t i = 0; i < sizeof(uint32_t) * 8; ++i) {
|
||||
if ((channel << i & 1) && this->channelSliders.at(channel)->value() != newVal) {
|
||||
this->channelSliders.at(channel)->setValue(newVal);
|
||||
this->channelLabels.at(channel)->setText(QString::number((int)(newValue * 100)));
|
||||
}
|
||||
for (size_t i = 0; i < sizeof(uint32_t) * 8 && i < channelSliders.size(); ++i) {
|
||||
if (((channel >> i) & 1) && this->channelSliders.at(i)->value() != newVal) {
|
||||
this->channelSliders.at(i)->blockSignals(true);
|
||||
|
||||
this->channelSliders.at(i)->setValue(newVal);
|
||||
this->channelLabels.at(i)->setText(QString::number((int)(newValue * 100)));
|
||||
|
||||
this->channelSliders.at(i)->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
this->blockSignals(false);
|
||||
//this->channelSliders.at(channel)->blockSignals(false);
|
||||
}
|
||||
|
||||
void EndpointWidget::toggleFrontEvents(bool active){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue