From 20a5d9c0898bece18ccc576f0bea6b68e99edf87 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 27 Oct 2023 04:23:35 -0500 Subject: [PATCH] GUI: channel status, part 3 --- src/engine/dispatch.h | 9 ++++++- src/gui/gui.h | 11 +++++++++ src/gui/guiConst.cpp | 11 +++++++++ src/gui/pattern.cpp | 57 +++++++++++++++++++++++++++++++++++-------- src/gui/settings.cpp | 13 +++++++++- 5 files changed, 89 insertions(+), 12 deletions(-) diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 6f2119356..cff298353 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -388,7 +388,14 @@ struct DivChannelModeHints { // - 1: volume // - 2: pitch // - 3: panning - // - 4: ??? + // - 4: chip primary + // - 5: chip secondary + // - 6: mixing + // - 7: DSP + // - 8: note + // - 9: misc 1 + // - 10: misc 2 + // - 11: misc 3 unsigned char type[4]; // up to 4 unsigned char count; diff --git a/src/gui/gui.h b/src/gui/gui.h index 73fe79951..1bca9f066 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -310,6 +310,17 @@ enum FurnaceGUIColors { GUI_COLOR_PATTERN_STATUS_REL, GUI_COLOR_PATTERN_STATUS_REL_ON, GUI_COLOR_PATTERN_STATUS_ON, + GUI_COLOR_PATTERN_STATUS_VOLUME, + GUI_COLOR_PATTERN_STATUS_PITCH, + GUI_COLOR_PATTERN_STATUS_PANNING, + GUI_COLOR_PATTERN_STATUS_SYS1, + GUI_COLOR_PATTERN_STATUS_SYS2, + GUI_COLOR_PATTERN_STATUS_MIXING, + GUI_COLOR_PATTERN_STATUS_DSP, + GUI_COLOR_PATTERN_STATUS_NOTE, + GUI_COLOR_PATTERN_STATUS_MISC1, + GUI_COLOR_PATTERN_STATUS_MISC2, + GUI_COLOR_PATTERN_STATUS_MISC3, GUI_COLOR_PATTERN_PAIR, diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 39607ba92..fdfc323ed 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -993,6 +993,17 @@ const FurnaceGUIColorDef guiColors[GUI_COLOR_MAX]={ D(GUI_COLOR_PATTERN_STATUS_REL,"",ImVec4(0.7f,0.1f,0.1f,1.0f)), D(GUI_COLOR_PATTERN_STATUS_REL_ON,"",ImVec4(1.0f,0.8f,0.1f,1.0f)), D(GUI_COLOR_PATTERN_STATUS_ON,"",ImVec4(0.3f,1.0f,0.1f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_VOLUME,"",ImVec4(0.0f,1.0f,0.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_PITCH,"",ImVec4(1.0f,1.0f,0.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_PANNING,"",ImVec4(0.0f,1.0f,1.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_SYS1,"",ImVec4(0.5f,1.0f,0.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_SYS2,"",ImVec4(0.0f,1.0f,0.5f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_MIXING,"",ImVec4(1.0f,0.3f,1.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_DSP,"",ImVec4(0.3f,0.6f,1.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_NOTE,"",ImVec4(0.3f,0.3f,1.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_MISC1,"",ImVec4(1.0f,0.5f,0.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_MISC2,"",ImVec4(0.7f,0.5f,1.0f,1.0f)), + D(GUI_COLOR_PATTERN_STATUS_MISC3,"",ImVec4(1.0f,0.1f,0.1f,1.0f)), D(GUI_COLOR_PATTERN_PAIR,"",ImVec4(0.6f,0.8f,1.0f,1.0f)), diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index 157b5078b..d3666240e 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -969,22 +969,22 @@ void FurnaceGUI::drawPattern() { const char* pitchIcon=ICON_FUR_SINE; if (cs->inPorta) { pitchIcon=ICON_FA_SHARE; - pitchColor=uiColors[GUI_COLOR_PATTERN_EFFECT_PITCH]; + pitchColor=uiColors[GUI_COLOR_PATTERN_STATUS_PITCH]; } else if (cs->portaSpeed>0) { if (cs->portaNote>=60) { pitchIcon=ICON_FA_CHEVRON_UP; } else { pitchIcon=ICON_FA_CHEVRON_DOWN; } - pitchColor=uiColors[GUI_COLOR_PATTERN_EFFECT_PITCH]; + pitchColor=uiColors[GUI_COLOR_PATTERN_STATUS_PITCH]; } else if (cs->vibratoDepth>0) { pitchIcon=ICON_FUR_SINE; - pitchColor=uiColors[GUI_COLOR_PATTERN_EFFECT_PITCH]; + pitchColor=uiColors[GUI_COLOR_PATTERN_STATUS_PITCH]; } else if (cs->arp) { pitchIcon=ICON_FA_BARS; - pitchColor=uiColors[GUI_COLOR_PATTERN_EFFECT_MISC]; + pitchColor=uiColors[GUI_COLOR_PATTERN_STATUS_NOTE]; } else { - pitchColor=uiColors[GUI_COLOR_TOGGLE_OFF]; + pitchColor=uiColors[GUI_COLOR_PATTERN_STATUS_OFF]; } iconPos[1].x-=mainFont->CalcTextSizeA(mainFont->FontSize,FLT_MAX,0.0f,pitchIcon).x*0.5f; dl->AddText(mainFont,settings.mainFontSize*dpiScale,iconPos[1],ImGui::GetColorU32(pitchColor),pitchIcon); @@ -995,16 +995,16 @@ void FurnaceGUI::drawPattern() { const char* volIcon=ICON_FA_MINUS; if (cs->tremoloDepth>0) { volIcon=ICON_FUR_SINE; - volColor=uiColors[GUI_COLOR_PATTERN_VOLUME_MAX]; + volColor=uiColors[GUI_COLOR_PATTERN_STATUS_VOLUME]; } else if (cs->volSpeed) { if (cs->volSpeed>0) { volIcon=ICON_FA_CHEVRON_UP; } else { volIcon=ICON_FA_CHEVRON_DOWN; } - volColor=uiColors[GUI_COLOR_PATTERN_VOLUME_MAX]; + volColor=uiColors[GUI_COLOR_PATTERN_STATUS_VOLUME]; } else { - volColor=uiColors[GUI_COLOR_TOGGLE_OFF]; + volColor=uiColors[GUI_COLOR_PATTERN_STATUS_OFF]; } iconPos[2].x-=mainFont->CalcTextSizeA(mainFont->FontSize,FLT_MAX,0.0f,volIcon).x*0.5f; dl->AddText(mainFont,settings.mainFontSize*dpiScale,iconPos[2],ImGui::GetColorU32(volColor),volIcon); @@ -1012,8 +1012,45 @@ void FurnaceGUI::drawPattern() { // 4. OTHER for (int i=0; iCalcTextSizeA(mainFont->FontSize,FLT_MAX,0.0f,hints.hint[i]).x*0.5f; dl->AddText(mainFont,settings.mainFontSize*dpiScale,iconPos[i+3],ImGui::GetColorU32(hintColor),hints.hint[i]); } diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 6384d2aad..7e8a85a5b 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -3366,10 +3366,21 @@ void FurnaceGUI::drawSettings() { UI_COLOR_CONFIG(GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY,"Secondary specific effect"); UI_COLOR_CONFIG(GUI_COLOR_PATTERN_EFFECT_MISC,"Miscellaneous"); UI_COLOR_CONFIG(GUI_COLOR_EE_VALUE,"External command output"); - UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_OFF,"Status: off"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_OFF,"Status: off/disabled"); UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_REL,"Status: off + macro rel"); UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_REL_ON,"Status: on + macro rel"); UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_ON,"Status: on"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_VOLUME,"Status: volume"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_PITCH,"Status: pitch"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_PANNING,"Status: panning"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_SYS1,"Status: chip (primary)"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_SYS2,"Status: chip (secondary)"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_MIXING,"Status: mixing"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_DSP,"Status: DSP effect"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_NOTE,"Status: note altering"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_MISC1,"Status: misc color 1"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_MISC2,"Status: misc color 2"); + UI_COLOR_CONFIG(GUI_COLOR_PATTERN_STATUS_MISC3,"Status: misc color 3"); ImGui::TreePop(); } if (ImGui::TreeNode("Sample Editor")) {