add lower limit to network source samplerate

This commit is contained in:
AlexandreRouma 2024-11-06 20:54:01 +01:00
parent a728403a3f
commit 7f002f6276

View File

@ -250,7 +250,10 @@ private:
// Samplerate selector
SmGui::LeftLabel("Samplerate");
SmGui::FillWidth();
SmGui::InputInt(("##network_source_sr_" + _this->name).c_str(), &_this->tempSamplerate);
if (SmGui::InputInt(("##network_source_sr_" + _this->name).c_str(), &_this->tempSamplerate)) {
// Prevent silly values from silly users
_this->tempSamplerate = std::max<int>(_this->tempSamplerate, 1000);
}
bool applyEn = (!_this->running && _this->tempSamplerate != _this->samplerate);
if (!applyEn) { SmGui::BeginDisabled(); }
SmGui::FillWidth();