Skip to content

Commit

Permalink
add lower limit to network source samplerate
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreRouma committed Nov 6, 2024
1 parent a728403 commit 7f002f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source_modules/network_source/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ class NetworkSourceModule : public ModuleManager::Instance {
// 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();
Expand Down

0 comments on commit 7f002f6

Please sign in to comment.