From fe622a08b17404d9d9b785a4f821d30835c2eba7 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Sat, 20 Sep 2025 20:05:12 +0400 Subject: [PATCH 1/2] fix nolerp line plot leaving a stray vertical line --- src/gui/plot_nolerp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/plot_nolerp.cpp b/src/gui/plot_nolerp.cpp index 0d669afc0..3e96cfc38 100644 --- a/src/gui/plot_nolerp.cpp +++ b/src/gui/plot_nolerp.cpp @@ -135,7 +135,7 @@ int PlotNoLerpEx(ImGuiPlotType plot_type, const char* label, float (*values_gett const ImU32 col_base = ImGui::GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram); const ImU32 col_hovered = ImGui::GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered); - for (int n = 0; n < res_w; n++) + for (int n = 1; n <= res_w; n++) { const float t1 = t0 + t_step; const int v1_idx = (int)(t0 * item_count + 0.5f); @@ -153,7 +153,8 @@ int PlotNoLerpEx(ImGuiPlotType plot_type, const char* label, float (*values_gett if (plot_type == ImGuiPlotType_Lines) { window->DrawList->AddLine(pos0, pos1, idx_hovered == v1_idx ? col_hovered : col_base); - window->DrawList->AddLine(pos2, pos3, idx_hovered == v1_idx ? col_hovered : col_base); + if (n < res_w) + window->DrawList->AddLine(pos2, pos3, idx_hovered == v1_idx ? col_hovered : col_base); } else if (plot_type == ImGuiPlotType_Histogram) { From 8dbd732db93cf701653dff435d164b433c1249ed Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 20 Sep 2025 21:48:18 -0500 Subject: [PATCH 2/2] GUI: randomize notes + button to open pat menu on mobile --- src/gui/doAction.cpp | 3 +++ src/gui/editControls.cpp | 4 ++-- src/gui/editing.cpp | 23 +++++++++++++++++++++++ src/gui/gui.cpp | 1 + src/gui/gui.h | 2 ++ src/gui/guiConst.cpp | 1 + src/gui/pattern.cpp | 3 +++ 7 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index 4d8daed18..ddf570f68 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -222,6 +222,9 @@ void FurnaceGUI::doAction(int what) { } break; } + case GUI_ACTION_OPEN_EDIT_MENU: + openEditMenu=true; + break; case GUI_ACTION_PANIC: e->syncReset(); break; diff --git a/src/gui/editControls.cpp b/src/gui/editControls.cpp index b428658e2..1804b4b80 100644 --- a/src/gui/editControls.cpp +++ b/src/gui/editControls.cpp @@ -76,7 +76,7 @@ const char* mobileButtonLabels[32]={ // page 4 _N("fade"), - _N("randomize"), + _N("menu"), _N("opmask"), _N("scroll\nmode"), _N("input\nlatch"), @@ -118,7 +118,7 @@ const int mobileButtonActions[32]={ // page 4 GUI_ACTION_PAT_FADE, - 0, + GUI_ACTION_OPEN_EDIT_MENU, 0, GUI_ACTION_PAT_SCROLL_MODE, 0, diff --git a/src/gui/editing.cpp b/src/gui/editing.cpp index 4558b0cec..e94759279 100644 --- a/src/gui/editing.cpp +++ b/src/gui/editing.cpp @@ -1624,6 +1624,29 @@ void FurnaceGUI::doRandomize(int bottom, int top, bool mode, bool eff, int effVa } j=0; } + } else { + // random notes + int absoluteTop=179; + for (; jOrder<=selEnd.order; jOrder++) { + DivPattern* pat=e->curPat[iCoarse].getPattern(e->curOrders->ord[iCoarse][jOrder],true); + for (; jcurSubSong->patLen && (j<=selEnd.y || jOrderdata[j][0]=value%12; + pat->data[j][1]=(value-60)/12; + if (pat->data[j][0]==0) { + pat->data[j][0]=12; + pat->data[j][1]--; + } + pat->data[j][1]=(unsigned char)pat->data[j][1]; + } + j=0; + } } } iFine=0; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 7b613bfb0..f3fff73c8 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -8680,6 +8680,7 @@ FurnaceGUI::FurnaceGUI(): dragMobileEditButton(false), wantGrooveListFocus(false), mobilePatSel(false), + openEditMenu(false), lastAssetType(0), curWindow(GUI_WINDOW_NOTHING), nextWindow(GUI_WINDOW_NOTHING), diff --git a/src/gui/gui.h b/src/gui/gui.h index 1e9fca083..cdcc132bf 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -719,6 +719,7 @@ enum FurnaceGUIActions { GUI_ACTION_FOLLOW_PATTERN, GUI_ACTION_FULLSCREEN, GUI_ACTION_TX81Z_REQUEST, + GUI_ACTION_OPEN_EDIT_MENU, GUI_ACTION_PANIC, GUI_ACTION_CLEAR, @@ -2401,6 +2402,7 @@ class FurnaceGUI { bool collapseWindow, demandScrollX, fancyPattern, firstFrame, tempoView, waveHex, waveSigned, waveGenVisible, lockLayout, editOptsVisible, latchNibble, nonLatchNibble; bool keepLoopAlive, keepGrooveAlive, orderScrollLocked, orderScrollTolerance, dragMobileMenu, dragMobileEditButton, wantGrooveListFocus; bool mobilePatSel; + bool openEditMenu; unsigned char lastAssetType; FurnaceGUIWindows curWindow, nextWindow, curWindowLast; std::atomic curWindowThreadSafe; diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 608df187f..285a92d3f 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -603,6 +603,7 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={ D("FOLLOW_PATTERN", _N("Follow pattern"), 0), D("FULLSCREEN", _N("Toggle full-screen"), SDLK_F11), D("TX81Z_REQUEST", _N("Request voice from TX81Z"), 0), + D("OPEN_EDIT_MENU", _N("Open pattern edit menu"), 0), D("PANIC", _N("Panic"), SDLK_F12), D("CLEAR", _N("Clear song data"), 0), diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index de53a3583..ac0ae168f 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -1907,6 +1907,7 @@ void FurnaceGUI::drawPattern() { ImGui::PopStyleVar(); if (patternOpen) { if (!inhibitMenu && ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows) && ImGui::IsMouseClicked(ImGuiMouseButton_Right)) ImGui::OpenPopup("patternActionMenu"); + if (openEditMenu) ImGui::OpenPopup("patternActionMenu"); if (ImGui::BeginPopup("patternActionMenu",ImGuiWindowFlags_NoMove|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) { editOptions(false); ImGui::EndPopup(); @@ -1914,5 +1915,7 @@ void FurnaceGUI::drawPattern() { } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_PATTERN; ImGui::End(); + + openEditMenu=false; }