GUI: finally add ability to change coarse editstep

This commit is contained in:
tildearrow 2024-04-26 12:53:33 -05:00
parent a42d6605d5
commit 7f354705e3
4 changed files with 84 additions and 29 deletions

View file

@ -520,10 +520,10 @@ void FurnaceGUI::doAction(int what) {
moveCursorBottom(false); moveCursorBottom(false);
break; break;
case GUI_ACTION_PAT_CURSOR_UP_COARSE: case GUI_ACTION_PAT_CURSOR_UP_COARSE:
moveCursor(0,-16,false); moveCursor(0,-editStepCoarse,false);
break; break;
case GUI_ACTION_PAT_CURSOR_DOWN_COARSE: case GUI_ACTION_PAT_CURSOR_DOWN_COARSE:
moveCursor(0,16,false); moveCursor(0,editStepCoarse,false);
break; break;
case GUI_ACTION_PAT_SELECTION_UP: case GUI_ACTION_PAT_SELECTION_UP:
moveCursor(0,-MAX(1,settings.scrollStep?editStep:1),true); moveCursor(0,-MAX(1,settings.scrollStep?editStep:1),true);
@ -550,10 +550,10 @@ void FurnaceGUI::doAction(int what) {
moveCursorBottom(true); moveCursorBottom(true);
break; break;
case GUI_ACTION_PAT_SELECTION_UP_COARSE: case GUI_ACTION_PAT_SELECTION_UP_COARSE:
moveCursor(0,-16,true); moveCursor(0,-editStepCoarse,true);
break; break;
case GUI_ACTION_PAT_SELECTION_DOWN_COARSE: case GUI_ACTION_PAT_SELECTION_DOWN_COARSE:
moveCursor(0,16,true); moveCursor(0,editStepCoarse,true);
break; break;
case GUI_ACTION_PAT_DELETE: case GUI_ACTION_PAT_DELETE:
doDelete(); doDelete();

View file

@ -691,9 +691,21 @@ void FurnaceGUI::drawEditControls() {
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding(); ImGui::AlignTextToFramePadding();
ImGui::Text("Edit Step"); if (ImGui::SmallButton(changeCoarse?"Coarse Step":"Edit Step")) {
changeCoarse=!changeCoarse;
}
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
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;
}
}
} else {
if (ImGui::InputInt("##EditStep",&editStep,1,1)) { if (ImGui::InputInt("##EditStep",&editStep,1,1)) {
if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1;
if (editStep<0) editStep=0; if (editStep<0) editStep=0;
@ -702,6 +714,7 @@ void FurnaceGUI::drawEditControls() {
nextWindow=GUI_WINDOW_PATTERN; nextWindow=GUI_WINDOW_PATTERN;
} }
} }
}
ImGui::EndTable(); ImGui::EndTable();
} }
@ -837,9 +850,21 @@ void FurnaceGUI::drawEditControls() {
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("Edit Step"); if (ImGui::SmallButton(changeCoarse?"Coarse Step":"Edit Step")) {
changeCoarse=!changeCoarse;
}
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetNextItemWidth(96.0f*dpiScale); ImGui::SetNextItemWidth(96.0f*dpiScale);
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;
}
}
} else {
if (ImGui::InputInt("##EditStep",&editStep,1,1)) { if (ImGui::InputInt("##EditStep",&editStep,1,1)) {
if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1;
if (editStep<0) editStep=0; if (editStep<0) editStep=0;
@ -848,6 +873,7 @@ void FurnaceGUI::drawEditControls() {
nextWindow=GUI_WINDOW_PATTERN; nextWindow=GUI_WINDOW_PATTERN;
} }
} }
}
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("Follow"); ImGui::Text("Follow");
@ -941,8 +967,20 @@ void FurnaceGUI::drawEditControls() {
} }
} }
ImGui::Text("Step"); if (ImGui::SmallButton(changeCoarse?"Coarse":"Step")) {
changeCoarse=!changeCoarse;
}
ImGui::SetNextItemWidth(avail); ImGui::SetNextItemWidth(avail);
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;
}
}
} else {
if (ImGui::InputInt("##EditStep",&editStep,0,0)) { if (ImGui::InputInt("##EditStep",&editStep,0,0)) {
if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1;
if (editStep<0) editStep=0; if (editStep<0) editStep=0;
@ -951,6 +989,7 @@ void FurnaceGUI::drawEditControls() {
nextWindow=GUI_WINDOW_PATTERN; nextWindow=GUI_WINDOW_PATTERN;
} }
} }
}
ImGui::Text("Foll."); ImGui::Text("Foll.");
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
@ -1096,10 +1135,22 @@ void FurnaceGUI::drawEditControls() {
} }
ImGui::AlignTextToFramePadding(); ImGui::AlignTextToFramePadding();
ImGui::Text("Step"); if (ImGui::SmallButton(changeCoarse?"Coarse":"Step")) {
changeCoarse=!changeCoarse;
}
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetCursorPosX(cursor); ImGui::SetCursorPosX(cursor);
ImGui::SetNextItemWidth(avail); ImGui::SetNextItemWidth(avail);
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;
}
}
} else {
if (ImGui::InputInt("##EditStep",&editStep,1,1)) { if (ImGui::InputInt("##EditStep",&editStep,1,1)) {
if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1; if (editStep>=e->curSubSong->patLen) editStep=e->curSubSong->patLen-1;
if (editStep<0) editStep=0; if (editStep<0) editStep=0;
@ -1108,6 +1159,7 @@ void FurnaceGUI::drawEditControls() {
nextWindow=GUI_WINDOW_PATTERN; nextWindow=GUI_WINDOW_PATTERN;
} }
} }
}
ImGui::NextColumn(); ImGui::NextColumn();
unimportant(ImGui::Checkbox("Follow orders",&followOrders)); unimportant(ImGui::Checkbox("Follow orders",&followOrders));

