diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index 29bc08bd2..975be07b8 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -520,10 +520,10 @@ void FurnaceGUI::doAction(int what) { moveCursorBottom(false); break; case GUI_ACTION_PAT_CURSOR_UP_COARSE: - moveCursor(0,-16,false); + moveCursor(0,-editStepCoarse,false); break; case GUI_ACTION_PAT_CURSOR_DOWN_COARSE: - moveCursor(0,16,false); + moveCursor(0,editStepCoarse,false); break; case GUI_ACTION_PAT_SELECTION_UP: moveCursor(0,-MAX(1,settings.scrollStep?editStep:1),true); @@ -550,10 +550,10 @@ void FurnaceGUI::doAction(int what) { moveCursorBottom(true); break; case GUI_ACTION_PAT_SELECTION_UP_COARSE: - moveCursor(0,-16,true); + moveCursor(0,-editStepCoarse,true); break; case GUI_ACTION_PAT_SELECTION_DOWN_COARSE: - moveCursor(0,16,true); + moveCursor(0,editStepCoarse,true); break; case GUI_ACTION_PAT_DELETE: doDelete(); diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index 73564056a..b89c91197 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -691,15 +691,28 @@ void FurnaceGUI::drawEditControls() { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Edit Step"); + if (ImGui::SmallButton(changeCoarse?"Coarse Step":"Edit Step")) { + changeCoarse=!changeCoarse; + } ImGui::TableNextColumn(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (ImGui::InputInt("##EditStep",&editStep,1,1)) { - if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; - if (editStep<0) editStep=0; + if (changeCoarse) { + if (ImGui::InputInt("##CoarseStep",&editStepCoarse,1,1)) { + if (editStepCoarse>=e->curSubSong->patLen) editStepCoarse=e->curSubSong->patLen-1; + if (editStepCoarse<0) editStepCoarse=0; - if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { - nextWindow=GUI_WINDOW_PATTERN; + if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { + nextWindow=GUI_WINDOW_PATTERN; + } + } + } else { + if (ImGui::InputInt("##EditStep",&editStep,1,1)) { + if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; + if (editStep<0) editStep=0; + + if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { + nextWindow=GUI_WINDOW_PATTERN; + } } } @@ -837,15 +850,28 @@ void FurnaceGUI::drawEditControls() { } ImGui::SameLine(); - ImGui::Text("Edit Step"); + if (ImGui::SmallButton(changeCoarse?"Coarse Step":"Edit Step")) { + changeCoarse=!changeCoarse; + } ImGui::SameLine(); ImGui::SetNextItemWidth(96.0f*dpiScale); - if (ImGui::InputInt("##EditStep",&editStep,1,1)) { - if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; - if (editStep<0) editStep=0; + if (changeCoarse) { + if (ImGui::InputInt("##CoarseStep",&editStepCoarse,1,1)) { + if (editStepCoarse>=e->curSubSong->patLen) editStepCoarse=e->curSubSong->patLen-1; + if (editStepCoarse<0) editStepCoarse=0; - if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { - nextWindow=GUI_WINDOW_PATTERN; + if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { + nextWindow=GUI_WINDOW_PATTERN; + } + } + } else { + if (ImGui::InputInt("##EditStep",&editStep,1,1)) { + if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; + if (editStep<0) editStep=0; + + if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { + nextWindow=GUI_WINDOW_PATTERN; + } } } @@ -941,14 +967,27 @@ void FurnaceGUI::drawEditControls() { } } - ImGui::Text("Step"); + if (ImGui::SmallButton(changeCoarse?"Coarse":"Step")) { + changeCoarse=!changeCoarse; + } ImGui::SetNextItemWidth(avail); - if (ImGui::InputInt("##EditStep",&editStep,0,0)) { - if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; - if (editStep<0) editStep=0; + if (changeCoarse) { + if (ImGui::InputInt("##CoarseStep",&editStepCoarse,1,1)) { + if (editStepCoarse>=e->curSubSong->patLen) editStepCoarse=e->curSubSong->patLen-1; + if (editStepCoarse<0) editStepCoarse=0; - if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { - nextWindow=GUI_WINDOW_PATTERN; + if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { + nextWindow=GUI_WINDOW_PATTERN; + } + } + } else { + if (ImGui::InputInt("##EditStep",&editStep,0,0)) { + if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; + if (editStep<0) editStep=0; + + if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { + nextWindow=GUI_WINDOW_PATTERN; + } } } @@ -1096,16 +1135,29 @@ void FurnaceGUI::drawEditControls() { } ImGui::AlignTextToFramePadding(); - ImGui::Text("Step"); + if (ImGui::SmallButton(changeCoarse?"Coarse":"Step")) { + changeCoarse=!changeCoarse; + } ImGui::SameLine(); ImGui::SetCursorPosX(cursor); ImGui::SetNextItemWidth(avail); - if (ImGui::InputInt("##EditStep",&editStep,1,1)) { - if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; - if (editStep<0) editStep=0; + if (changeCoarse) { + if (ImGui::InputInt("##CoarseStep",&editStepCoarse,1,1)) { + if (editStepCoarse>=e->curSubSong->patLen) editStepCoarse=e->curSubSong->patLen-1; + if (editStepCoarse<0) editStepCoarse=0; - if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { - nextWindow=GUI_WINDOW_PATTERN; + if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { + nextWindow=GUI_WINDOW_PATTERN; + } + } + } else { + if (ImGui::InputInt("##EditStep",&editStep,1,1)) { + if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; + if (editStep<0) editStep=0; + + if (settings.insFocusesPattern && !ImGui::IsItemActive() && patternOpen) { + nextWindow=GUI_WINDOW_PATTERN; + } } } ImGui::NextColumn(); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index d4330e15f..4617f0878 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -7484,6 +7484,7 @@ FurnaceGUI::FurnaceGUI(): snesFilterHex(false), modTableHex(false), displayEditString(false), + changeCoarse(false), mobileEdit(false), killGraphics(false), safeMode(false), @@ -7573,6 +7574,7 @@ FurnaceGUI::FurnaceGUI(): prevIns(0), oldRow(0), editStep(1), + editStepCoarse(16), exportLoops(0), soloChan(-1), orderEditMode(0), diff --git a/src/gui/gui.h b/src/gui/gui.h index 7bdfd02b0..f6580ed03 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1552,6 +1552,7 @@ class FurnaceGUI { bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu; bool displayNew, displayExport, displayPalette, fullScreen, preserveChanPos, sysDupCloneChannels, sysDupEnd, wantScrollList, noteInputPoly, notifyWaveChange; bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString; + bool changeCoarse; bool mobileEdit; bool killGraphics; bool safeMode; @@ -2145,7 +2146,7 @@ class FurnaceGUI { int pendingLayoutImportStep; FixedQueue pendingLayoutImportReopen; - int curIns, curWave, curSample, curOctave, curOrder, playOrder, prevIns, oldRow, editStep, exportLoops, soloChan, orderEditMode, orderCursor; + int curIns, curWave, curSample, curOctave, curOrder, playOrder, prevIns, oldRow, editStep, editStepCoarse, exportLoops, soloChan, orderEditMode, orderCursor; int loopOrder, loopRow, loopEnd, isClipping, newSongCategory, latchTarget; int wheelX, wheelY, dragSourceX, dragSourceXFine, dragSourceY, dragDestinationX, dragDestinationXFine, dragDestinationY, oldBeat, oldBar; int curGroove, exitDisabledTimer;