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

Method setSampleRate

Default/Audio/AudioWidget.cpp:472–497  ·  view source on GitHub ↗

Setters

Source from the content-addressed store, hash-verified

470
471// Setters
472void
473AudioWidget::setSampleRate(unsigned int rate)
474{
475 if (rate < this->bandwidth) {
476 int i;
477 this->panelConfig->rate = rate;
478 bool add = true;
479 for (i = 0; i < this->ui->sampleRateCombo->count(); ++i) {
480 if (this->ui->sampleRateCombo->itemData(i).value<unsigned int>()
481 == rate) {
482 this->ui->sampleRateCombo->setCurrentIndex(i);
483 add = false;
484 }
485 }
486
487 if (add) {
488 this->ui->sampleRateCombo->addItem(QString::number(rate), QVariant(rate));
489 this->ui->sampleRateCombo->setCurrentIndex(i);
490 }
491
492 // Stay below maximum frequency (fs / 2)
493 this->ui->cutoffSlider->setMaximum(rate / 2);
494
495 m_processor->setSampleRate(rate);
496 }
497}
498
499void
500AudioWidget::setCutOff(SUFLOAT cutoff)

Callers 2

applyConfigMethod · 0.95
onSampleRateChangedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected