Merge pull request #1015 from ZoomTen/move-cursor-with-order

Option to move the cursor along with order upon moving order up/down
This commit is contained in:
tildearrow 2023-03-08 02:24:28 -05:00 committed by GitHub
commit 58f73d6284
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 0 deletions

View File

@ -1514,11 +1514,17 @@ void FurnaceGUI::doAction(int what) {
case GUI_ACTION_ORDERS_MOVE_UP:
prepareUndo(GUI_UNDO_CHANGE_ORDER);
e->moveOrderUp(curOrder);
if (settings.cursorFollowsOrder) {
e->setOrder(curOrder);
}
makeUndo(GUI_UNDO_CHANGE_ORDER);
break;
case GUI_ACTION_ORDERS_MOVE_DOWN:
prepareUndo(GUI_UNDO_CHANGE_ORDER);
e->moveOrderDown(curOrder);
if (settings.cursorFollowsOrder) {
e->setOrder(curOrder);
}
makeUndo(GUI_UNDO_CHANGE_ORDER);
break;
case GUI_ACTION_ORDERS_REPLAY:

View File

@ -1343,6 +1343,7 @@ class FurnaceGUI {
int doubleClickColumn;
int blankIns;
int dragMovesSelection;
int cursorFollowsOrder;
int unsignedDetune;
int noThreadedInput;
int saveWindowPos;
@ -1483,6 +1484,7 @@ class FurnaceGUI {
doubleClickColumn(1),
blankIns(0),
dragMovesSelection(1),
cursorFollowsOrder(1),
unsignedDetune(0),
noThreadedInput(0),
clampSamples(0),

View File

@ -652,6 +652,14 @@ void FurnaceGUI::drawSettings() {
settings.saveUnusedPatterns=saveUnusedPatternsB;
}
bool cursorFollowsOrderB=settings.cursorFollowsOrder;
if (ImGui::Checkbox("Cursor follows current order when moving it",&cursorFollowsOrderB)) {
settings.cursorFollowsOrder=cursorFollowsOrderB;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("applies when playback is stopped.");
}
ImGui::Text("Audio export loop/fade out time:");
if (ImGui::RadioButton("Set to these values on start-up:##fot0",settings.persistFadeOut==0)) {
settings.persistFadeOut=0;
@ -2610,6 +2618,7 @@ void FurnaceGUI::syncSettings() {
settings.oneDigitEffects=e->getConfInt("oneDigitEffects",0);
settings.disableFadeIn=e->getConfInt("disableFadeIn",0);
settings.alwaysPlayIntro=e->getConfInt("alwaysPlayIntro",0);
settings.cursorFollowsOrder=e->getConfInt("cursorFollowsOrder",1);
clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96);
@ -2724,6 +2733,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.oneDigitEffects,0,1);
clampSetting(settings.disableFadeIn,0,1);
clampSetting(settings.alwaysPlayIntro,0,3);
clampSetting(settings.cursorFollowsOrder,0,1);
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
@ -2933,6 +2943,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("oneDigitEffects",settings.oneDigitEffects);
e->setConf("disableFadeIn",settings.disableFadeIn);
e->setConf("alwaysPlayIntro",settings.alwaysPlayIntro);
e->setConf("cursorFollowsOrder", settings.cursorFollowsOrder);
// colors
for (int i=0; i<GUI_COLOR_MAX; i++) {