diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index c7b5ac9e0..c32b53112 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -2598,6 +2598,8 @@ void DivEngine::stepOne(int row) { } stepPlay=2; ticks=1; + prevOrder=curOrder; + prevRow=curRow; BUSY_END; } @@ -4320,9 +4322,7 @@ void DivEngine::autoNoteOn(int ch, int ins, int note, int vol) { void DivEngine::autoNoteOff(int ch, int note, int vol) { if (!playing) { - reset(); - freelance=true; - playing=true; + return; } //if (ch<0 || ch>=chans) return; for (int i=0; istepOne(cursor.y); + pendingStepUpdate=1; break; case GUI_ACTION_OCTAVE_UP: if (++curOctave>7) { diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index e3e843481..099ff7e25 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -374,7 +374,7 @@ void FurnaceGUI::drawMobileControls() { if (portrait) ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) { e->stepOne(cursor.y); - pendingStepUpdate=true; + pendingStepUpdate=1; } bool repeatPattern=e->getRepeatPattern(); @@ -730,7 +730,7 @@ void FurnaceGUI::drawEditControls() { ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) { e->stepOne(cursor.y); - pendingStepUpdate=true; + pendingStepUpdate=1; } if (ImGui::IsItemHovered()) { ImGui::SetTooltip("Step one row"); @@ -770,7 +770,7 @@ void FurnaceGUI::drawEditControls() { ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) { e->stepOne(cursor.y); - pendingStepUpdate=true; + pendingStepUpdate=1; } if (ImGui::IsItemHovered()) { ImGui::SetTooltip("Step one row"); @@ -875,7 +875,7 @@ void FurnaceGUI::drawEditControls() { } if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne",buttonSize)) { e->stepOne(cursor.y); - pendingStepUpdate=true; + pendingStepUpdate=1; } if (ImGui::IsItemHovered()) { ImGui::SetTooltip("Step one row"); @@ -1009,7 +1009,7 @@ void FurnaceGUI::drawEditControls() { ImGui::SameLine(); if (ImGui::Button(ICON_FA_ARROW_DOWN "##StepOne")) { e->stepOne(cursor.y); - pendingStepUpdate=true; + pendingStepUpdate=1; } if (ImGui::IsItemHovered()) { ImGui::SetTooltip("Step one row"); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 6437ecab7..d6e689116 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -2419,7 +2419,7 @@ void FurnaceGUI::processDrags(int dragX, int dragY) { if (y>waveDragMax) y=waveDragMax; if (ynotifyWaveChange(curWave); + notifyWaveChange=true; MARK_MODIFIED; } } @@ -3746,6 +3746,11 @@ bool FurnaceGUI::loop() { midiLock.unlock(); } + if (notifyWaveChange) { + notifyWaveChange=false; + e->notifyWaveChange(curWave); + } + eventTimeEnd=SDL_GetPerformanceCounter(); if (SDL_GetWindowFlags(sdlWin)&SDL_WINDOW_MINIMIZED) { @@ -6718,6 +6723,7 @@ FurnaceGUI::FurnaceGUI(): preserveChanPos(false), wantScrollList(false), noteInputPoly(true), + notifyWaveChange(false), displayPendingIns(false), pendingInsSingle(false), displayPendingRawSample(false), @@ -7015,7 +7021,7 @@ FurnaceGUI::FurnaceGUI(): fadeMode(false), randomMode(false), haveHitBounds(false), - pendingStepUpdate(false), + pendingStepUpdate(0), oldOrdersLen(0), sampleZoom(1.0), prevSampleZoom(1.0), diff --git a/src/gui/gui.h b/src/gui/gui.h index 83c5a380a..c87b60a1d 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1310,7 +1310,7 @@ class FurnaceGUI { bool vgmExportDirectStream, displayInsTypeList; bool portrait, injectBackUp, mobileMenuOpen, warnColorPushed; bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu; - bool displayNew, fullScreen, preserveChanPos, wantScrollList, noteInputPoly; + bool displayNew, fullScreen, preserveChanPos, wantScrollList, noteInputPoly, notifyWaveChange; bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString; bool mobileEdit; bool killGraphics; @@ -1913,7 +1913,8 @@ class FurnaceGUI { int dummyRows, demandX; int transposeAmount, randomizeMin, randomizeMax, fadeMin, fadeMax, collapseAmount; float scaleMax; - bool fadeMode, randomMode, haveHitBounds, pendingStepUpdate; + bool fadeMode, randomMode, haveHitBounds; + signed char pendingStepUpdate; int oldOrdersLen; DivOrders oldOrders; diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index 72d953b7a..1deec9dc6 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -446,7 +446,7 @@ void FurnaceGUI::drawPattern() { float lineHeight=(ImGui::GetTextLineHeight()+2*dpiScale); int curRow=e->getRow(); if (e->isPlaying() && followPattern && (!e->isStepping() || pendingStepUpdate)) updateScroll(curRow); - pendingStepUpdate=false; + if (--pendingStepUpdate<0) pendingStepUpdate=0; if (nextScroll>-0.5f) { ImGui::SetScrollY(nextScroll); nextScroll=-1.0f;