From 26e424fe9ff434ff429ffc442260cdf8bb9e6471 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 14 Jan 2023 13:51:02 -0500 Subject: [PATCH] GUI: use DeltaTime for soloTimeout issue #846 --- src/gui/gui.cpp | 9 +++++++-- src/gui/gui.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 1ec735f1d..e8fb31286 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5148,7 +5148,12 @@ bool FurnaceGUI::loop() { renderTimeDelta=renderTimeEnd-renderTimeBegin; eventTimeDelta=eventTimeEnd-eventTimeBegin; - if (--soloTimeout<0) soloTimeout=0; + soloTimeout-=ImGui::GetIO().DeltaTime*60.0f; + if (soloTimeout<0) { + soloTimeout=0; + } else { + WAKE_UP; + } wheelX=0; wheelY=0; @@ -5784,7 +5789,6 @@ FurnaceGUI::FurnaceGUI(): editStep(1), exportLoops(0), soloChan(-1), - soloTimeout(0), orderEditMode(0), orderCursor(-1), loopOrder(-1), @@ -5803,6 +5807,7 @@ FurnaceGUI::FurnaceGUI(): dragDestinationY(0), oldBeat(-1), oldBar(-1), + soloTimeout(0.0f), exportFadeOut(5.0), editControlsOpen(true), ordersOpen(true), diff --git a/src/gui/gui.h b/src/gui/gui.h index 15319f747..750d46f59 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1447,9 +1447,10 @@ class FurnaceGUI { DivInstrument* prevInsData; - int curIns, curWave, curSample, curOctave, curOrder, prevIns, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan, soloTimeout, orderEditMode, orderCursor; + int curIns, curWave, curSample, curOctave, curOrder, prevIns, oldRow, oldOrder, oldOrder1, editStep, exportLoops, soloChan,orderEditMode, orderCursor; int loopOrder, loopRow, loopEnd, isClipping, extraChannelButtons, patNameTarget, newSongCategory, latchTarget; int wheelX, wheelY, dragSourceX, dragSourceY, dragDestinationX, dragDestinationY, oldBeat, oldBar; + float soloTimeout; double exportFadeOut;