From 1c94975a0a5268a591dd37967910f8d29b891763 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Wed, 26 Jul 2023 18:41:17 +0400 Subject: [PATCH 01/11] primitive effect sorting --- src/gui/effectList.cpp | 50 +++++++++++++++++++++++++++++++++++++++++- src/gui/gui.cpp | 11 ++++++++++ src/gui/gui.h | 3 +++ 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index 604204b86..d192340de 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -12,6 +12,40 @@ void FurnaceGUI::drawEffectList() { ImGui::SetNextWindowSizeConstraints(ImVec2(60.0f*dpiScale,20.0f*dpiScale),ImVec2(canvasW,canvasH)); if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) { ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); + ImGui::Text("Sort Effects:"); + ImGui::Checkbox("All",&effectShowAll); + if (effectShowAll) { + effectShowMisc = true; + effectShowPanning = true; + effectShowPitch = true; + effectShowVolume = true; + effectShowSong = true; + effectShowTime = true; + effectShowSpeed = true; + effectShowSysPrimary = true; + effectShowSysSecondary = true; + } + ImGui::SameLine(); + ImGui::Checkbox("Pitch",&effectShowPitch); + ImGui::SameLine(); + ImGui::Checkbox("Song",&effectShowSong); + ImGui::SameLine(); + ImGui::Checkbox("Time",&effectShowTime); + ImGui::SameLine(); + ImGui::Checkbox("Speed",&effectShowSpeed); + ImGui::SameLine(); + ImGui::Checkbox("Panning",&effectShowPanning); + // ImGui::SameLine(); + ImGui::Checkbox("Volume",&effectShowVolume); + ImGui::SameLine(); + ImGui::Checkbox("System (primary)",&effectShowSysPrimary); + ImGui::SameLine(); + ImGui::Checkbox("System (secondary)",&effectShowSysSecondary); + ImGui::SameLine(); + ImGui::Checkbox("Miscellanious",&effectShowMisc); + + effectShowAll = effectShowMisc && effectShowPanning && effectShowPitch && effectShowVolume && effectShowSong && effectShowTime && effectShowSpeed && effectShowSysPrimary && effectShowSysSecondary; + if (ImGui::BeginTable("effectList",2)) { ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch); @@ -25,11 +59,25 @@ void FurnaceGUI::drawEffectList() { const char* prevName=NULL; for (int i=0; i<256; i++) { const char* name=e->getEffectDesc(i,cursor.xCoarse); + bool effectShow = true; + switch (fxColors[i]) { + case GUI_COLOR_PATTERN_EFFECT_MISC: effectShow = effectShowMisc; break; + case GUI_COLOR_PATTERN_EFFECT_SONG: effectShow = effectShowSong; break; + case GUI_COLOR_PATTERN_EFFECT_SPEED: effectShow = effectShowSpeed; break; + case GUI_COLOR_PATTERN_EFFECT_TIME: effectShow = effectShowTime; break; + case GUI_COLOR_PATTERN_EFFECT_PITCH: effectShow = effectShowPitch; break; + case GUI_COLOR_PATTERN_EFFECT_PANNING: effectShow = effectShowPanning; break; + case GUI_COLOR_PATTERN_EFFECT_VOLUME: effectShow = effectShowVolume; break; + case GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY: effectShow = effectShowSysPrimary; break; + case GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY: effectShow = effectShowSysSecondary; break; + default: effectShow = true; break; + } + // effectShow = effectShow && effectShowAll; if (name==prevName) { continue; } prevName=name; - if (name!=NULL) { + if (name!=NULL && effectShow) { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::PushFont(patFont); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index e84c3ecd2..088f1b8d7 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -7153,6 +7153,17 @@ FurnaceGUI::FurnaceGUI(): pianoView(PIANO_LAYOUT_STANDARD), pianoInputPadMode(PIANO_INPUT_PAD_DISABLE), #endif + //effect sorting + effectShowAll(true), + effectShowPitch(true), + effectShowVolume(true), + effectShowPanning(true), + effectShowSong(true), + effectShowTime(true), + effectShowSpeed(true), + effectShowSysPrimary(true), + effectShowSysSecondary(true), + effectShowMisc(true), hasACED(false), waveGenBaseShape(0), waveInterpolation(0), diff --git a/src/gui/gui.h b/src/gui/gui.h index b4a8a3e5b..e1cdd5d3d 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1729,6 +1729,9 @@ class FurnaceGUI { bool subSongsOpen, findOpen, spoilerOpen, patManagerOpen, sysManagerOpen, clockOpen, speedOpen; bool groovesOpen, introMonOpen; + //effect sorting + bool effectShowAll, effectShowPitch, effectShowVolume, effectShowPanning, effectShowSong, effectShowTime, effectShowSpeed, effectShowSysPrimary, effectShowSysSecondary, effectShowMisc; + bool basicMode, shortIntro; bool insListDir, waveListDir, sampleListDir; From 54d409714636d941e3667ad71fa418c579e536cd Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Wed, 26 Jul 2023 18:53:39 +0400 Subject: [PATCH 02/11] put sorting checkboxes in a treenode --- src/gui/effectList.cpp | 64 ++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index d192340de..26bea5a12 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -12,38 +12,40 @@ void FurnaceGUI::drawEffectList() { ImGui::SetNextWindowSizeConstraints(ImVec2(60.0f*dpiScale,20.0f*dpiScale),ImVec2(canvasW,canvasH)); if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) { ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); - ImGui::Text("Sort Effects:"); - ImGui::Checkbox("All",&effectShowAll); - if (effectShowAll) { - effectShowMisc = true; - effectShowPanning = true; - effectShowPitch = true; - effectShowVolume = true; - effectShowSong = true; - effectShowTime = true; - effectShowSpeed = true; - effectShowSysPrimary = true; - effectShowSysSecondary = true; + // ImGui::Text("Sort Effects:"); + if (ImGui::TreeNode("Sort Effects")) { + ImGui::Checkbox("All",&effectShowAll); + if (effectShowAll) { + effectShowMisc = true; + effectShowPanning = true; + effectShowPitch = true; + effectShowVolume = true; + effectShowSong = true; + effectShowTime = true; + effectShowSpeed = true; + effectShowSysPrimary = true; + effectShowSysSecondary = true; + } + // ImGui::SameLine(); + ImGui::Checkbox("Pitch",&effectShowPitch); + // ImGui::SameLine(); + ImGui::Checkbox("Song",&effectShowSong); + // ImGui::SameLine(); + ImGui::Checkbox("Time",&effectShowTime); + // ImGui::SameLine(); + ImGui::Checkbox("Speed",&effectShowSpeed); + // ImGui::SameLine(); + ImGui::Checkbox("Panning",&effectShowPanning); + // ImGui::SameLine(); + ImGui::Checkbox("Volume",&effectShowVolume); + // ImGui::SameLine(); + ImGui::Checkbox("System (primary)",&effectShowSysPrimary); + // ImGui::SameLine(); + ImGui::Checkbox("System (secondary)",&effectShowSysSecondary); + // ImGui::SameLine(); + ImGui::Checkbox("Miscellanious",&effectShowMisc); + ImGui::TreePop(); } - ImGui::SameLine(); - ImGui::Checkbox("Pitch",&effectShowPitch); - ImGui::SameLine(); - ImGui::Checkbox("Song",&effectShowSong); - ImGui::SameLine(); - ImGui::Checkbox("Time",&effectShowTime); - ImGui::SameLine(); - ImGui::Checkbox("Speed",&effectShowSpeed); - ImGui::SameLine(); - ImGui::Checkbox("Panning",&effectShowPanning); - // ImGui::SameLine(); - ImGui::Checkbox("Volume",&effectShowVolume); - ImGui::SameLine(); - ImGui::Checkbox("System (primary)",&effectShowSysPrimary); - ImGui::SameLine(); - ImGui::Checkbox("System (secondary)",&effectShowSysSecondary); - ImGui::SameLine(); - ImGui::Checkbox("Miscellanious",&effectShowMisc); - effectShowAll = effectShowMisc && effectShowPanning && effectShowPitch && effectShowVolume && effectShowSong && effectShowTime && effectShowSpeed && effectShowSysPrimary && effectShowSysSecondary; if (ImGui::BeginTable("effectList",2)) { From d19214045c6adb93ae89ecd7880c3eaf2fca6b4f Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Wed, 26 Jul 2023 19:28:42 +0400 Subject: [PATCH 03/11] reorder fix --- src/gui/gui.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/gui.h b/src/gui/gui.h index e1cdd5d3d..d1373e73a 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1729,8 +1729,6 @@ class FurnaceGUI { bool subSongsOpen, findOpen, spoilerOpen, patManagerOpen, sysManagerOpen, clockOpen, speedOpen; bool groovesOpen, introMonOpen; - //effect sorting - bool effectShowAll, effectShowPitch, effectShowVolume, effectShowPanning, effectShowSong, effectShowTime, effectShowSpeed, effectShowSysPrimary, effectShowSysSecondary, effectShowMisc; bool basicMode, shortIntro; bool insListDir, waveListDir, sampleListDir; @@ -2034,6 +2032,9 @@ class FurnaceGUI { bool pianoReadonly; int pianoOffset, pianoOffsetEdit; int pianoView, pianoInputPadMode; + + //effect sorting + bool effectShowAll, effectShowPitch, effectShowVolume, effectShowPanning, effectShowSong, effectShowTime, effectShowSpeed, effectShowSysPrimary, effectShowSysSecondary, effectShowMisc; // TX81Z bool hasACED; From 60006dc862e0b1d126b1aa8a396dcf697591590c Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Wed, 26 Jul 2023 19:51:28 +0400 Subject: [PATCH 04/11] typo --- src/gui/effectList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index 26bea5a12..d9d9a6ecf 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -43,7 +43,7 @@ void FurnaceGUI::drawEffectList() { // ImGui::SameLine(); ImGui::Checkbox("System (secondary)",&effectShowSysSecondary); // ImGui::SameLine(); - ImGui::Checkbox("Miscellanious",&effectShowMisc); + ImGui::Checkbox("Miscellaneous",&effectShowMisc); ImGui::TreePop(); } effectShowAll = effectShowMisc && effectShowPanning && effectShowPitch && effectShowVolume && effectShowSong && effectShowTime && effectShowSpeed && effectShowSysPrimary && effectShowSysSecondary; From 620fc82247aafb1613b5e1a1ad3bfdd5a3ab872d Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Thu, 27 Jul 2023 14:44:41 +0400 Subject: [PATCH 05/11] 'all' checkbox to 'all'/'none' buttons --- src/gui/effectList.cpp | 45 +++++++++++++++++++++--------------------- src/gui/gui.cpp | 1 - src/gui/gui.h | 2 +- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index d9d9a6ecf..6b309cdc9 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -12,10 +12,17 @@ void FurnaceGUI::drawEffectList() { ImGui::SetNextWindowSizeConstraints(ImVec2(60.0f*dpiScale,20.0f*dpiScale),ImVec2(canvasW,canvasH)); if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) { ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); - // ImGui::Text("Sort Effects:"); if (ImGui::TreeNode("Sort Effects")) { - ImGui::Checkbox("All",&effectShowAll); - if (effectShowAll) { + ImGui::Checkbox("Pitch",&effectShowPitch); + ImGui::Checkbox("Song",&effectShowSong); + ImGui::Checkbox("Time",&effectShowTime); + ImGui::Checkbox("Speed",&effectShowSpeed); + ImGui::Checkbox("Panning",&effectShowPanning); + ImGui::Checkbox("Volume",&effectShowVolume); + ImGui::Checkbox("System (primary)",&effectShowSysPrimary); + ImGui::Checkbox("System (secondary)",&effectShowSysSecondary); + ImGui::Checkbox("Miscellaneous",&effectShowMisc); + if (ImGui::Button("All")) { effectShowMisc = true; effectShowPanning = true; effectShowPitch = true; @@ -26,27 +33,20 @@ void FurnaceGUI::drawEffectList() { effectShowSysPrimary = true; effectShowSysSecondary = true; } - // ImGui::SameLine(); - ImGui::Checkbox("Pitch",&effectShowPitch); - // ImGui::SameLine(); - ImGui::Checkbox("Song",&effectShowSong); - // ImGui::SameLine(); - ImGui::Checkbox("Time",&effectShowTime); - // ImGui::SameLine(); - ImGui::Checkbox("Speed",&effectShowSpeed); - // ImGui::SameLine(); - ImGui::Checkbox("Panning",&effectShowPanning); - // ImGui::SameLine(); - ImGui::Checkbox("Volume",&effectShowVolume); - // ImGui::SameLine(); - ImGui::Checkbox("System (primary)",&effectShowSysPrimary); - // ImGui::SameLine(); - ImGui::Checkbox("System (secondary)",&effectShowSysSecondary); - // ImGui::SameLine(); - ImGui::Checkbox("Miscellaneous",&effectShowMisc); + ImGui::SameLine(); + if (ImGui::Button("None")) { + effectShowMisc = false; + effectShowPanning = false; + effectShowPitch = false; + effectShowVolume = false; + effectShowSong = false; + effectShowTime = false; + effectShowSpeed = false; + effectShowSysPrimary = false; + effectShowSysSecondary = false; + } ImGui::TreePop(); } - effectShowAll = effectShowMisc && effectShowPanning && effectShowPitch && effectShowVolume && effectShowSong && effectShowTime && effectShowSpeed && effectShowSysPrimary && effectShowSysSecondary; if (ImGui::BeginTable("effectList",2)) { ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed); @@ -74,7 +74,6 @@ void FurnaceGUI::drawEffectList() { case GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY: effectShow = effectShowSysSecondary; break; default: effectShow = true; break; } - // effectShow = effectShow && effectShowAll; if (name==prevName) { continue; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 088f1b8d7..4c73d7f1c 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -7154,7 +7154,6 @@ FurnaceGUI::FurnaceGUI(): pianoInputPadMode(PIANO_INPUT_PAD_DISABLE), #endif //effect sorting - effectShowAll(true), effectShowPitch(true), effectShowVolume(true), effectShowPanning(true), diff --git a/src/gui/gui.h b/src/gui/gui.h index d1373e73a..6110c7561 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2034,7 +2034,7 @@ class FurnaceGUI { int pianoView, pianoInputPadMode; //effect sorting - bool effectShowAll, effectShowPitch, effectShowVolume, effectShowPanning, effectShowSong, effectShowTime, effectShowSpeed, effectShowSysPrimary, effectShowSysSecondary, effectShowMisc; + bool effectShowPitch, effectShowVolume, effectShowPanning, effectShowSong, effectShowTime, effectShowSpeed, effectShowSysPrimary, effectShowSysSecondary, effectShowMisc; // TX81Z bool hasACED; From 0d33273a2e84fa27075816f95e74bb5f4817ebaa Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Thu, 27 Jul 2023 15:22:20 +0400 Subject: [PATCH 06/11] useless newline removed --- src/gui/gui.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/gui.h b/src/gui/gui.h index 6110c7561..c14bea088 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1729,7 +1729,6 @@ class FurnaceGUI { bool subSongsOpen, findOpen, spoilerOpen, patManagerOpen, sysManagerOpen, clockOpen, speedOpen; bool groovesOpen, introMonOpen; - bool basicMode, shortIntro; bool insListDir, waveListDir, sampleListDir; From d5b18ab080ffcc3a695cbafdaaf3b87b3c2450eb Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Fri, 28 Jul 2023 18:24:56 +0400 Subject: [PATCH 07/11] is this "the button" --- src/gui/effectList.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index 6b309cdc9..e9da54d56 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -12,7 +12,8 @@ void FurnaceGUI::drawEffectList() { ImGui::SetNextWindowSizeConstraints(ImVec2(60.0f*dpiScale,20.0f*dpiScale),ImVec2(canvasW,canvasH)); if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) { ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); - if (ImGui::TreeNode("Sort Effects")) { + if (ImGui::Button("Sort Effects")) ImGui::OpenPopup("effectSort"); + if (ImGui::BeginPopup("effectSort")) { ImGui::Checkbox("Pitch",&effectShowPitch); ImGui::Checkbox("Song",&effectShowSong); ImGui::Checkbox("Time",&effectShowTime); @@ -45,7 +46,7 @@ void FurnaceGUI::drawEffectList() { effectShowSysPrimary = false; effectShowSysSecondary = false; } - ImGui::TreePop(); + ImGui::EndPopup(); } if (ImGui::BeginTable("effectList",2)) { From dd00d3bc66514f6d6ffa61906efda00f203e6911 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Fri, 28 Jul 2023 18:39:40 +0400 Subject: [PATCH 08/11] cleanup --- src/gui/effectList.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index e9da54d56..f6b4c6c31 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -23,6 +23,7 @@ void FurnaceGUI::drawEffectList() { ImGui::Checkbox("System (primary)",&effectShowSysPrimary); ImGui::Checkbox("System (secondary)",&effectShowSysSecondary); ImGui::Checkbox("Miscellaneous",&effectShowMisc); + if (ImGui::Button("All")) { effectShowMisc = true; effectShowPanning = true; @@ -46,6 +47,7 @@ void FurnaceGUI::drawEffectList() { effectShowSysPrimary = false; effectShowSysSecondary = false; } + ImGui::EndPopup(); } @@ -63,6 +65,10 @@ void FurnaceGUI::drawEffectList() { for (int i=0; i<256; i++) { const char* name=e->getEffectDesc(i,cursor.xCoarse); bool effectShow = true; + if (name==prevName) { + continue; + } + prevName=name; switch (fxColors[i]) { case GUI_COLOR_PATTERN_EFFECT_MISC: effectShow = effectShowMisc; break; case GUI_COLOR_PATTERN_EFFECT_SONG: effectShow = effectShowSong; break; @@ -75,10 +81,6 @@ void FurnaceGUI::drawEffectList() { case GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY: effectShow = effectShowSysSecondary; break; default: effectShow = true; break; } - if (name==prevName) { - continue; - } - prevName=name; if (name!=NULL && effectShow) { ImGui::TableNextRow(); ImGui::TableNextColumn(); From 5c5ccbeb72c76a13db64392d39e58adf863a6a75 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Fri, 28 Jul 2023 20:38:13 +0400 Subject: [PATCH 09/11] change to beginpopupcontextitem --- src/gui/effectList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index f6b4c6c31..8dd0b327a 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -13,7 +13,7 @@ void FurnaceGUI::drawEffectList() { if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) { ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); if (ImGui::Button("Sort Effects")) ImGui::OpenPopup("effectSort"); - if (ImGui::BeginPopup("effectSort")) { + if (ImGui::BeginPopupContextItem("effectSort")) { ImGui::Checkbox("Pitch",&effectShowPitch); ImGui::Checkbox("Song",&effectShowSong); ImGui::Checkbox("Time",&effectShowTime); From 2c3bacbd3b0c936ff562805e1cc92baec49d6739 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Sat, 29 Jul 2023 11:07:20 +0400 Subject: [PATCH 10/11] colored text, arrays instead of many vars --- src/gui/effectList.cpp | 56 ++++++++++++------------------------------ src/gui/gui.cpp | 12 ++------- src/gui/gui.h | 2 +- src/gui/guiConst.cpp | 26 ++++++++++++++++++++ src/gui/guiConst.h | 4 ++- 5 files changed, 48 insertions(+), 52 deletions(-) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index 8dd0b327a..4da92c29d 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -14,39 +14,15 @@ void FurnaceGUI::drawEffectList() { ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); if (ImGui::Button("Sort Effects")) ImGui::OpenPopup("effectSort"); if (ImGui::BeginPopupContextItem("effectSort")) { - ImGui::Checkbox("Pitch",&effectShowPitch); - ImGui::Checkbox("Song",&effectShowSong); - ImGui::Checkbox("Time",&effectShowTime); - ImGui::Checkbox("Speed",&effectShowSpeed); - ImGui::Checkbox("Panning",&effectShowPanning); - ImGui::Checkbox("Volume",&effectShowVolume); - ImGui::Checkbox("System (primary)",&effectShowSysPrimary); - ImGui::Checkbox("System (secondary)",&effectShowSysSecondary); - ImGui::Checkbox("Miscellaneous",&effectShowMisc); + for (int i=0; i<9; i++) { + ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColorsSort[i]]); + ImGui::Checkbox(fxColorsNames[i],&effectsShow[i]); + ImGui::PopStyleColor(); + } - if (ImGui::Button("All")) { - effectShowMisc = true; - effectShowPanning = true; - effectShowPitch = true; - effectShowVolume = true; - effectShowSong = true; - effectShowTime = true; - effectShowSpeed = true; - effectShowSysPrimary = true; - effectShowSysSecondary = true; - } + if (ImGui::Button("All")) memset(effectsShow,1,sizeof(bool)*10); ImGui::SameLine(); - if (ImGui::Button("None")) { - effectShowMisc = false; - effectShowPanning = false; - effectShowPitch = false; - effectShowVolume = false; - effectShowSong = false; - effectShowTime = false; - effectShowSpeed = false; - effectShowSysPrimary = false; - effectShowSysSecondary = false; - } + if (ImGui::Button("None")) memset(effectsShow,0,sizeof(bool)*10); ImGui::EndPopup(); } @@ -70,15 +46,15 @@ void FurnaceGUI::drawEffectList() { } prevName=name; switch (fxColors[i]) { - case GUI_COLOR_PATTERN_EFFECT_MISC: effectShow = effectShowMisc; break; - case GUI_COLOR_PATTERN_EFFECT_SONG: effectShow = effectShowSong; break; - case GUI_COLOR_PATTERN_EFFECT_SPEED: effectShow = effectShowSpeed; break; - case GUI_COLOR_PATTERN_EFFECT_TIME: effectShow = effectShowTime; break; - case GUI_COLOR_PATTERN_EFFECT_PITCH: effectShow = effectShowPitch; break; - case GUI_COLOR_PATTERN_EFFECT_PANNING: effectShow = effectShowPanning; break; - case GUI_COLOR_PATTERN_EFFECT_VOLUME: effectShow = effectShowVolume; break; - case GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY: effectShow = effectShowSysPrimary; break; - case GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY: effectShow = effectShowSysSecondary; break; + case GUI_COLOR_PATTERN_EFFECT_MISC: effectShow = effectsShow[8]; break; + case GUI_COLOR_PATTERN_EFFECT_SONG: effectShow = effectsShow[1]; break; + case GUI_COLOR_PATTERN_EFFECT_SPEED: effectShow = effectsShow[3]; break; + case GUI_COLOR_PATTERN_EFFECT_TIME: effectShow = effectsShow[2]; break; + case GUI_COLOR_PATTERN_EFFECT_PITCH: effectShow = effectsShow[0]; break; + case GUI_COLOR_PATTERN_EFFECT_PANNING: effectShow = effectsShow[4]; break; + case GUI_COLOR_PATTERN_EFFECT_VOLUME: effectShow = effectsShow[5]; break; + case GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY: effectShow = effectsShow[6]; break; + case GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY: effectShow = effectsShow[7]; break; default: effectShow = true; break; } if (name!=NULL && effectShow) { diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 0883dce3f..4986cdfb4 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -7134,16 +7134,6 @@ FurnaceGUI::FurnaceGUI(): pianoView(PIANO_LAYOUT_STANDARD), pianoInputPadMode(PIANO_INPUT_PAD_DISABLE), #endif - //effect sorting - effectShowPitch(true), - effectShowVolume(true), - effectShowPanning(true), - effectShowSong(true), - effectShowTime(true), - effectShowSpeed(true), - effectShowSysPrimary(true), - effectShowSysSecondary(true), - effectShowMisc(true), hasACED(false), waveGenBaseShape(0), waveInterpolation(0), @@ -7279,6 +7269,8 @@ FurnaceGUI::FurnaceGUI(): memset(macroRelLabel,0,32); memset(emptyLabel,0,32); memset(emptyLabel2,0,32); + //effect sorting + memset(effectsShow,1,sizeof(bool)*10); strncpy(noteOffLabel,"OFF",32); strncpy(noteRelLabel,"===",32); diff --git a/src/gui/gui.h b/src/gui/gui.h index 65b1cc293..7d3e4cb5b 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2031,7 +2031,7 @@ class FurnaceGUI { int pianoView, pianoInputPadMode; //effect sorting - bool effectShowPitch, effectShowVolume, effectShowPanning, effectShowSong, effectShowTime, effectShowSpeed, effectShowSysPrimary, effectShowSysSecondary, effectShowMisc; + bool effectsShow[10]; // TX81Z bool hasACED; diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 09fe601d4..c1446ac6f 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -208,6 +208,32 @@ const char* resampleStrats[]={ "best possible" }; +const FurnaceGUIColors fxColorsSort[]={//used for sorting + GUI_COLOR_PATTERN_EFFECT_PITCH, + GUI_COLOR_PATTERN_EFFECT_SONG, + GUI_COLOR_PATTERN_EFFECT_TIME, + GUI_COLOR_PATTERN_EFFECT_SPEED, + GUI_COLOR_PATTERN_EFFECT_PANNING, + GUI_COLOR_PATTERN_EFFECT_VOLUME, + GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY, + GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY, + GUI_COLOR_PATTERN_EFFECT_MISC, + GUI_COLOR_PATTERN_EFFECT_INVALID +}; + +const char* fxColorsNames[]={ + "Pitch", + "Song", + "Time", + "Speed", + "Panning", + "Volume", + "System Primary", + "System Secondary", + "Miscellaneous", + "Invalid" +}; + const FurnaceGUIColors fxColors[256]={ GUI_COLOR_PATTERN_EFFECT_MISC, // 00 GUI_COLOR_PATTERN_EFFECT_PITCH, // 01 diff --git a/src/gui/guiConst.h b/src/gui/guiConst.h index 494ba58dc..616692de5 100644 --- a/src/gui/guiConst.h +++ b/src/gui/guiConst.h @@ -57,4 +57,6 @@ extern const FurnaceGUIActionDef guiActions[]; extern const FurnaceGUIColorDef guiColors[]; extern const int altValues[24]; extern const int vgmVersions[7]; -extern const FurnaceGUIColors fxColors[256]; \ No newline at end of file +extern const FurnaceGUIColors fxColors[256]; +extern const FurnaceGUIColors fxColorsSort[10]; +extern const char* fxColorsNames[10]; \ No newline at end of file From 0671df9916539351e9096306debcfce8c61c86b5 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Sat, 29 Jul 2023 13:11:52 +0400 Subject: [PATCH 11/11] sameline --- src/gui/effectList.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/effectList.cpp b/src/gui/effectList.cpp index 4da92c29d..0be3d942a 100644 --- a/src/gui/effectList.cpp +++ b/src/gui/effectList.cpp @@ -12,6 +12,7 @@ void FurnaceGUI::drawEffectList() { ImGui::SetNextWindowSizeConstraints(ImVec2(60.0f*dpiScale,20.0f*dpiScale),ImVec2(canvasW,canvasH)); if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) { ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); + ImGui::SameLine(); if (ImGui::Button("Sort Effects")) ImGui::OpenPopup("effectSort"); if (ImGui::BeginPopupContextItem("effectSort")) { for (int i=0; i<9; i++) {