From ff1aad8959f26c8c09c9a897aef1736aa2a09e4a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 21 Nov 2025 20:16:07 -0500 Subject: [PATCH] limit the maximum speed too high and it will never seek --- src/gui/speed.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/speed.cpp b/src/gui/speed.cpp index 16b216930..bf868082e 100644 --- a/src/gui/speed.cpp +++ b/src/gui/speed.cpp @@ -136,9 +136,11 @@ void FurnaceGUI::drawSpeed(bool asChild) { intVersion[0]=6; } if (intVersionLen>16) intVersionLen=16; - e->lockEngine([this,intVersion,intVersionLen]() { + e->lockEngine([this,&intVersion,intVersionLen]() { e->curSubSong->speeds.len=intVersionLen; for (int i=0; i<16; i++) { + if (intVersion[i]<1) intVersion[i]=1; + if (intVersion[i]>512) intVersion[i]=512; e->curSubSong->speeds.val[i]=intVersion[i]; } }); @@ -155,6 +157,7 @@ void FurnaceGUI::drawSpeed(bool asChild) { ImGui::SetNextItemWidth(halfAvail); if (ImGui::InputScalar("##Speed1",ImGuiDataType_U16,&e->curSubSong->speeds.val[0],&_ONE,&_THREE)) { MARK_MODIFIED if (e->curSubSong->speeds.val[0]<1) e->curSubSong->speeds.val[0]=1; + if (e->curSubSong->speeds.val[0]>512) e->curSubSong->speeds.val[0]=512; if (e->isPlaying()) play(); recalcTimestamps=true; } @@ -163,6 +166,7 @@ void FurnaceGUI::drawSpeed(bool asChild) { ImGui::SetNextItemWidth(halfAvail); if (ImGui::InputScalar("##Speed2",ImGuiDataType_U16,&e->curSubSong->speeds.val[1],&_ONE,&_THREE)) { MARK_MODIFIED if (e->curSubSong->speeds.val[1]<1) e->curSubSong->speeds.val[1]=1; + if (e->curSubSong->speeds.val[1]>512) e->curSubSong->speeds.val[1]=512; if (e->isPlaying()) play(); recalcTimestamps=true; }