View file

@ -7484,6 +7484,7 @@ FurnaceGUI::FurnaceGUI():
snesFilterHex(false), snesFilterHex(false),
modTableHex(false), modTableHex(false),
displayEditString(false), displayEditString(false),
changeCoarse(false),
mobileEdit(false), mobileEdit(false),
killGraphics(false), killGraphics(false),
safeMode(false), safeMode(false),
@ -7573,6 +7574,7 @@ FurnaceGUI::FurnaceGUI():
prevIns(0), prevIns(0),
oldRow(0), oldRow(0),
editStep(1), editStep(1),
editStepCoarse(16),
exportLoops(0), exportLoops(0),
soloChan(-1), soloChan(-1),
orderEditMode(0), orderEditMode(0),

View file

@ -1552,6 +1552,7 @@ class FurnaceGUI {
bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu; bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu;
bool displayNew, displayExport, displayPalette, fullScreen, preserveChanPos, sysDupCloneChannels, sysDupEnd, wantScrollList, noteInputPoly, notifyWaveChange; bool displayNew, displayExport, displayPalette, fullScreen, preserveChanPos, sysDupCloneChannels, sysDupEnd, wantScrollList, noteInputPoly, notifyWaveChange;
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString; bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString;
bool changeCoarse;
bool mobileEdit; bool mobileEdit;
bool killGraphics; bool killGraphics;
bool safeMode; bool safeMode;
@ -2145,7 +2146,7 @@ class FurnaceGUI {
int pendingLayoutImportStep; int pendingLayoutImportStep;
FixedQueue<bool*,64> pendingLayoutImportReopen; FixedQueue<bool*,64> 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 loopOrder, loopRow, loopEnd, isClipping, newSongCategory, latchTarget;
int wheelX, wheelY, dragSourceX, dragSourceXFine, dragSourceY, dragDestinationX, dragDestinationXFine, dragDestinationY, oldBeat, oldBar; int wheelX, wheelY, dragSourceX, dragSourceXFine, dragSourceY, dragDestinationX, dragDestinationXFine, dragDestinationY, oldBeat, oldBar;
int curGroove, exitDisabledTimer; int curGroove, exitDisabledTimer;