MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / applyCurrentAutogain

Method applyCurrentAutogain

Default/Source/SourceWidget.cpp:430–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430void
431SourceWidget::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
459void
460SourceWidget::refreshCurrentAutoGain(std::string const &driver)

Callers 4

onChangeAutoGainMethod · 0.95
onToggleAutoGainMethod · 0.95
onSelectAutoGainMethod · 0.95

Calls 9

lookupGainMethod · 0.95
onGainChangedMethod · 0.95
valueMethod · 0.80
translateGainMethod · 0.80
getDriverMethod · 0.45
getNameMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setGainMethod · 0.45

Tested by

no test coverage detected