dummy export window, keybind and related settings

This commit is contained in:
Eknous-P 2023-12-05 15:58:45 +04:00
parent 8aabaf0e01
commit df63257d11
7 changed files with 233 additions and 170 deletions

View file

@ -779,6 +779,7 @@ src/gui/doAction.cpp
src/gui/editing.cpp src/gui/editing.cpp
src/gui/editControls.cpp src/gui/editControls.cpp
src/gui/effectList.cpp src/gui/effectList.cpp
src/gui/exportWin.cpp
src/gui/findReplace.cpp src/gui/findReplace.cpp
src/gui/fmPreview.cpp src/gui/fmPreview.cpp
src/gui/gradient.cpp src/gui/gradient.cpp

View file

@ -65,6 +65,9 @@ void FurnaceGUI::doAction(int what) {
case GUI_ACTION_SAVE_AS: case GUI_ACTION_SAVE_AS:
openFileDialog(GUI_FILE_SAVE); openFileDialog(GUI_FILE_SAVE);
break; break;
case GUI_ACTION_EXPORT:
displayExport=true;
break;
case GUI_ACTION_UNDO: case GUI_ACTION_UNDO:
if (curWindow==GUI_WINDOW_SAMPLE_EDIT) { if (curWindow==GUI_WINDOW_SAMPLE_EDIT) {
doUndoSample(); doUndoSample();

24
src/gui/exportWin.cpp Normal file
View file

@ -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();
}

View file

@ -4081,6 +4081,7 @@ bool FurnaceGUI::loop() {
openFileDialog(GUI_FILE_SAVE_DMF_LEGACY); openFileDialog(GUI_FILE_SAVE_DMF_LEGACY);
} }
ImGui::Separator(); ImGui::Separator();
if (settings.classicExportOptions) {
if (ImGui::BeginMenu("export audio...")) { if (ImGui::BeginMenu("export audio...")) {
exitDisabledTimer=1; exitDisabledTimer=1;
if (ImGui::MenuItem("one file")) { if (ImGui::MenuItem("one file")) {
@ -4273,6 +4274,11 @@ bool FurnaceGUI::loop() {
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }
} else {
if (ImGui::MenuItem("export...",BIND_FOR(GUI_ACTION_EXPORT))) {
displayExport=true;
}
}
ImGui::Separator(); ImGui::Separator();
if (!settings.classicChipOptions) { if (!settings.classicChipOptions) {
if (ImGui::MenuItem("manage chips")) { if (ImGui::MenuItem("manage chips")) {
@ -5453,6 +5459,11 @@ bool FurnaceGUI::loop() {
} }
} }
if (displayExport) {
displayExport=false;
ImGui::OpenPopup("Export");
}
if (displayEditString) { if (displayEditString) {
ImGui::OpenPopup("EditString"); ImGui::OpenPopup("EditString");
} }
@ -5494,6 +5505,15 @@ bool FurnaceGUI::loop() {
ImGui::EndPopup(); 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().x<newSongMinSize.x || ImGui::GetWindowSize().y<newSongMinSize.y) {
ImGui::SetWindowSize(newSongMinSize,ImGuiCond_Always);
}
drawExport();
ImGui::EndPopup();
}
centerNextWindow("Error",canvasW,canvasH); centerNextWindow("Error",canvasW,canvasH);
if (ImGui::BeginPopupModal("Error",NULL,ImGuiWindowFlags_AlwaysAutoResize)) { if (ImGui::BeginPopupModal("Error",NULL,ImGuiWindowFlags_AlwaysAutoResize)) {
ImGui::Text("%s",errorString.c_str()); ImGui::Text("%s",errorString.c_str());

View file

@ -517,6 +517,7 @@ enum FurnaceGUIActions {
GUI_ACTION_OPEN_BACKUP, GUI_ACTION_OPEN_BACKUP,
GUI_ACTION_SAVE, GUI_ACTION_SAVE,
GUI_ACTION_SAVE_AS, GUI_ACTION_SAVE_AS,
GUI_ACTION_EXPORT,
GUI_ACTION_UNDO, GUI_ACTION_UNDO,
GUI_ACTION_REDO, GUI_ACTION_REDO,
GUI_ACTION_PLAY_TOGGLE, GUI_ACTION_PLAY_TOGGLE,
@ -1371,7 +1372,7 @@ class FurnaceGUI {
bool vgmExportDirectStream, displayInsTypeList; bool vgmExportDirectStream, displayInsTypeList;
bool portrait, injectBackUp, mobileMenuOpen, warnColorPushed; bool portrait, injectBackUp, mobileMenuOpen, warnColorPushed;
bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu; bool wantCaptureKeyboard, oldWantCaptureKeyboard, displayMacroMenu;
bool displayNew, fullScreen, preserveChanPos, wantScrollList, noteInputPoly, notifyWaveChange; bool displayNew, displayExport, fullScreen, preserveChanPos, wantScrollList, noteInputPoly, notifyWaveChange;
bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString; bool displayPendingIns, pendingInsSingle, displayPendingRawSample, snesFilterHex, modTableHex, displayEditString;
bool mobileEdit; bool mobileEdit;
bool killGraphics; bool killGraphics;
@ -1626,6 +1627,7 @@ class FurnaceGUI {
int centerPopup; int centerPopup;
int insIconsStyle; int insIconsStyle;
int classicChipOptions; int classicChipOptions;
int classicExportOptions;
int wasapiEx; int wasapiEx;
int chanOscThreads; int chanOscThreads;
int renderPoolThreads; int renderPoolThreads;
@ -1820,6 +1822,7 @@ class FurnaceGUI {
centerPopup(1), centerPopup(1),
insIconsStyle(1), insIconsStyle(1),
classicChipOptions(0), classicChipOptions(0),
classicExportOptions(0), // poll?
wasapiEx(0), wasapiEx(0),
chanOscThreads(0), chanOscThreads(0),
renderPoolThreads(0), renderPoolThreads(0),
@ -2375,6 +2378,7 @@ class FurnaceGUI {
void drawSettings(); void drawSettings();
void drawDebug(); void drawDebug();
void drawNewSong(); void drawNewSong();
void drawExport();
void drawLog(); void drawLog();
void drawEffectList(); void drawEffectList();
void drawSubSongs(bool asChild=false); void drawSubSongs(bool asChild=false);

View file

@ -537,6 +537,7 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={
D("OPEN_BACKUP", "Restore backup", 0), D("OPEN_BACKUP", "Restore backup", 0),
D("SAVE", "Save file", FURKMOD_CMD|SDLK_s), D("SAVE", "Save file", FURKMOD_CMD|SDLK_s),
D("SAVE_AS", "Save as", FURKMOD_CMD|FURKMOD_SHIFT|SDLK_s), D("SAVE_AS", "Save as", FURKMOD_CMD|FURKMOD_SHIFT|SDLK_s),
D("EXPORT", "Export", FURKMOD_CMD|SDLK_e),
D("UNDO", "Undo", FURKMOD_CMD|SDLK_z), D("UNDO", "Undo", FURKMOD_CMD|SDLK_z),
D("REDO", "Redo", FURKMOD_CMD|SDLK_y), D("REDO", "Redo", FURKMOD_CMD|SDLK_y),
D("PLAY_TOGGLE", "Play/Stop (toggle)", SDLK_RETURN), D("PLAY_TOGGLE", "Play/Stop (toggle)", SDLK_RETURN),

View file

@ -1659,6 +1659,7 @@ void FurnaceGUI::drawSettings() {
UI_KEYBIND_CONFIG(GUI_ACTION_OPEN_BACKUP); UI_KEYBIND_CONFIG(GUI_ACTION_OPEN_BACKUP);
UI_KEYBIND_CONFIG(GUI_ACTION_SAVE); UI_KEYBIND_CONFIG(GUI_ACTION_SAVE);
UI_KEYBIND_CONFIG(GUI_ACTION_SAVE_AS); UI_KEYBIND_CONFIG(GUI_ACTION_SAVE_AS);
UI_KEYBIND_CONFIG(GUI_ACTION_EXPORT);
UI_KEYBIND_CONFIG(GUI_ACTION_UNDO); UI_KEYBIND_CONFIG(GUI_ACTION_UNDO);
UI_KEYBIND_CONFIG(GUI_ACTION_REDO); UI_KEYBIND_CONFIG(GUI_ACTION_REDO);
UI_KEYBIND_CONFIG(GUI_ACTION_PLAY_TOGGLE); UI_KEYBIND_CONFIG(GUI_ACTION_PLAY_TOGGLE);
@ -2652,6 +2653,12 @@ void FurnaceGUI::drawSettings() {
settingsChanged=true; settingsChanged=true;
} }
bool classicExportOptionsB=settings.classicExportOptions;
if (ImGui::Checkbox("Display separate export options in File menu",&classicExportOptionsB)) {
settings.classicExportOptions=classicExportOptionsB;
settingsChanged=true;
}
// SUBSECTION ORDERS // SUBSECTION ORDERS
CONFIG_SUBSECTION("Orders"); CONFIG_SUBSECTION("Orders");
// sorry. temporarily disabled until ImGui has a way to add separators in tables arbitrarily. // sorry. temporarily disabled until ImGui has a way to add separators in tables arbitrarily.
@ -3787,6 +3794,7 @@ void FurnaceGUI::syncSettings() {
settings.centerPopup=e->getConfInt("centerPopup",1); settings.centerPopup=e->getConfInt("centerPopup",1);
settings.insIconsStyle=e->getConfInt("insIconsStyle",1); settings.insIconsStyle=e->getConfInt("insIconsStyle",1);
settings.classicChipOptions=e->getConfInt("classicChipOptions",0); settings.classicChipOptions=e->getConfInt("classicChipOptions",0);
settings.classicExportOptions=e->getConfInt("classicExportOptions",0);
settings.wasapiEx=e->getConfInt("wasapiEx",0); settings.wasapiEx=e->getConfInt("wasapiEx",0);
settings.chanOscThreads=e->getConfInt("chanOscThreads",0); settings.chanOscThreads=e->getConfInt("chanOscThreads",0);
settings.renderPoolThreads=e->getConfInt("renderPoolThreads",0); settings.renderPoolThreads=e->getConfInt("renderPoolThreads",0);
@ -3953,6 +3961,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.centerPopup,0,1); clampSetting(settings.centerPopup,0,1);
clampSetting(settings.insIconsStyle,0,2); clampSetting(settings.insIconsStyle,0,2);
clampSetting(settings.classicChipOptions,0,1); clampSetting(settings.classicChipOptions,0,1);
clampSetting(settings.classicExportOptions,0,1);
clampSetting(settings.wasapiEx,0,1); clampSetting(settings.wasapiEx,0,1);
clampSetting(settings.chanOscThreads,0,256); clampSetting(settings.chanOscThreads,0,256);
clampSetting(settings.renderPoolThreads,0,DIV_MAX_CHIPS); clampSetting(settings.renderPoolThreads,0,DIV_MAX_CHIPS);
@ -4232,6 +4241,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("centerPopup",settings.centerPopup); e->setConf("centerPopup",settings.centerPopup);
e->setConf("insIconsStyle",settings.insIconsStyle); e->setConf("insIconsStyle",settings.insIconsStyle);
e->setConf("classicChipOptions",settings.classicChipOptions); e->setConf("classicChipOptions",settings.classicChipOptions);
e->setConf("classicExportOptions",settings.classicExportOptions);
e->setConf("wasapiEx",settings.wasapiEx); e->setConf("wasapiEx",settings.wasapiEx);
e->setConf("chanOscThreads",settings.chanOscThreads); e->setConf("chanOscThreads",settings.chanOscThreads);
e->setConf("renderPoolThreads",settings.renderPoolThreads); e->setConf("renderPoolThreads",settings.renderPoolThreads);