From df63257d117066797d727c2b27343e90dacdcaa9 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Tue, 5 Dec 2023 15:58:45 +0400 Subject: [PATCH 1/8] dummy export window, keybind and related settings --- CMakeLists.txt | 1 + src/gui/doAction.cpp | 3 + src/gui/exportWin.cpp | 24 +++ src/gui/gui.cpp | 358 ++++++++++++++++++++++-------------------- src/gui/gui.h | 6 +- src/gui/guiConst.cpp | 1 + src/gui/settings.cpp | 10 ++ 7 files changed, 233 insertions(+), 170 deletions(-) create mode 100644 src/gui/exportWin.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index f1941a02b..5336f3131 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -779,6 +779,7 @@ src/gui/doAction.cpp src/gui/editing.cpp src/gui/editControls.cpp src/gui/effectList.cpp +src/gui/exportWin.cpp src/gui/findReplace.cpp src/gui/fmPreview.cpp src/gui/gradient.cpp diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index 0d1bcf623..7a30760cf 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -65,6 +65,9 @@ void FurnaceGUI::doAction(int what) { case GUI_ACTION_SAVE_AS: openFileDialog(GUI_FILE_SAVE); break; + case GUI_ACTION_EXPORT: + displayExport=true; + break; case GUI_ACTION_UNDO: if (curWindow==GUI_WINDOW_SAMPLE_EDIT) { doUndoSample(); diff --git a/src/gui/exportWin.cpp b/src/gui/exportWin.cpp new file mode 100644 index 000000000..6e2c8b559 --- /dev/null +++ b/src/gui/exportWin.cpp @@ -0,0 +1,24 @@ +/** + * Furnace Tracker - multi-system chiptune tracker + * Copyright (C) 2021-2023 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" + +void FurnaceGUI::drawExport() { + if (ImGui::Button("dummy")) ImGui::CloseCurrentPopup(); +} diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 86cf09a86..99c7297ab 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -4081,197 +4081,203 @@ bool FurnaceGUI::loop() { openFileDialog(GUI_FILE_SAVE_DMF_LEGACY); } ImGui::Separator(); - if (ImGui::BeginMenu("export audio...")) { - exitDisabledTimer=1; - if (ImGui::MenuItem("one file")) { - openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); + if (settings.classicExportOptions) { + if (ImGui::BeginMenu("export audio...")) { + exitDisabledTimer=1; + if (ImGui::MenuItem("one file")) { + openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); + } + if (ImGui::MenuItem("multiple files (one per chip)")) { + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); + } + if (ImGui::MenuItem("multiple files (one per channel)")) { + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); + } + if (ImGui::InputInt("Loops",&exportLoops,1,2)) { + if (exportLoops<0) exportLoops=0; + } + if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { + if (exportFadeOut<0.0) exportFadeOut=0.0; + } + ImGui::EndMenu(); } - if (ImGui::MenuItem("multiple files (one per chip)")) { - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); - } - if (ImGui::MenuItem("multiple files (one per channel)")) { - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); - } - if (ImGui::InputInt("Loops",&exportLoops,1,2)) { - if (exportLoops<0) exportLoops=0; - } - if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { - if (exportFadeOut<0.0) exportFadeOut=0.0; - } - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("export VGM...")) { - exitDisabledTimer=1; - ImGui::Text("settings:"); - if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { - for (int i=0; i<7; i++) { - if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { - vgmExportVersion=vgmVersions[i]; + if (ImGui::BeginMenu("export VGM...")) { + exitDisabledTimer=1; + ImGui::Text("settings:"); + if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { + for (int i=0; i<7; i++) { + if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { + vgmExportVersion=vgmVersions[i]; + } } + ImGui::EndCombo(); } - ImGui::EndCombo(); - } - ImGui::Checkbox("loop",&vgmExportLoop); - if (vgmExportLoop && e->song.loopModality==2) { - ImGui::Text("loop trail:"); - ImGui::Indent(); - if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { - vgmExportTrailingTicks=-1; - } - if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { - vgmExportTrailingTicks=-2; - } - if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { - vgmExportTrailingTicks=0; - } - if (vgmExportTrailingTicks>=0) { - ImGui::SameLine(); - if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { - if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; + ImGui::Checkbox("loop",&vgmExportLoop); + if (vgmExportLoop && e->song.loopModality==2) { + ImGui::Text("loop trail:"); + ImGui::Indent(); + if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { + vgmExportTrailingTicks=-1; } + if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { + vgmExportTrailingTicks=-2; + } + if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { + vgmExportTrailingTicks=0; + } + if (vgmExportTrailingTicks>=0) { + ImGui::SameLine(); + if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { + if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; + } + } + ImGui::Unindent(); } - ImGui::Unindent(); - } - ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "inserts data blocks on pattern changes.\n" - "useful if you are writing a playback routine.\n\n" + ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "inserts data blocks on pattern changes.\n" + "useful if you are writing a playback routine.\n\n" - "the format of a pattern change data block is:\n" - "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" - "- ll: length, a 32-bit little-endian number\n" - "- oo: order\n" - "- rr: initial row (a 0Dxx effect is able to select a different row)\n" - "- pp: pattern index (one per channel)\n\n" + "the format of a pattern change data block is:\n" + "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" + "- ll: length, a 32-bit little-endian number\n" + "- oo: order\n" + "- rr: initial row (a 0Dxx effect is able to select a different row)\n" + "- pp: pattern index (one per channel)\n\n" - "pattern indexes are ordered as they appear in the song." - ); - } - ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "required for DualPCM and MSM6258 export.\n\n" - "allows for volume/direction changes when playing samples,\n" - "at the cost of a massive increase in file size." - ); - } - ImGui::Text("chips to export:"); - bool hasOneAtLeast=false; - for (int i=0; isong.systemLen; i++) { - int minVersion=e->minVGMVersion(e->song.system[i]); - ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); - ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); - ImGui::EndDisabled(); - if (minVersion>vgmExportVersion) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); + "pattern indexes are ordered as they appear in the song." + ); + } + ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "required for DualPCM and MSM6258 export.\n\n" + "allows for volume/direction changes when playing samples,\n" + "at the cost of a massive increase in file size." + ); + } + ImGui::Text("chips to export:"); + bool hasOneAtLeast=false; + for (int i=0; isong.systemLen; i++) { + int minVersion=e->minVGMVersion(e->song.system[i]); + ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); + ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); + ImGui::EndDisabled(); + if (minVersion>vgmExportVersion) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); + } + } else if (minVersion==0) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is not supported by the VGM format!"); + } + } else { + if (willExport[i]) hasOneAtLeast=true; } - } else if (minVersion==0) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is not supported by the VGM format!"); + } + ImGui::Text("select the chip you wish to export,"); + ImGui::Text("but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); + if (hasOneAtLeast) { + if (ImGui::MenuItem("click to export")) { + openFileDialog(GUI_FILE_EXPORT_VGM); } } else { - if (willExport[i]) hasOneAtLeast=true; - } - } - ImGui::Text("select the chip you wish to export,"); - ImGui::Text("but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); - if (hasOneAtLeast) { - if (ImGui::MenuItem("click to export")) { - openFileDialog(GUI_FILE_EXPORT_VGM); - } - } else { - ImGui::Text("nothing to export"); - } - ImGui::EndMenu(); - } - int numZSMCompat=0; - for (int i=0; isong.systemLen; i++) { - if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; - } - if (numZSMCompat > 0) { - if (ImGui::BeginMenu("export ZSM...")) { - exitDisabledTimer=1; - ImGui::Text("Commander X16 Zsound Music File"); - if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { - if (zsmExportTickRate<1) zsmExportTickRate=1; - if (zsmExportTickRate>44100) zsmExportTickRate=44100; - } - ImGui::Checkbox("loop",&zsmExportLoop); - ImGui::SameLine(); - ImGui::Checkbox("optimize size",&zsmExportOptimize); - ImGui::SameLine(); - if (ImGui::Button("Begin Export")) { - openFileDialog(GUI_FILE_EXPORT_ZSM); - ImGui::CloseCurrentPopup(); + ImGui::Text("nothing to export"); } ImGui::EndMenu(); } - } - int numAmiga=0; - for (int i=0; isong.systemLen; i++) { - if (e->song.system[i]==DIV_SYSTEM_AMIGA) numAmiga++; - } - if (numAmiga && settings.iCannotWait) { - if (ImGui::BeginMenu("export Amiga validation data...")) { + int numZSMCompat=0; + for (int i=0; isong.systemLen; i++) { + if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; + } + if (numZSMCompat > 0) { + if (ImGui::BeginMenu("export ZSM...")) { + exitDisabledTimer=1; + ImGui::Text("Commander X16 Zsound Music File"); + if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { + if (zsmExportTickRate<1) zsmExportTickRate=1; + if (zsmExportTickRate>44100) zsmExportTickRate=44100; + } + ImGui::Checkbox("loop",&zsmExportLoop); + ImGui::SameLine(); + ImGui::Checkbox("optimize size",&zsmExportOptimize); + ImGui::SameLine(); + if (ImGui::Button("Begin Export")) { + openFileDialog(GUI_FILE_EXPORT_ZSM); + ImGui::CloseCurrentPopup(); + } + ImGui::EndMenu(); + } + } + int numAmiga=0; + for (int i=0; isong.systemLen; i++) { + if (e->song.system[i]==DIV_SYSTEM_AMIGA) numAmiga++; + } + if (numAmiga && settings.iCannotWait) { + if (ImGui::BeginMenu("export Amiga validation data...")) { + exitDisabledTimer=1; + ImGui::Text( + "this is NOT ROM export! only use for making sure the\n" + "Furnace Amiga emulator is working properly by\n" + "comparing it with real Amiga output." + ); + ImGui::AlignTextToFramePadding(); + ImGui::Text("Directory"); + ImGui::SameLine(); + ImGui::InputText("##AVDPath",&workingDirROMExport); + if (ImGui::Button("Bake Data")) { + std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); + if (workingDirROMExport.size()>0) { + if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; + } + for (DivROMExportOutput& i: out) { + String path=workingDirROMExport+i.name; + FILE* outFile=ps_fopen(path.c_str(),"wb"); + if (outFile!=NULL) { + fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); + fclose(outFile); + } + i.data->finish(); + delete i.data; + } + showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); + ImGui::CloseCurrentPopup(); + } + ImGui::EndMenu(); + } + } + if (ImGui::BeginMenu("export text...")) { exitDisabledTimer=1; ImGui::Text( - "this is NOT ROM export! only use for making sure the\n" - "Furnace Amiga emulator is working properly by\n" - "comparing it with real Amiga output." + "this option exports the song to a text file.\n" ); - ImGui::AlignTextToFramePadding(); - ImGui::Text("Directory"); - ImGui::SameLine(); - ImGui::InputText("##AVDPath",&workingDirROMExport); - if (ImGui::Button("Bake Data")) { - std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); - if (workingDirROMExport.size()>0) { - if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; - } - for (DivROMExportOutput& i: out) { - String path=workingDirROMExport+i.name; - FILE* outFile=ps_fopen(path.c_str(),"wb"); - if (outFile!=NULL) { - fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); - fclose(outFile); - } - i.data->finish(); - delete i.data; - } - showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); - ImGui::CloseCurrentPopup(); + if (ImGui::Button("export")) { + openFileDialog(GUI_FILE_EXPORT_TEXT); } ImGui::EndMenu(); } - } - if (ImGui::BeginMenu("export text...")) { - exitDisabledTimer=1; - ImGui::Text( - "this option exports the song to a text file.\n" - ); - if (ImGui::Button("export")) { - openFileDialog(GUI_FILE_EXPORT_TEXT); - } - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("export command stream...")) { - exitDisabledTimer=1; - ImGui::Text( - "this option exports a text or binary file which\n" - "contains a dump of the internal command stream\n" - "produced when playing the song.\n\n" + if (ImGui::BeginMenu("export command stream...")) { + exitDisabledTimer=1; + ImGui::Text( + "this option exports a text or binary file which\n" + "contains a dump of the internal command stream\n" + "produced when playing the song.\n\n" - "technical/development use only!" - ); - if (ImGui::Button("export (binary)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); + "technical/development use only!" + ); + if (ImGui::Button("export (binary)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); + } + if (ImGui::Button("export (text)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); + } + ImGui::EndMenu(); } - if (ImGui::Button("export (text)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); + } else { + if (ImGui::MenuItem("export...",BIND_FOR(GUI_ACTION_EXPORT))) { + displayExport=true; } - ImGui::EndMenu(); } ImGui::Separator(); if (!settings.classicChipOptions) { @@ -5453,6 +5459,11 @@ bool FurnaceGUI::loop() { } } + if (displayExport) { + displayExport=false; + ImGui::OpenPopup("Export"); + } + if (displayEditString) { ImGui::OpenPopup("EditString"); } @@ -5494,6 +5505,15 @@ bool FurnaceGUI::loop() { ImGui::EndPopup(); } + if (ImGui::BeginPopupModal("Export",NULL,ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoScrollbar)) { + ImGui::SetWindowPos(ImVec2(((canvasW)-ImGui::GetWindowSize().x)*0.5,((canvasH)-ImGui::GetWindowSize().y)*0.5)); + if (ImGui::GetWindowSize().xgetConfInt("centerPopup",1); settings.insIconsStyle=e->getConfInt("insIconsStyle",1); settings.classicChipOptions=e->getConfInt("classicChipOptions",0); + settings.classicExportOptions=e->getConfInt("classicExportOptions",0); settings.wasapiEx=e->getConfInt("wasapiEx",0); settings.chanOscThreads=e->getConfInt("chanOscThreads",0); settings.renderPoolThreads=e->getConfInt("renderPoolThreads",0); @@ -3953,6 +3961,7 @@ void FurnaceGUI::syncSettings() { clampSetting(settings.centerPopup,0,1); clampSetting(settings.insIconsStyle,0,2); clampSetting(settings.classicChipOptions,0,1); + clampSetting(settings.classicExportOptions,0,1); clampSetting(settings.wasapiEx,0,1); clampSetting(settings.chanOscThreads,0,256); clampSetting(settings.renderPoolThreads,0,DIV_MAX_CHIPS); @@ -4232,6 +4241,7 @@ void FurnaceGUI::commitSettings() { e->setConf("centerPopup",settings.centerPopup); e->setConf("insIconsStyle",settings.insIconsStyle); e->setConf("classicChipOptions",settings.classicChipOptions); + e->setConf("classicExportOptions",settings.classicExportOptions); e->setConf("wasapiEx",settings.wasapiEx); e->setConf("chanOscThreads",settings.chanOscThreads); e->setConf("renderPoolThreads",settings.renderPoolThreads); From b90132d7330876b63a34ae0916014b70f20caa08 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Tue, 5 Dec 2023 16:42:08 +0400 Subject: [PATCH 2/8] the export types wtf is settings.iCannotWait ??? --- src/gui/exportWin.cpp | 208 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 207 insertions(+), 1 deletion(-) diff --git a/src/gui/exportWin.cpp b/src/gui/exportWin.cpp index 6e2c8b559..796412ba3 100644 --- a/src/gui/exportWin.cpp +++ b/src/gui/exportWin.cpp @@ -18,7 +18,213 @@ */ #include "gui.h" +#include "guiConst.h" +#include "../fileutils.h" +#include "misc/cpp/imgui_stdlib.h" void FurnaceGUI::drawExport() { - if (ImGui::Button("dummy")) ImGui::CloseCurrentPopup(); + exitDisabledTimer=1; + if (ImGui::BeginTabBar("ExportTypes")) { + if (ImGui::BeginTabItem("Audio")) { + static int audioExportType=0; + ImGui::RadioButton("one file",&audioExportType,0); + ImGui::RadioButton("multiple files (one per chip)",&audioExportType,1); + ImGui::RadioButton("multiple files (one per channel)",&audioExportType,2); + if (ImGui::InputInt("Loops",&exportLoops,1,2)) { + if (exportLoops<0) exportLoops=0; + } + if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { + if (exportFadeOut<0.0) exportFadeOut=0.0; + } + + if (ImGui::Button("Export")) { + switch (audioExportType) { + case 0: + openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); + break; + case 1: + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); + break; + case 2: + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); + break; + } + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("VGM")) { + ImGui::Text("settings:"); + if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { + for (int i=0; i<7; i++) { + if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { + vgmExportVersion=vgmVersions[i]; + } + } + ImGui::EndCombo(); + } + ImGui::Checkbox("loop",&vgmExportLoop); + if (vgmExportLoop && e->song.loopModality==2) { + ImGui::Text("loop trail:"); + ImGui::Indent(); + if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { + vgmExportTrailingTicks=-1; + } + if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { + vgmExportTrailingTicks=-2; + } + if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { + vgmExportTrailingTicks=0; + } + if (vgmExportTrailingTicks>=0) { + ImGui::SameLine(); + if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { + if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; + } + } + ImGui::Unindent(); + } + ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "inserts data blocks on pattern changes.\n" + "useful if you are writing a playback routine.\n\n" + + "the format of a pattern change data block is:\n" + "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" + "- ll: length, a 32-bit little-endian number\n" + "- oo: order\n" + "- rr: initial row (a 0Dxx effect is able to select a different row)\n" + "- pp: pattern index (one per channel)\n\n" + + "pattern indexes are ordered as they appear in the song." + ); + } + ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "required for DualPCM and MSM6258 export.\n\n" + "allows for volume/direction changes when playing samples,\n" + "at the cost of a massive increase in file size." + ); + } + ImGui::Text("chips to export:"); + bool hasOneAtLeast=false; + for (int i=0; isong.systemLen; i++) { + int minVersion=e->minVGMVersion(e->song.system[i]); + ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); + ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); + ImGui::EndDisabled(); + if (minVersion>vgmExportVersion) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); + } + } else if (minVersion==0) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is not supported by the VGM format!"); + } + } else { + if (willExport[i]) hasOneAtLeast=true; + } + } + ImGui::Text("select the chip you wish to export, but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); + if (hasOneAtLeast) { + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_VGM); + ImGui::CloseCurrentPopup(); + } + } else { + ImGui::Text("nothing to export"); + } + ImGui::EndTabItem(); + } + int numZSMCompat=0; + for (int i=0; isong.systemLen; i++) { + if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; + } + if (numZSMCompat > 0) { + if (ImGui::BeginTabItem("ZSM")) { + ImGui::Text("Commander X16 Zsound Music File"); + if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { + if (zsmExportTickRate<1) zsmExportTickRate=1; + if (zsmExportTickRate>44100) zsmExportTickRate=44100; + } + ImGui::Checkbox("loop",&zsmExportLoop); + ImGui::SameLine(); + ImGui::Checkbox("optimize size",&zsmExportOptimize); + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_ZSM); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } + } + int numAmiga=0; + for (int i=0; isong.systemLen; i++) { + if (e->song.system[i]==DIV_SYSTEM_AMIGA) numAmiga++; + } + if (numAmiga && settings.iCannotWait) { + if (ImGui::BeginTabItem("Amiga Validation")) { + ImGui::Text( + "this is NOT ROM export! only use for making sure the\n" + "Furnace Amiga emulator is working properly by\n" + "comparing it with real Amiga output." + ); + ImGui::AlignTextToFramePadding(); + ImGui::Text("Directory"); + ImGui::SameLine(); + ImGui::InputText("##AVDPath",&workingDirROMExport); + if (ImGui::Button("Bake Data")) { + std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); + if (workingDirROMExport.size()>0) { + if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; + } + for (DivROMExportOutput& i: out) { + String path=workingDirROMExport+i.name; + FILE* outFile=ps_fopen(path.c_str(),"wb"); + if (outFile!=NULL) { + fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); + fclose(outFile); + } + i.data->finish(); + delete i.data; + } + showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } + } + if (ImGui::BeginTabItem("Text")) { + ImGui::Text( + "this option exports the song to a text file.\n" + ); + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_TEXT); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Command Stream")) { + ImGui::Text( + "this option exports a text or binary file which\n" + "contains a dump of the internal command stream\n" + "produced when playing the song.\n\n" + + "technical/development use only!" + ); + if (ImGui::Button("Export (binary)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); + ImGui::CloseCurrentPopup(); + } + if (ImGui::Button("Export (text)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } + ImGui::EndTabBar(); + } + ImGui::Separator(); + if (ImGui::Button("Cancel")) ImGui::CloseCurrentPopup(); } From d2ca97c57a09a06893135fe0559a908c8f642e00 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Tue, 5 Dec 2023 18:00:14 +0400 Subject: [PATCH 3/8] put the types in a child now the cancel button is neatly at the bottom :) --- src/gui/exportWin.cpp | 361 +++++++++++++++++++++--------------------- 1 file changed, 184 insertions(+), 177 deletions(-) diff --git a/src/gui/exportWin.cpp b/src/gui/exportWin.cpp index 796412ba3..ed1cc2f34 100644 --- a/src/gui/exportWin.cpp +++ b/src/gui/exportWin.cpp @@ -24,206 +24,213 @@ void FurnaceGUI::drawExport() { exitDisabledTimer=1; - if (ImGui::BeginTabBar("ExportTypes")) { - if (ImGui::BeginTabItem("Audio")) { - static int audioExportType=0; - ImGui::RadioButton("one file",&audioExportType,0); - ImGui::RadioButton("multiple files (one per chip)",&audioExportType,1); - ImGui::RadioButton("multiple files (one per channel)",&audioExportType,2); - if (ImGui::InputInt("Loops",&exportLoops,1,2)) { - if (exportLoops<0) exportLoops=0; - } - if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { - if (exportFadeOut<0.0) exportFadeOut=0.0; - } - if (ImGui::Button("Export")) { - switch (audioExportType) { - case 0: - openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); - break; - case 1: - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); - break; - case 2: - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); - break; + ImVec2 avail=ImGui::GetContentRegionAvail(); + avail.y-=ImGui::GetFrameHeightWithSpacing(); + + if (ImGui::BeginChild("sysPickerC",avail,false,ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoScrollbar)) { + if (ImGui::BeginTabBar("ExportTypes")) { + if (ImGui::BeginTabItem("Audio")) { + static int audioExportType=0; + ImGui::RadioButton("one file",&audioExportType,0); + ImGui::RadioButton("multiple files (one per chip)",&audioExportType,1); + ImGui::RadioButton("multiple files (one per channel)",&audioExportType,2); + if (ImGui::InputInt("Loops",&exportLoops,1,2)) { + if (exportLoops<0) exportLoops=0; } - ImGui::CloseCurrentPopup(); + if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { + if (exportFadeOut<0.0) exportFadeOut=0.0; + } + + if (ImGui::Button("Export")) { + switch (audioExportType) { + case 0: + openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); + break; + case 1: + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); + break; + case 2: + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); + break; + } + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); } - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("VGM")) { - ImGui::Text("settings:"); - if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { - for (int i=0; i<7; i++) { - if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { - vgmExportVersion=vgmVersions[i]; + if (ImGui::BeginTabItem("VGM")) { + ImGui::Text("settings:"); + if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { + for (int i=0; i<7; i++) { + if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { + vgmExportVersion=vgmVersions[i]; + } } + ImGui::EndCombo(); } - ImGui::EndCombo(); - } - ImGui::Checkbox("loop",&vgmExportLoop); - if (vgmExportLoop && e->song.loopModality==2) { - ImGui::Text("loop trail:"); - ImGui::Indent(); - if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { - vgmExportTrailingTicks=-1; - } - if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { - vgmExportTrailingTicks=-2; - } - if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { - vgmExportTrailingTicks=0; - } - if (vgmExportTrailingTicks>=0) { - ImGui::SameLine(); - if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { - if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; + ImGui::Checkbox("loop",&vgmExportLoop); + if (vgmExportLoop && e->song.loopModality==2) { + ImGui::Text("loop trail:"); + ImGui::Indent(); + if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { + vgmExportTrailingTicks=-1; } + if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { + vgmExportTrailingTicks=-2; + } + if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { + vgmExportTrailingTicks=0; + } + if (vgmExportTrailingTicks>=0) { + ImGui::SameLine(); + if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { + if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; + } + } + ImGui::Unindent(); } - ImGui::Unindent(); - } - ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "inserts data blocks on pattern changes.\n" - "useful if you are writing a playback routine.\n\n" + ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "inserts data blocks on pattern changes.\n" + "useful if you are writing a playback routine.\n\n" - "the format of a pattern change data block is:\n" - "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" - "- ll: length, a 32-bit little-endian number\n" - "- oo: order\n" - "- rr: initial row (a 0Dxx effect is able to select a different row)\n" - "- pp: pattern index (one per channel)\n\n" + "the format of a pattern change data block is:\n" + "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" + "- ll: length, a 32-bit little-endian number\n" + "- oo: order\n" + "- rr: initial row (a 0Dxx effect is able to select a different row)\n" + "- pp: pattern index (one per channel)\n\n" - "pattern indexes are ordered as they appear in the song." - ); - } - ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "required for DualPCM and MSM6258 export.\n\n" - "allows for volume/direction changes when playing samples,\n" - "at the cost of a massive increase in file size." - ); - } - ImGui::Text("chips to export:"); - bool hasOneAtLeast=false; - for (int i=0; isong.systemLen; i++) { - int minVersion=e->minVGMVersion(e->song.system[i]); - ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); - ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); - ImGui::EndDisabled(); - if (minVersion>vgmExportVersion) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); + "pattern indexes are ordered as they appear in the song." + ); + } + ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "required for DualPCM and MSM6258 export.\n\n" + "allows for volume/direction changes when playing samples,\n" + "at the cost of a massive increase in file size." + ); + } + ImGui::Text("chips to export:"); + bool hasOneAtLeast=false; + for (int i=0; isong.systemLen; i++) { + int minVersion=e->minVGMVersion(e->song.system[i]); + ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); + ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); + ImGui::EndDisabled(); + if (minVersion>vgmExportVersion) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); + } + } else if (minVersion==0) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is not supported by the VGM format!"); + } + } else { + if (willExport[i]) hasOneAtLeast=true; } - } else if (minVersion==0) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is not supported by the VGM format!"); + } + ImGui::Text("select the chip you wish to export, but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); + if (hasOneAtLeast) { + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_VGM); + ImGui::CloseCurrentPopup(); } } else { - if (willExport[i]) hasOneAtLeast=true; + ImGui::Text("nothing to export"); } - } - ImGui::Text("select the chip you wish to export, but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); - if (hasOneAtLeast) { - if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_VGM); - ImGui::CloseCurrentPopup(); - } - } else { - ImGui::Text("nothing to export"); - } - ImGui::EndTabItem(); - } - int numZSMCompat=0; - for (int i=0; isong.systemLen; i++) { - if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; - } - if (numZSMCompat > 0) { - if (ImGui::BeginTabItem("ZSM")) { - ImGui::Text("Commander X16 Zsound Music File"); - if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { - if (zsmExportTickRate<1) zsmExportTickRate=1; - if (zsmExportTickRate>44100) zsmExportTickRate=44100; - } - ImGui::Checkbox("loop",&zsmExportLoop); - ImGui::SameLine(); - ImGui::Checkbox("optimize size",&zsmExportOptimize); - if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_ZSM); - ImGui::CloseCurrentPopup(); - } ImGui::EndTabItem(); } - } - int numAmiga=0; - for (int i=0; isong.systemLen; i++) { - if (e->song.system[i]==DIV_SYSTEM_AMIGA) numAmiga++; - } - if (numAmiga && settings.iCannotWait) { - if (ImGui::BeginTabItem("Amiga Validation")) { + int numZSMCompat=0; + for (int i=0; isong.systemLen; i++) { + if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; + } + if (numZSMCompat > 0) { + if (ImGui::BeginTabItem("ZSM")) { + ImGui::Text("Commander X16 Zsound Music File"); + if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { + if (zsmExportTickRate<1) zsmExportTickRate=1; + if (zsmExportTickRate>44100) zsmExportTickRate=44100; + } + ImGui::Checkbox("loop",&zsmExportLoop); + ImGui::SameLine(); + ImGui::Checkbox("optimize size",&zsmExportOptimize); + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_ZSM); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } + } + int numAmiga=0; + for (int i=0; isong.systemLen; i++) { + if (e->song.system[i]==DIV_SYSTEM_AMIGA) numAmiga++; + } + if (numAmiga && settings.iCannotWait) { + if (ImGui::BeginTabItem("Amiga Validation")) { + ImGui::Text( + "this is NOT ROM export! only use for making sure the\n" + "Furnace Amiga emulator is working properly by\n" + "comparing it with real Amiga output." + ); + ImGui::AlignTextToFramePadding(); + ImGui::Text("Directory"); + ImGui::SameLine(); + ImGui::InputText("##AVDPath",&workingDirROMExport); + if (ImGui::Button("Bake Data")) { + std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); + if (workingDirROMExport.size()>0) { + if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; + } + for (DivROMExportOutput& i: out) { + String path=workingDirROMExport+i.name; + FILE* outFile=ps_fopen(path.c_str(),"wb"); + if (outFile!=NULL) { + fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); + fclose(outFile); + } + i.data->finish(); + delete i.data; + } + showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } + } + if (ImGui::BeginTabItem("Text")) { ImGui::Text( - "this is NOT ROM export! only use for making sure the\n" - "Furnace Amiga emulator is working properly by\n" - "comparing it with real Amiga output." + "this option exports the song to a text file.\n" ); - ImGui::AlignTextToFramePadding(); - ImGui::Text("Directory"); - ImGui::SameLine(); - ImGui::InputText("##AVDPath",&workingDirROMExport); - if (ImGui::Button("Bake Data")) { - std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); - if (workingDirROMExport.size()>0) { - if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; - } - for (DivROMExportOutput& i: out) { - String path=workingDirROMExport+i.name; - FILE* outFile=ps_fopen(path.c_str(),"wb"); - if (outFile!=NULL) { - fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); - fclose(outFile); - } - i.data->finish(); - delete i.data; - } - showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_TEXT); ImGui::CloseCurrentPopup(); } ImGui::EndTabItem(); } - } - if (ImGui::BeginTabItem("Text")) { - ImGui::Text( - "this option exports the song to a text file.\n" - ); - if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_TEXT); - ImGui::CloseCurrentPopup(); - } - ImGui::EndTabItem(); - } - if (ImGui::BeginTabItem("Command Stream")) { - ImGui::Text( - "this option exports a text or binary file which\n" - "contains a dump of the internal command stream\n" - "produced when playing the song.\n\n" + if (ImGui::BeginTabItem("Command Stream")) { + ImGui::Text( + "this option exports a text or binary file which\n" + "contains a dump of the internal command stream\n" + "produced when playing the song.\n\n" - "technical/development use only!" - ); - if (ImGui::Button("Export (binary)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); - ImGui::CloseCurrentPopup(); + "technical/development use only!" + ); + if (ImGui::Button("Export (binary)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); + ImGui::CloseCurrentPopup(); + } + if (ImGui::Button("Export (text)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); } - if (ImGui::Button("Export (text)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); - ImGui::CloseCurrentPopup(); - } - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); + ImGui::EndTabBar(); + } + ImGui::EndChild(); } ImGui::Separator(); if (ImGui::Button("Cancel")) ImGui::CloseCurrentPopup(); From 594eb55942398d874e32f689cd8d61e8a259e454 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Wed, 6 Dec 2023 15:50:19 +0400 Subject: [PATCH 4/8] rename the file --- CMakeLists.txt | 2 +- src/gui/{exportWin.cpp => exportOptions.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/gui/{exportWin.cpp => exportOptions.cpp} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5336f3131..ed571d76c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -779,7 +779,7 @@ src/gui/doAction.cpp src/gui/editing.cpp src/gui/editControls.cpp src/gui/effectList.cpp -src/gui/exportWin.cpp +src/gui/exportOptions.cpp src/gui/findReplace.cpp src/gui/fmPreview.cpp src/gui/gradient.cpp diff --git a/src/gui/exportWin.cpp b/src/gui/exportOptions.cpp similarity index 100% rename from src/gui/exportWin.cpp rename to src/gui/exportOptions.cpp From 96ad124100ea73dffa1086020c78902e9e9c00ea Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Fri, 8 Dec 2023 16:08:31 +0400 Subject: [PATCH 5/8] make a member of FurnaceGUI --- src/gui/exportOptions.cpp | 1 - src/gui/gui.cpp | 4 +++- src/gui/gui.h | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/exportOptions.cpp b/src/gui/exportOptions.cpp index ed1cc2f34..ab3323c0f 100644 --- a/src/gui/exportOptions.cpp +++ b/src/gui/exportOptions.cpp @@ -31,7 +31,6 @@ void FurnaceGUI::drawExport() { if (ImGui::BeginChild("sysPickerC",avail,false,ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoScrollbar)) { if (ImGui::BeginTabBar("ExportTypes")) { if (ImGui::BeginTabItem("Audio")) { - static int audioExportType=0; ImGui::RadioButton("one file",&audioExportType,0); ImGui::RadioButton("multiple files (one per chip)",&audioExportType,1); ImGui::RadioButton("multiple files (one per channel)",&audioExportType,2); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 99c7297ab..95b506891 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -7688,7 +7688,9 @@ FurnaceGUI::FurnaceGUI(): introSkipDo(false), introStopped(false), curTutorial(-1), - curTutorialStep(0) { + curTutorialStep(0), + //audio export types (export options) + audioExportType(0) { // value keys valueKeys[SDLK_0]=0; valueKeys[SDLK_1]=1; diff --git a/src/gui/gui.h b/src/gui/gui.h index c9af9bd95..9e203ebca 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2267,6 +2267,9 @@ class FurnaceGUI { // tutorial int curTutorial, curTutorialStep; + //audio export types (export options) + int audioExportType; + void drawSSGEnv(unsigned char type, const ImVec2& size); void drawWaveform(unsigned char type, bool opz, const ImVec2& size); void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size); From d347c85e1b5be1b556ee493c10f4a41c89d771b7 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Fri, 8 Dec 2023 23:06:56 +0400 Subject: [PATCH 6/8] remove extra indent --- src/gui/exportOptions.cpp | 348 +++++++++++++++++++------------------- 1 file changed, 174 insertions(+), 174 deletions(-) diff --git a/src/gui/exportOptions.cpp b/src/gui/exportOptions.cpp index ab3323c0f..4e3982dec 100644 --- a/src/gui/exportOptions.cpp +++ b/src/gui/exportOptions.cpp @@ -30,203 +30,203 @@ void FurnaceGUI::drawExport() { if (ImGui::BeginChild("sysPickerC",avail,false,ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoScrollbar)) { if (ImGui::BeginTabBar("ExportTypes")) { - if (ImGui::BeginTabItem("Audio")) { - ImGui::RadioButton("one file",&audioExportType,0); - ImGui::RadioButton("multiple files (one per chip)",&audioExportType,1); - ImGui::RadioButton("multiple files (one per channel)",&audioExportType,2); - if (ImGui::InputInt("Loops",&exportLoops,1,2)) { - if (exportLoops<0) exportLoops=0; - } - if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { - if (exportFadeOut<0.0) exportFadeOut=0.0; - } + if (ImGui::BeginTabItem("Audio")) { + ImGui::RadioButton("one file",&audioExportType,0); + ImGui::RadioButton("multiple files (one per chip)",&audioExportType,1); + ImGui::RadioButton("multiple files (one per channel)",&audioExportType,2); + if (ImGui::InputInt("Loops",&exportLoops,1,2)) { + if (exportLoops<0) exportLoops=0; + } + if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { + if (exportFadeOut<0.0) exportFadeOut=0.0; + } - if (ImGui::Button("Export")) { - switch (audioExportType) { - case 0: - openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); - break; - case 1: - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); - break; - case 2: - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); - break; - } - ImGui::CloseCurrentPopup(); + if (ImGui::Button("Export")) { + switch (audioExportType) { + case 0: + openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); + break; + case 1: + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); + break; + case 2: + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); + break; } - ImGui::EndTabItem(); + ImGui::CloseCurrentPopup(); } - if (ImGui::BeginTabItem("VGM")) { - ImGui::Text("settings:"); - if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { - for (int i=0; i<7; i++) { - if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { - vgmExportVersion=vgmVersions[i]; - } - } - ImGui::EndCombo(); + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("VGM")) { + ImGui::Text("settings:"); + if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { + for (int i=0; i<7; i++) { + if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { + vgmExportVersion=vgmVersions[i]; } - ImGui::Checkbox("loop",&vgmExportLoop); - if (vgmExportLoop && e->song.loopModality==2) { - ImGui::Text("loop trail:"); - ImGui::Indent(); - if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { - vgmExportTrailingTicks=-1; - } - if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { - vgmExportTrailingTicks=-2; - } - if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { - vgmExportTrailingTicks=0; - } - if (vgmExportTrailingTicks>=0) { - ImGui::SameLine(); - if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { - if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; - } - } - ImGui::Unindent(); - } - ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "inserts data blocks on pattern changes.\n" - "useful if you are writing a playback routine.\n\n" - - "the format of a pattern change data block is:\n" - "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" - "- ll: length, a 32-bit little-endian number\n" - "- oo: order\n" - "- rr: initial row (a 0Dxx effect is able to select a different row)\n" - "- pp: pattern index (one per channel)\n\n" - - "pattern indexes are ordered as they appear in the song." - ); - } - ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "required for DualPCM and MSM6258 export.\n\n" - "allows for volume/direction changes when playing samples,\n" - "at the cost of a massive increase in file size." - ); - } - ImGui::Text("chips to export:"); - bool hasOneAtLeast=false; - for (int i=0; isong.systemLen; i++) { - int minVersion=e->minVGMVersion(e->song.system[i]); - ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); - ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); - ImGui::EndDisabled(); - if (minVersion>vgmExportVersion) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); - } - } else if (minVersion==0) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is not supported by the VGM format!"); - } - } else { - if (willExport[i]) hasOneAtLeast=true; - } - } - ImGui::Text("select the chip you wish to export, but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); - if (hasOneAtLeast) { - if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_VGM); - ImGui::CloseCurrentPopup(); - } - } else { - ImGui::Text("nothing to export"); - } - ImGui::EndTabItem(); - } - int numZSMCompat=0; - for (int i=0; isong.systemLen; i++) { - if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; - } - if (numZSMCompat > 0) { - if (ImGui::BeginTabItem("ZSM")) { - ImGui::Text("Commander X16 Zsound Music File"); - if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { - if (zsmExportTickRate<1) zsmExportTickRate=1; - if (zsmExportTickRate>44100) zsmExportTickRate=44100; } - ImGui::Checkbox("loop",&zsmExportLoop); - ImGui::SameLine(); - ImGui::Checkbox("optimize size",&zsmExportOptimize); - if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_ZSM); - ImGui::CloseCurrentPopup(); - } - ImGui::EndTabItem(); + ImGui::EndCombo(); } - } - int numAmiga=0; - for (int i=0; isong.systemLen; i++) { - if (e->song.system[i]==DIV_SYSTEM_AMIGA) numAmiga++; - } - if (numAmiga && settings.iCannotWait) { - if (ImGui::BeginTabItem("Amiga Validation")) { - ImGui::Text( - "this is NOT ROM export! only use for making sure the\n" - "Furnace Amiga emulator is working properly by\n" - "comparing it with real Amiga output." + ImGui::Checkbox("loop",&vgmExportLoop); + if (vgmExportLoop && e->song.loopModality==2) { + ImGui::Text("loop trail:"); + ImGui::Indent(); + if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { + vgmExportTrailingTicks=-1; + } + if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { + vgmExportTrailingTicks=-2; + } + if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { + vgmExportTrailingTicks=0; + } + if (vgmExportTrailingTicks>=0) { + ImGui::SameLine(); + if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { + if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; + } + } + ImGui::Unindent(); + } + ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "inserts data blocks on pattern changes.\n" + "useful if you are writing a playback routine.\n\n" + + "the format of a pattern change data block is:\n" + "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" + "- ll: length, a 32-bit little-endian number\n" + "- oo: order\n" + "- rr: initial row (a 0Dxx effect is able to select a different row)\n" + "- pp: pattern index (one per channel)\n\n" + + "pattern indexes are ordered as they appear in the song." ); - ImGui::AlignTextToFramePadding(); - ImGui::Text("Directory"); - ImGui::SameLine(); - ImGui::InputText("##AVDPath",&workingDirROMExport); - if (ImGui::Button("Bake Data")) { - std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); - if (workingDirROMExport.size()>0) { - if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; + } + ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "required for DualPCM and MSM6258 export.\n\n" + "allows for volume/direction changes when playing samples,\n" + "at the cost of a massive increase in file size." + ); + } + ImGui::Text("chips to export:"); + bool hasOneAtLeast=false; + for (int i=0; isong.systemLen; i++) { + int minVersion=e->minVGMVersion(e->song.system[i]); + ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); + ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); + ImGui::EndDisabled(); + if (minVersion>vgmExportVersion) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); } - for (DivROMExportOutput& i: out) { - String path=workingDirROMExport+i.name; - FILE* outFile=ps_fopen(path.c_str(),"wb"); - if (outFile!=NULL) { - fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); - fclose(outFile); - } - i.data->finish(); - delete i.data; + } else if (minVersion==0) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is not supported by the VGM format!"); } - showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); + } else { + if (willExport[i]) hasOneAtLeast=true; + } + } + ImGui::Text("select the chip you wish to export, but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); + if (hasOneAtLeast) { + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_VGM); ImGui::CloseCurrentPopup(); } - ImGui::EndTabItem(); + } else { + ImGui::Text("nothing to export"); } - } - if (ImGui::BeginTabItem("Text")) { - ImGui::Text( - "this option exports the song to a text file.\n" - ); + ImGui::EndTabItem(); + } + int numZSMCompat=0; + for (int i=0; isong.systemLen; i++) { + if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; + } + if (numZSMCompat > 0) { + if (ImGui::BeginTabItem("ZSM")) { + ImGui::Text("Commander X16 Zsound Music File"); + if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { + if (zsmExportTickRate<1) zsmExportTickRate=1; + if (zsmExportTickRate>44100) zsmExportTickRate=44100; + } + ImGui::Checkbox("loop",&zsmExportLoop); + ImGui::SameLine(); + ImGui::Checkbox("optimize size",&zsmExportOptimize); if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_TEXT); + openFileDialog(GUI_FILE_EXPORT_ZSM); ImGui::CloseCurrentPopup(); } ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("Command Stream")) { + } + int numAmiga=0; + for (int i=0; isong.systemLen; i++) { + if (e->song.system[i]==DIV_SYSTEM_AMIGA) numAmiga++; + } + if (numAmiga && settings.iCannotWait) { + if (ImGui::BeginTabItem("Amiga Validation")) { ImGui::Text( - "this option exports a text or binary file which\n" - "contains a dump of the internal command stream\n" - "produced when playing the song.\n\n" - - "technical/development use only!" + "this is NOT ROM export! only use for making sure the\n" + "Furnace Amiga emulator is working properly by\n" + "comparing it with real Amiga output." ); - if (ImGui::Button("Export (binary)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); - ImGui::CloseCurrentPopup(); - } - if (ImGui::Button("Export (text)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); + ImGui::AlignTextToFramePadding(); + ImGui::Text("Directory"); + ImGui::SameLine(); + ImGui::InputText("##AVDPath",&workingDirROMExport); + if (ImGui::Button("Bake Data")) { + std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); + if (workingDirROMExport.size()>0) { + if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; + } + for (DivROMExportOutput& i: out) { + String path=workingDirROMExport+i.name; + FILE* outFile=ps_fopen(path.c_str(),"wb"); + if (outFile!=NULL) { + fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); + fclose(outFile); + } + i.data->finish(); + delete i.data; + } + showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); ImGui::CloseCurrentPopup(); } ImGui::EndTabItem(); } + } + if (ImGui::BeginTabItem("Text")) { + ImGui::Text( + "this option exports the song to a text file.\n" + ); + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_TEXT); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } + if (ImGui::BeginTabItem("Command Stream")) { + ImGui::Text( + "this option exports a text or binary file which\n" + "contains a dump of the internal command stream\n" + "produced when playing the song.\n\n" + + "technical/development use only!" + ); + if (ImGui::Button("Export (binary)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); + ImGui::CloseCurrentPopup(); + } + if (ImGui::Button("Export (text)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); + ImGui::CloseCurrentPopup(); + } + ImGui::EndTabItem(); + } ImGui::EndTabBar(); } ImGui::EndChild(); From df3e3e8aeceb966a74e27492818ae53977671d39 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 21 Dec 2023 19:57:26 -0500 Subject: [PATCH 7/8] bunch of code de-duplication --- src/gui/exportOptions.cpp | 374 +++++++++++++++++++++----------------- src/gui/gui.cpp | 171 +---------------- src/gui/gui.h | 9 +- 3 files changed, 219 insertions(+), 335 deletions(-) diff --git a/src/gui/exportOptions.cpp b/src/gui/exportOptions.cpp index 4e3982dec..d5765fe2b 100644 --- a/src/gui/exportOptions.cpp +++ b/src/gui/exportOptions.cpp @@ -22,144 +22,224 @@ #include "../fileutils.h" #include "misc/cpp/imgui_stdlib.h" -void FurnaceGUI::drawExport() { +void FurnaceGUI::drawExportAudio() { exitDisabledTimer=1; + ImGui::RadioButton("one file",&audioExportType,0); + ImGui::RadioButton("multiple files (one per chip)",&audioExportType,1); + ImGui::RadioButton("multiple files (one per channel)",&audioExportType,2); + if (ImGui::InputInt("Loops",&exportLoops,1,2)) { + if (exportLoops<0) exportLoops=0; + } + if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { + if (exportFadeOut<0.0) exportFadeOut=0.0; + } + + if (ImGui::Button("Export")) { + switch (audioExportType) { + case 0: + openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); + break; + case 1: + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); + break; + case 2: + openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); + break; + } + ImGui::CloseCurrentPopup(); + } +} + +void FurnaceGUI::drawExportVGM() { + exitDisabledTimer=1; + + ImGui::Text("settings:"); + if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { + for (int i=0; i<7; i++) { + if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { + vgmExportVersion=vgmVersions[i]; + } + } + ImGui::EndCombo(); + } + ImGui::Checkbox("loop",&vgmExportLoop); + if (vgmExportLoop && e->song.loopModality==2) { + ImGui::Text("loop trail:"); + ImGui::Indent(); + if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { + vgmExportTrailingTicks=-1; + } + if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { + vgmExportTrailingTicks=-2; + } + if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { + vgmExportTrailingTicks=0; + } + if (vgmExportTrailingTicks>=0) { + ImGui::SameLine(); + if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { + if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; + } + } + ImGui::Unindent(); + } + ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "inserts data blocks on pattern changes.\n" + "useful if you are writing a playback routine.\n\n" + + "the format of a pattern change data block is:\n" + "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" + "- ll: length, a 32-bit little-endian number\n" + "- oo: order\n" + "- rr: initial row (a 0Dxx effect is able to select a different row)\n" + "- pp: pattern index (one per channel)\n\n" + + "pattern indexes are ordered as they appear in the song." + ); + } + ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip( + "required for DualPCM and MSM6258 export.\n\n" + "allows for volume/direction changes when playing samples,\n" + "at the cost of a massive increase in file size." + ); + } + ImGui::Text("chips to export:"); + bool hasOneAtLeast=false; + for (int i=0; isong.systemLen; i++) { + int minVersion=e->minVGMVersion(e->song.system[i]); + ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); + ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); + ImGui::EndDisabled(); + if (minVersion>vgmExportVersion) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); + } + } else if (minVersion==0) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { + ImGui::SetTooltip("this chip is not supported by the VGM format!"); + } + } else { + if (willExport[i]) hasOneAtLeast=true; + } + } + ImGui::Text("select the chip you wish to export, but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); + if (hasOneAtLeast) { + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_VGM); + ImGui::CloseCurrentPopup(); + } + } else { + ImGui::Text("nothing to export"); + } +} + +void FurnaceGUI::drawExportZSM() { + exitDisabledTimer=1; + + ImGui::Text("Commander X16 Zsound Music File"); + if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { + if (zsmExportTickRate<1) zsmExportTickRate=1; + if (zsmExportTickRate>44100) zsmExportTickRate=44100; + } + ImGui::Checkbox("loop",&zsmExportLoop); + ImGui::SameLine(); + ImGui::Checkbox("optimize size",&zsmExportOptimize); + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_ZSM); + ImGui::CloseCurrentPopup(); + } +} + +void FurnaceGUI::drawExportAmigaVal() { + exitDisabledTimer=1; + + ImGui::Text( + "this is NOT ROM export! only use for making sure the\n" + "Furnace Amiga emulator is working properly by\n" + "comparing it with real Amiga output." + ); + ImGui::AlignTextToFramePadding(); + ImGui::Text("Directory"); + ImGui::SameLine(); + ImGui::InputText("##AVDPath",&workingDirROMExport); + if (ImGui::Button("Bake Data")) { + std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); + if (workingDirROMExport.size()>0) { + if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; + } + for (DivROMExportOutput& i: out) { + String path=workingDirROMExport+i.name; + FILE* outFile=ps_fopen(path.c_str(),"wb"); + if (outFile!=NULL) { + fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); + fclose(outFile); + } + i.data->finish(); + delete i.data; + } + showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); + ImGui::CloseCurrentPopup(); + } +} + +void FurnaceGUI::drawExportText() { + exitDisabledTimer=1; + + ImGui::Text( + "this option exports the song to a text file.\n" + ); + if (ImGui::Button("Export")) { + openFileDialog(GUI_FILE_EXPORT_TEXT); + ImGui::CloseCurrentPopup(); + } +} + +void FurnaceGUI::drawExportCommand() { + exitDisabledTimer=1; + + ImGui::Text( + "this option exports a text or binary file which\n" + "contains a dump of the internal command stream\n" + "produced when playing the song.\n\n" + + "technical/development use only!" + ); + if (ImGui::Button("Export (binary)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); + ImGui::CloseCurrentPopup(); + } + if (ImGui::Button("Export (text)")) { + openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); + ImGui::CloseCurrentPopup(); + } +} + +void FurnaceGUI::drawExport() { ImVec2 avail=ImGui::GetContentRegionAvail(); avail.y-=ImGui::GetFrameHeightWithSpacing(); if (ImGui::BeginChild("sysPickerC",avail,false,ImGuiWindowFlags_NoScrollWithMouse|ImGuiWindowFlags_NoScrollbar)) { if (ImGui::BeginTabBar("ExportTypes")) { if (ImGui::BeginTabItem("Audio")) { - ImGui::RadioButton("one file",&audioExportType,0); - ImGui::RadioButton("multiple files (one per chip)",&audioExportType,1); - ImGui::RadioButton("multiple files (one per channel)",&audioExportType,2); - if (ImGui::InputInt("Loops",&exportLoops,1,2)) { - if (exportLoops<0) exportLoops=0; - } - if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { - if (exportFadeOut<0.0) exportFadeOut=0.0; - } - - if (ImGui::Button("Export")) { - switch (audioExportType) { - case 0: - openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); - break; - case 1: - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); - break; - case 2: - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); - break; - } - ImGui::CloseCurrentPopup(); - } + drawExportAudio(); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("VGM")) { - ImGui::Text("settings:"); - if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { - for (int i=0; i<7; i++) { - if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { - vgmExportVersion=vgmVersions[i]; - } - } - ImGui::EndCombo(); - } - ImGui::Checkbox("loop",&vgmExportLoop); - if (vgmExportLoop && e->song.loopModality==2) { - ImGui::Text("loop trail:"); - ImGui::Indent(); - if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { - vgmExportTrailingTicks=-1; - } - if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { - vgmExportTrailingTicks=-2; - } - if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { - vgmExportTrailingTicks=0; - } - if (vgmExportTrailingTicks>=0) { - ImGui::SameLine(); - if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { - if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; - } - } - ImGui::Unindent(); - } - ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "inserts data blocks on pattern changes.\n" - "useful if you are writing a playback routine.\n\n" - - "the format of a pattern change data block is:\n" - "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" - "- ll: length, a 32-bit little-endian number\n" - "- oo: order\n" - "- rr: initial row (a 0Dxx effect is able to select a different row)\n" - "- pp: pattern index (one per channel)\n\n" - - "pattern indexes are ordered as they appear in the song." - ); - } - ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "required for DualPCM and MSM6258 export.\n\n" - "allows for volume/direction changes when playing samples,\n" - "at the cost of a massive increase in file size." - ); - } - ImGui::Text("chips to export:"); - bool hasOneAtLeast=false; - for (int i=0; isong.systemLen; i++) { - int minVersion=e->minVGMVersion(e->song.system[i]); - ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); - ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); - ImGui::EndDisabled(); - if (minVersion>vgmExportVersion) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); - } - } else if (minVersion==0) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is not supported by the VGM format!"); - } - } else { - if (willExport[i]) hasOneAtLeast=true; - } - } - ImGui::Text("select the chip you wish to export, but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); - if (hasOneAtLeast) { - if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_VGM); - ImGui::CloseCurrentPopup(); - } - } else { - ImGui::Text("nothing to export"); - } + drawExportVGM(); ImGui::EndTabItem(); } int numZSMCompat=0; for (int i=0; isong.systemLen; i++) { - if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; + if ((e->song.system[i]==DIV_SYSTEM_VERA) || (e->song.system[i]==DIV_SYSTEM_YM2151)) numZSMCompat++; } - if (numZSMCompat > 0) { + if (numZSMCompat>0) { if (ImGui::BeginTabItem("ZSM")) { - ImGui::Text("Commander X16 Zsound Music File"); - if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) { - if (zsmExportTickRate<1) zsmExportTickRate=1; - if (zsmExportTickRate>44100) zsmExportTickRate=44100; - } - ImGui::Checkbox("loop",&zsmExportLoop); - ImGui::SameLine(); - ImGui::Checkbox("optimize size",&zsmExportOptimize); - if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_ZSM); - ImGui::CloseCurrentPopup(); - } + drawExportZSM(); ImGui::EndTabItem(); } } @@ -169,62 +249,16 @@ void FurnaceGUI::drawExport() { } if (numAmiga && settings.iCannotWait) { if (ImGui::BeginTabItem("Amiga Validation")) { - ImGui::Text( - "this is NOT ROM export! only use for making sure the\n" - "Furnace Amiga emulator is working properly by\n" - "comparing it with real Amiga output." - ); - ImGui::AlignTextToFramePadding(); - ImGui::Text("Directory"); - ImGui::SameLine(); - ImGui::InputText("##AVDPath",&workingDirROMExport); - if (ImGui::Button("Bake Data")) { - std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); - if (workingDirROMExport.size()>0) { - if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; - } - for (DivROMExportOutput& i: out) { - String path=workingDirROMExport+i.name; - FILE* outFile=ps_fopen(path.c_str(),"wb"); - if (outFile!=NULL) { - fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); - fclose(outFile); - } - i.data->finish(); - delete i.data; - } - showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); - ImGui::CloseCurrentPopup(); - } + drawExportAmigaVal(); ImGui::EndTabItem(); } } if (ImGui::BeginTabItem("Text")) { - ImGui::Text( - "this option exports the song to a text file.\n" - ); - if (ImGui::Button("Export")) { - openFileDialog(GUI_FILE_EXPORT_TEXT); - ImGui::CloseCurrentPopup(); - } + drawExportText(); ImGui::EndTabItem(); } if (ImGui::BeginTabItem("Command Stream")) { - ImGui::Text( - "this option exports a text or binary file which\n" - "contains a dump of the internal command stream\n" - "produced when playing the song.\n\n" - - "technical/development use only!" - ); - if (ImGui::Button("Export (binary)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); - ImGui::CloseCurrentPopup(); - } - if (ImGui::Button("Export (text)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); - ImGui::CloseCurrentPopup(); - } + drawExportCommand(); ImGui::EndTabItem(); } ImGui::EndTabBar(); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index dc3c61d91..98e824f35 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -4103,130 +4103,20 @@ bool FurnaceGUI::loop() { ImGui::Separator(); if (settings.classicExportOptions) { if (ImGui::BeginMenu("export audio...")) { - exitDisabledTimer=1; - if (ImGui::MenuItem("one file")) { - openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE); - } - if (ImGui::MenuItem("multiple files (one per chip)")) { - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_SYS); - } - if (ImGui::MenuItem("multiple files (one per channel)")) { - openFileDialog(GUI_FILE_EXPORT_AUDIO_PER_CHANNEL); - } - if (ImGui::InputInt("Loops",&exportLoops,1,2)) { - if (exportLoops<0) exportLoops=0; - } - if (ImGui::InputDouble("Fade out (seconds)",&exportFadeOut,1.0,2.0,"%.1f")) { - if (exportFadeOut<0.0) exportFadeOut=0.0; - } + drawExportAudio(); ImGui::EndMenu(); } if (ImGui::BeginMenu("export VGM...")) { - exitDisabledTimer=1; - ImGui::Text("settings:"); - if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) { - for (int i=0; i<7; i++) { - if (ImGui::Selectable(fmt::sprintf("%d.%.2x",vgmVersions[i]>>8,vgmVersions[i]&0xff).c_str(),vgmExportVersion==vgmVersions[i])) { - vgmExportVersion=vgmVersions[i]; - } - } - ImGui::EndCombo(); - } - ImGui::Checkbox("loop",&vgmExportLoop); - if (vgmExportLoop && e->song.loopModality==2) { - ImGui::Text("loop trail:"); - ImGui::Indent(); - if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) { - vgmExportTrailingTicks=-1; - } - if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) { - vgmExportTrailingTicks=-2; - } - if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) { - vgmExportTrailingTicks=0; - } - if (vgmExportTrailingTicks>=0) { - ImGui::SameLine(); - if (ImGui::InputInt("##TrailTicks",&vgmExportTrailingTicks,1,100)) { - if (vgmExportTrailingTicks<0) vgmExportTrailingTicks=0; - } - } - ImGui::Unindent(); - } - ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "inserts data blocks on pattern changes.\n" - "useful if you are writing a playback routine.\n\n" - - "the format of a pattern change data block is:\n" - "67 66 FE ll ll ll ll 01 oo rr pp pp pp ...\n" - "- ll: length, a 32-bit little-endian number\n" - "- oo: order\n" - "- rr: initial row (a 0Dxx effect is able to select a different row)\n" - "- pp: pattern index (one per channel)\n\n" - - "pattern indexes are ordered as they appear in the song." - ); - } - ImGui::Checkbox("direct stream mode",&vgmExportDirectStream); - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip( - "required for DualPCM and MSM6258 export.\n\n" - "allows for volume/direction changes when playing samples,\n" - "at the cost of a massive increase in file size." - ); - } - ImGui::Text("chips to export:"); - bool hasOneAtLeast=false; - for (int i=0; isong.systemLen; i++) { - int minVersion=e->minVGMVersion(e->song.system[i]); - ImGui::BeginDisabled(minVersion>vgmExportVersion || minVersion==0); - ImGui::Checkbox(fmt::sprintf("%d. %s##_SYSV%d",i+1,getSystemName(e->song.system[i]),i).c_str(),&willExport[i]); - ImGui::EndDisabled(); - if (minVersion>vgmExportVersion) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is only available in VGM %d.%.2x and higher!",minVersion>>8,minVersion&0xff); - } - } else if (minVersion==0) { - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { - ImGui::SetTooltip("this chip is not supported by the VGM format!"); - } - } else { - if (willExport[i]) hasOneAtLeast=true; - } - } - ImGui::Text("select the chip you wish to export,"); - ImGui::Text("but only up to %d of each type.",(vgmExportVersion>=0x151)?2:1); - if (hasOneAtLeast) { - if (ImGui::MenuItem("click to export")) { - openFileDialog(GUI_FILE_EXPORT_VGM); - } - } else { - ImGui::Text("nothing to export"); - } + drawExportVGM(); ImGui::EndMenu(); } int numZSMCompat=0; for (int i=0; isong.systemLen; i++) { - if ((e->song.system[i] == DIV_SYSTEM_VERA) || (e->song.system[i] == DIV_SYSTEM_YM2151)) numZSMCompat++; + if ((e->song.system[i]==DIV_SYSTEM_VERA) || (e->song.system[i]==DIV_SYSTEM_YM2151)) numZSMCompat++; } if (numZSMCompat > 0) { if (ImGui::BeginMenu("export ZSM...")) { - exitDisabledTimer=1; - ImGui::Text("Commander X16 Zsound Music File"); - if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,10)) { - if (zsmExportTickRate<1) zsmExportTickRate=1; - if (zsmExportTickRate>44100) zsmExportTickRate=44100; - } - ImGui::Checkbox("loop",&zsmExportLoop); - ImGui::SameLine(); - ImGui::Checkbox("optimize size",&zsmExportOptimize); - ImGui::SameLine(); - if (ImGui::Button("Begin Export")) { - openFileDialog(GUI_FILE_EXPORT_ZSM); - ImGui::CloseCurrentPopup(); - } + drawExportZSM(); ImGui::EndMenu(); } } @@ -4236,62 +4126,16 @@ bool FurnaceGUI::loop() { } if (numAmiga && settings.iCannotWait) { if (ImGui::BeginMenu("export Amiga validation data...")) { - exitDisabledTimer=1; - ImGui::Text( - "this is NOT ROM export! only use for making sure the\n" - "Furnace Amiga emulator is working properly by\n" - "comparing it with real Amiga output." - ); - ImGui::AlignTextToFramePadding(); - ImGui::Text("Directory"); - ImGui::SameLine(); - ImGui::InputText("##AVDPath",&workingDirROMExport); - if (ImGui::Button("Bake Data")) { - std::vector out=e->buildROM(DIV_ROM_AMIGA_VALIDATION); - if (workingDirROMExport.size()>0) { - if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR; - } - for (DivROMExportOutput& i: out) { - String path=workingDirROMExport+i.name; - FILE* outFile=ps_fopen(path.c_str(),"wb"); - if (outFile!=NULL) { - fwrite(i.data->getFinalBuf(),1,i.data->size(),outFile); - fclose(outFile); - } - i.data->finish(); - delete i.data; - } - showError(fmt::sprintf("Done! Baked %d files.",(int)out.size())); - ImGui::CloseCurrentPopup(); - } + drawExportAmigaVal(); ImGui::EndMenu(); } } if (ImGui::BeginMenu("export text...")) { - exitDisabledTimer=1; - ImGui::Text( - "this option exports the song to a text file.\n" - ); - if (ImGui::Button("export")) { - openFileDialog(GUI_FILE_EXPORT_TEXT); - } + drawExportText(); ImGui::EndMenu(); } if (ImGui::BeginMenu("export command stream...")) { - exitDisabledTimer=1; - ImGui::Text( - "this option exports a text or binary file which\n" - "contains a dump of the internal command stream\n" - "produced when playing the song.\n\n" - - "technical/development use only!" - ); - if (ImGui::Button("export (binary)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM_BINARY); - } - if (ImGui::Button("export (text)")) { - openFileDialog(GUI_FILE_EXPORT_CMDSTREAM); - } + drawExportCommand(); ImGui::EndMenu(); } } else { @@ -7750,7 +7594,6 @@ FurnaceGUI::FurnaceGUI(): introStopped(false), curTutorial(-1), curTutorialStep(0), - //audio export types (export options) audioExportType(0) { // value keys valueKeys[SDLK_0]=0; diff --git a/src/gui/gui.h b/src/gui/gui.h index 63c61551a..d709cb048 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2334,9 +2334,16 @@ class FurnaceGUI { // tutorial int curTutorial, curTutorialStep; - //audio export types (export options) + // audio export types (export options) int audioExportType; + void drawExportAudio(); + void drawExportVGM(); + void drawExportZSM(); + void drawExportAmigaVal(); + void drawExportText(); + void drawExportCommand(); + void drawSSGEnv(unsigned char type, const ImVec2& size); void drawWaveform(unsigned char type, bool opz, const ImVec2& size); void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size); From 5697330c04b6ee59bcc013fa88fd301fac4b9827 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 21 Dec 2023 20:08:15 -0500 Subject: [PATCH 8/8] i won't call it classic --- src/gui/gui.cpp | 2 +- src/gui/gui.h | 4 ++-- src/gui/settings.cpp | 26 +++++++++++++++++--------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 98e824f35..8ab1abd9b 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -4101,7 +4101,7 @@ bool FurnaceGUI::loop() { openFileDialog(GUI_FILE_SAVE_DMF_LEGACY); } ImGui::Separator(); - if (settings.classicExportOptions) { + if (settings.exportOptionsLayout) { if (ImGui::BeginMenu("export audio...")) { drawExportAudio(); ImGui::EndMenu(); diff --git a/src/gui/gui.h b/src/gui/gui.h index d709cb048..9b35b4f23 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1689,7 +1689,7 @@ class FurnaceGUI { int centerPopup; int insIconsStyle; int classicChipOptions; - int classicExportOptions; + int exportOptionsLayout; int wasapiEx; int chanOscThreads; int renderPoolThreads; @@ -1886,7 +1886,7 @@ class FurnaceGUI { centerPopup(1), insIconsStyle(1), classicChipOptions(0), - classicExportOptions(0), // poll? + exportOptionsLayout(1), wasapiEx(0), chanOscThreads(0), renderPoolThreads(0), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 86b1ed964..8cc0d6b73 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -2660,6 +2660,20 @@ void FurnaceGUI::drawSettings() { } ImGui::Unindent(); + ImGui::Text("Export options layout:"); + if (ImGui::RadioButton("Sub-menus in File menu##eol0",settings.exportOptionsLayout==0)) { + settings.exportOptionsLayout=0; + settingsChanged=true; + } + if (ImGui::RadioButton("Modal window with tabs##eol1",settings.exportOptionsLayout==1)) { + settings.exportOptionsLayout=1; + settingsChanged=true; + } + if (ImGui::RadioButton("Modal windows with options in File menu##eol2",settings.exportOptionsLayout==2)) { + settings.exportOptionsLayout=2; + settingsChanged=true; + } + bool capitalMenuBarB=settings.capitalMenuBar; if (ImGui::Checkbox("Capitalize menu bar",&capitalMenuBarB)) { settings.capitalMenuBar=capitalMenuBarB; @@ -2672,12 +2686,6 @@ void FurnaceGUI::drawSettings() { settingsChanged=true; } - bool classicExportOptionsB=settings.classicExportOptions; - if (ImGui::Checkbox("Display separate export options in File menu",&classicExportOptionsB)) { - settings.classicExportOptions=classicExportOptionsB; - settingsChanged=true; - } - // SUBSECTION ORDERS CONFIG_SUBSECTION("Orders"); // sorry. temporarily disabled until ImGui has a way to add separators in tables arbitrarily. @@ -3873,7 +3881,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { settings.centerPopup=conf.getInt("centerPopup",1); settings.insIconsStyle=conf.getInt("insIconsStyle",1); settings.classicChipOptions=conf.getInt("classicChipOptions",0); - settings.classicExportOptions=conf.getInt("classicExportOptions",0); + settings.exportOptionsLayout=conf.getInt("exportOptionsLayout",1); settings.wasapiEx=conf.getInt("wasapiEx",0); settings.chanOscThreads=conf.getInt("chanOscThreads",0); settings.renderPoolThreads=conf.getInt("renderPoolThreads",0); @@ -4042,7 +4050,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { clampSetting(settings.centerPopup,0,1); clampSetting(settings.insIconsStyle,0,2); clampSetting(settings.classicChipOptions,0,1); - clampSetting(settings.classicExportOptions,0,1); + clampSetting(settings.exportOptionsLayout,0,2); clampSetting(settings.wasapiEx,0,1); clampSetting(settings.chanOscThreads,0,256); clampSetting(settings.renderPoolThreads,0,DIV_MAX_CHIPS); @@ -4292,7 +4300,7 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { conf.set("centerPopup",settings.centerPopup); conf.set("insIconsStyle",settings.insIconsStyle); conf.set("classicChipOptions",settings.classicChipOptions); - conf.set("classicExportOptions",settings.classicExportOptions); + conf.set("exportOptionsLayout",settings.exportOptionsLayout); conf.set("wasapiEx",settings.wasapiEx); conf.set("chanOscThreads",settings.chanOscThreads); conf.set("renderPoolThreads",settings.renderPoolThreads);