| 428 | } |
| 429 | |
| 430 | void |
| 431 | SourceWidget::applyCurrentAutogain(void) |
| 432 | { |
| 433 | if (this->currentAutoGain != nullptr |
| 434 | && this->ui->gainPresetCheck->isChecked()) { |
| 435 | GainPresetSetting agc; |
| 436 | agc.driver = this->currentAutoGain->getDriver(); |
| 437 | agc.name = this->currentAutoGain->getName(); |
| 438 | agc.value = this->ui->autoGainSlider->value(); |
| 439 | |
| 440 | this->panelConfig->agcSettings[agc.driver] = agc; |
| 441 | |
| 442 | std::vector<GainConfig> cfg = |
| 443 | this->currentAutoGain->translateGain(agc.value); |
| 444 | |
| 445 | for (auto p = cfg.begin(); |
| 446 | p != cfg.end(); |
| 447 | ++p) { |
| 448 | DeviceGain *gain = this->lookupGain(p->name); |
| 449 | if (gain != nullptr) { |
| 450 | gain->setGain(static_cast<float>(p->value)); |
| 451 | this->onGainChanged( |
| 452 | QString::fromStdString(p->name), |
| 453 | static_cast<float>(p->value)); |
| 454 | } |
| 455 | } |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | void |
| 460 | SourceWidget::refreshCurrentAutoGain(std::string const &driver) |
no test coverage detected