diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index 882506163..5a5af9db7 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -259,7 +259,7 @@ void FurnaceGUI::makeUndo(ActionType action, UndoRegion region) { if (undoHist.size()>settings.maxUndoSteps) undoHist.pop_front(); } if (shallWalk) { - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); } // garbage collection @@ -2119,7 +2119,7 @@ void FurnaceGUI::doUndo() { } } } - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); break; } @@ -2197,7 +2197,7 @@ void FurnaceGUI::doRedo() { } } } - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); break; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 1e20e46ce..a175c85c0 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1278,7 +1278,7 @@ void FurnaceGUI::play(int row) { chanOscChan[i].pitch=0.0f; } memset(chanOscBright,0,DIV_MAX_CHANS*sizeof(float)); - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); memset(lastIns,-1,sizeof(int)*DIV_MAX_CHANS); if (wasFollowing) { followPattern=true; @@ -1309,7 +1309,7 @@ void FurnaceGUI::setOrder(unsigned char order, bool forced) { void FurnaceGUI::stop() { bool wasPlaying=e->isPlaying(); - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); e->stop(); curNibble=false; orderNibble=false; @@ -1538,7 +1538,7 @@ void FurnaceGUI::orderInput(int num) { } } } - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); makeUndo(GUI_UNDO_CHANGE_ORDER); } } @@ -2559,7 +2559,7 @@ int FurnaceGUI::load(String path) { } pushRecentFile(path); // walk song - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); // do not auto-play a backup if (path.find(backupPath)!=0) { if (settings.playOnLoad==2 || (settings.playOnLoad==1 && wasPlaying)) { @@ -2717,10 +2717,7 @@ int FurnaceGUI::loadStream(String path) { void FurnaceGUI::exportAudio(String path, DivAudioExportModes mode) { - int loopOrder=0; - int loopRow=0; - int loopEnd=0; - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); // TODO: fix! songFadeoutSectionLength=0; @@ -8711,9 +8708,6 @@ FurnaceGUI::FurnaceGUI(): soloChan(-1), orderEditMode(0), orderCursor(-1), - loopOrder(-1), - loopRow(-1), - loopEnd(-1), isClipping(0), newSongCategory(0), latchTarget(0), diff --git a/src/gui/gui.h b/src/gui/gui.h index 88232b8e2..60cc32da9 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2377,7 +2377,7 @@ class FurnaceGUI { FixedQueue pendingLayoutImportReopen; int curIns, curWave, curSample, curOctave, curOrder, playOrder, prevIns, oldRow, editStep, editStepCoarse, soloChan, orderEditMode, orderCursor; - int loopOrder, loopRow, loopEnd, isClipping, newSongCategory, latchTarget, undoOrder; + int isClipping, newSongCategory, latchTarget, undoOrder; int wheelX, wheelY, dragSourceX, dragSourceXFine, dragSourceY, dragSourceOrder, dragDestinationX, dragDestinationXFine, dragDestinationY, dragDestinationOrder, oldBeat, oldBar; int curGroove, exitDisabledTimer; int curPaletteChoice, curPaletteType; diff --git a/src/gui/orders.cpp b/src/gui/orders.cpp index ed4a823d9..2cd8acb7a 100644 --- a/src/gui/orders.cpp +++ b/src/gui/orders.cpp @@ -344,7 +344,7 @@ void FurnaceGUI::drawOrders() { ImGui::PopClipRect(); } ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_ORDER_ROW_INDEX]); - bool highlightLoop=(i>=loopOrder && i<=loopEnd); + bool highlightLoop=(i>=e->curSubSong->ts.loopStart.order && i<=e->curSubSong->ts.loopEnd.order && e->curSubSong->ts.isLoopDefined); if (highlightLoop) ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg,ImGui::GetColorU32(uiColors[GUI_COLOR_SONG_LOOP])); if (settings.orderRowsBase==1) { snprintf(selID,4096,"%.2X##O_S%.2x",i,i); @@ -392,7 +392,7 @@ void FurnaceGUI::drawOrders() { if (e->curOrders->ord[j][i]<(unsigned char)(DIV_MAX_PATTERNS-1)) e->curOrders->ord[j][i]++; } }); - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); makeUndo(GUI_UNDO_CHANGE_ORDER); } else { orderCursor=j; @@ -400,7 +400,7 @@ void FurnaceGUI::drawOrders() { } } else { setOrder(i); - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); if (orderEditMode!=0) { orderCursor=j; curNibble=false; @@ -441,7 +441,7 @@ void FurnaceGUI::drawOrders() { if (e->curOrders->ord[j][i]>0) e->curOrders->ord[j][i]--; } }); - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); makeUndo(GUI_UNDO_CHANGE_ORDER); } else { orderCursor=j; @@ -449,7 +449,7 @@ void FurnaceGUI::drawOrders() { } } else { setOrder(i); - e->walkSong(loopOrder,loopRow,loopEnd); + e->calcSongTimestamps(); if (orderEditMode!=0) { orderCursor=j; curNibble=false;