From cb34b7e1a7eec1c3f138950e59cb2be37732bc63 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 3 Nov 2022 02:59:37 -0500 Subject: [PATCH] GUI: add SNES echo filter MML string --- src/gui/gui.h | 2 +- src/gui/sysConf.cpp | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/gui/gui.h b/src/gui/gui.h index dd3a02af..e20656f7 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1028,7 +1028,7 @@ class FurnaceGUI { String workingDirVGMExport, workingDirZSMExport, workingDirROMExport, workingDirFont, workingDirColors, workingDirKeybinds; String workingDirLayout, workingDirROM, workingDirTest; String mmlString[32]; - String mmlStringW; + String mmlStringW, mmlStringSNES; std::vector sysSearchResults; std::vector newSongSearchResults; diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index c77df05e..1b793a2f 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -18,7 +18,7 @@ */ #include "gui.h" -#include +#include "misc/cpp/imgui_stdlib.h" bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange) { bool altered=false; @@ -1273,6 +1273,19 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo } rightClickable } + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); // wavetable text input size found here + if (ImGui::InputText("##MMLWave",&mmlStringSNES)) { + int actualData[256]; + int discardIt=0; + memset(actualData,0,256*sizeof(int)); + decodeMMLStrW(mmlStringSNES,actualData,discardIt,-128,127,false); + memcpy(echoFilter,actualData,8*sizeof(int)); + altered=true; + } + if (!ImGui::IsItemActive()) { + encodeMMLStr(mmlStringSNES,echoFilter,8,-1,-1,false); + } + if (altered) { e->lockSave([&]() { flags.set("volScaleL",127-vsL);