diff --git a/CMakeLists.txt b/CMakeLists.txt index ad18b67e7..decea3fef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -804,6 +804,7 @@ src/gui/grooves.cpp src/gui/insEdit.cpp src/gui/intro.cpp src/gui/log.cpp +src/gui/memory.cpp src/gui/mixer.cpp src/gui/midiMap.cpp src/gui/newSong.cpp diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index e31eb289f..c706410b3 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -313,6 +313,9 @@ void FurnaceGUI::doAction(int what) { case GUI_ACTION_WINDOW_XY_OSC: nextWindow=GUI_WINDOW_XY_OSC; break; + case GUI_ACTION_WINDOW_MEMORY: + nextWindow=GUI_WINDOW_MEMORY; + break; case GUI_ACTION_COLLAPSE_WINDOW: collapseWindow=true; @@ -412,6 +415,9 @@ void FurnaceGUI::doAction(int what) { case GUI_WINDOW_XY_OSC: xyOscOpen=false; break; + case GUI_WINDOW_MEMORY: + memoryOpen=false; + break; default: break; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 43eaed806..c9593d7c1 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3464,6 +3464,7 @@ bool FurnaceGUI::loop() { DECLARE_METRIC(settings) DECLARE_METRIC(debug) DECLARE_METRIC(stats) + DECLARE_METRIC(memory) DECLARE_METRIC(compatFlags) DECLARE_METRIC(piano) DECLARE_METRIC(notes) @@ -4044,6 +4045,7 @@ bool FurnaceGUI::loop() { IMPORT_CLOSE(speedOpen); IMPORT_CLOSE(groovesOpen); IMPORT_CLOSE(xyOscOpen); + IMPORT_CLOSE(memoryOpen); } else if (pendingLayoutImportStep==1) { // let the UI settle } else if (pendingLayoutImportStep==2) { @@ -4415,6 +4417,7 @@ bool FurnaceGUI::loop() { if (ImGui::MenuItem("register view",BIND_FOR(GUI_ACTION_WINDOW_REGISTER_VIEW),regViewOpen)) regViewOpen=!regViewOpen; if (ImGui::MenuItem("log viewer",BIND_FOR(GUI_ACTION_WINDOW_LOG),logOpen)) logOpen=!logOpen; if (ImGui::MenuItem("statistics",BIND_FOR(GUI_ACTION_WINDOW_STATS),statsOpen)) statsOpen=!statsOpen; + if (ImGui::MenuItem("memory composition",BIND_FOR(GUI_ACTION_WINDOW_MEMORY),memoryOpen)) memoryOpen=!memoryOpen; if (spoilerOpen) if (ImGui::MenuItem("spoiler",NULL,spoilerOpen)) spoilerOpen=!spoilerOpen; ImGui::EndMenu(); @@ -4636,6 +4639,7 @@ bool FurnaceGUI::loop() { MEASURE(volMeter,drawVolMeter()); MEASURE(grooves,drawGrooves()); MEASURE(regView,drawRegView()); + MEASURE(memory,drawMemory()); } else { globalWinFlags=0; ImGui::DockSpaceOverViewport(NULL,lockLayout?(ImGuiDockNodeFlags_NoWindowMenuButton|ImGuiDockNodeFlags_NoMove|ImGuiDockNodeFlags_NoResize|ImGuiDockNodeFlags_NoCloseButton|ImGuiDockNodeFlags_NoDocking|ImGuiDockNodeFlags_NoDockingSplitMe|ImGuiDockNodeFlags_NoDockingSplitOther):0); @@ -4666,6 +4670,7 @@ bool FurnaceGUI::loop() { MEASURE(settings,drawSettings()); MEASURE(debug,drawDebug()); MEASURE(stats,drawStats()); + MEASURE(memory,drawMemory()); MEASURE(compatFlags,drawCompatFlags()); MEASURE(piano,drawPiano()); MEASURE(notes,drawNotes()); @@ -6562,6 +6567,7 @@ bool FurnaceGUI::init() { oscOpen=e->getConfBool("oscOpen",true); chanOscOpen=e->getConfBool("chanOscOpen",false); xyOscOpen=e->getConfBool("xyOscOpen",false); + memoryOpen=e->getConfBool("memoryOpen",false); volMeterOpen=e->getConfBool("volMeterOpen",true); statsOpen=e->getConfBool("statsOpen",false); compatFlagsOpen=e->getConfBool("compatFlagsOpen",false); @@ -7124,6 +7130,7 @@ void FurnaceGUI::commitState() { e->setConf("oscOpen",oscOpen); e->setConf("chanOscOpen",chanOscOpen); e->setConf("xyOscOpen",xyOscOpen); + e->setConf("memoryOpen",memoryOpen); e->setConf("volMeterOpen",volMeterOpen); e->setConf("statsOpen",statsOpen); e->setConf("compatFlagsOpen",compatFlagsOpen); @@ -7487,6 +7494,7 @@ FurnaceGUI::FurnaceGUI(): speedOpen(true), groovesOpen(false), xyOscOpen(false), + memoryOpen(false), shortIntro(false), insListDir(false), waveListDir(false), diff --git a/src/gui/gui.h b/src/gui/gui.h index 0b95cafd1..9407e0c8e 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -457,6 +457,7 @@ enum FurnaceGUIWindows { GUI_WINDOW_GROOVES, GUI_WINDOW_XY_OSC, GUI_WINDOW_INTRO_MON, + GUI_WINDOW_MEMORY, GUI_WINDOW_SPOILER }; @@ -647,6 +648,7 @@ enum FurnaceGUIActions { GUI_ACTION_WINDOW_CLOCK, GUI_ACTION_WINDOW_GROOVES, GUI_ACTION_WINDOW_XY_OSC, + GUI_ACTION_WINDOW_MEMORY, GUI_ACTION_COLLAPSE_WINDOW, GUI_ACTION_CLOSE_WINDOW, @@ -2042,7 +2044,7 @@ class FurnaceGUI { bool mixerOpen, debugOpen, inspectorOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen; bool pianoOpen, notesOpen, channelsOpen, regViewOpen, logOpen, effectListOpen, chanOscOpen; bool subSongsOpen, findOpen, spoilerOpen, patManagerOpen, sysManagerOpen, clockOpen, speedOpen; - bool groovesOpen, xyOscOpen; + bool groovesOpen, xyOscOpen, memoryOpen; bool shortIntro; bool insListDir, waveListDir, sampleListDir; @@ -2539,6 +2541,7 @@ class FurnaceGUI { void drawChanOsc(); void drawVolMeter(); void drawStats(); + void drawMemory(); void drawCompatFlags(); void drawPiano(); void drawNotes(); diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 83b3146ac..bca38b73e 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -605,6 +605,7 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={ D("WINDOW_CLOCK", "Clock", 0), D("WINDOW_GROOVES", "Grooves", 0), D("WINDOW_XY_OSC", "Oscilloscope (X-Y)", 0), + D("WINDOW_MEMORY", "Memory Compositiom", 0), D("COLLAPSE_WINDOW", "Collapse/expand current window", 0), D("CLOSE_WINDOW", "Close current window", FURKMOD_SHIFT|SDLK_ESCAPE), diff --git a/src/gui/memory.cpp b/src/gui/memory.cpp new file mode 100644 index 000000000..84e3a2e0e --- /dev/null +++ b/src/gui/memory.cpp @@ -0,0 +1,36 @@ +/** + * Furnace Tracker - multi-system chiptune tracker + * Copyright (C) 2021-2024 tildearrow and contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "gui.h" +#include +#include + +void FurnaceGUI::drawMemory() { + if (nextWindow==GUI_WINDOW_MEMORY) { + memoryOpen=true; + ImGui::SetNextWindowFocus(); + nextWindow=GUI_WINDOW_NOTHING; + } + if (!memoryOpen) return; + if (ImGui::Begin("Memory Composition",&memoryOpen,globalWinFlags)) { + ImGui::Text("Contents here..."); + } + if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_MEMORY; + ImGui::End(); +} diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index cfca00e72..cc9db0461 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -1750,11 +1750,13 @@ void FurnaceGUI::drawSettings() { UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_PIANO); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_OSCILLOSCOPE); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_CHAN_OSC); + UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_XY_OSC); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_VOL_METER); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_CLOCK); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_REGISTER_VIEW); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_LOG); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_STATS); + UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_MEMORY); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_EFFECT_LIST); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_DEBUG); UI_KEYBIND_CONFIG(GUI_ACTION_WINDOW_ABOUT);