Use 5mbps step size for bitrate slider

This commit is contained in:
Sapphire
2026-02-04 18:26:26 -06:00
parent bb92a5e388
commit 2ec78da729
+5 -4
View File
@@ -761,18 +761,19 @@ void scenes::lobby::gui_settings()
// Bitrate // Bitrate
{ {
const int step = 5;
const int mb = 1'000'000; const int mb = 1'000'000;
const auto current = config.bitrate_bps; const auto current = config.bitrate_bps;
auto val = int(current / mb); auto val = int(current / mb / step);
const auto slider = ImGui::SliderInt( const auto slider = ImGui::SliderInt(
_("Bitrate").append("##bitrate").c_str(), _("Bitrate").append("##bitrate").c_str(),
&val, &val,
1, 1,
config.max_bitrate() / mb, config.max_bitrate() / mb / step,
fmt::format(_F("{}Mbit/s"), val).c_str()); fmt::format(_F("{}Mbit/s"), val * step).c_str());
if (slider) if (slider)
{ {
config.bitrate_bps = val * mb; config.bitrate_bps = val * mb * step;
config.save(); config.save();
} }
imgui_ctx->vibrate_on_hover(); imgui_ctx->vibrate_on_hover();