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