VGM export: include song comments

also show song comments on mobile
This commit is contained in:
tildearrow 2024-08-23 17:46:09 -05:00
parent d0f3e0fa58
commit 99ae6a2b38
4 changed files with 18 additions and 8 deletions

View file

@ -2679,7 +2679,8 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
w->writeWString(ws,false); // japanese author name w->writeWString(ws,false); // japanese author name
w->writeS(0); // date w->writeS(0); // date
w->writeWString(L"Furnace (chiptune tracker)",false); // ripper w->writeWString(L"Furnace (chiptune tracker)",false); // ripper
w->writeS(0); // notes ws=utf8To16(song.notes.c_str());
w->writeWString(ws,false); // notes
int gd3Len=w->tell()-gd3Off-12; int gd3Len=w->tell()-gd3Off-12;

View file

@ -508,7 +508,7 @@ void FurnaceGUI::drawMobileControls() {
mobileMenuOpen=false; mobileMenuOpen=false;
doAction(GUI_ACTION_SAVE_AS); doAction(GUI_ACTION_SAVE_AS);
} }
ImGui::SameLine();
if (ImGui::Button(_("Export"))) { if (ImGui::Button(_("Export"))) {
doAction(GUI_ACTION_EXPORT); doAction(GUI_ACTION_EXPORT);
} }
@ -533,6 +533,10 @@ void FurnaceGUI::drawMobileControls() {
drawSpeed(true); drawSpeed(true);
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
if (ImGui::BeginTabItem(_("Comments"))) {
drawNotes(true);
ImGui::EndTabItem();
}
ImGui::EndTabBar(); ImGui::EndTabBar();
} }
break; break;

View file

@ -2832,7 +2832,7 @@ class FurnaceGUI {
void drawMemory(); void drawMemory();
void drawCompatFlags(); void drawCompatFlags();
void drawPiano(); void drawPiano();
void drawNotes(); void drawNotes(bool asChild=false);
void drawChannels(); void drawChannels();
void drawPatManager(); void drawPatManager();
void drawSysManager(); void drawSysManager();

View file

@ -22,18 +22,23 @@
// NOTE: please don't ask me to enable text wrap. // NOTE: please don't ask me to enable text wrap.
// Dear ImGui doesn't have that feature. D: // Dear ImGui doesn't have that feature. D:
void FurnaceGUI::drawNotes() { void FurnaceGUI::drawNotes(bool asChild) {
if (nextWindow==GUI_WINDOW_NOTES) { if (nextWindow==GUI_WINDOW_NOTES) {
notesOpen=true; notesOpen=true;
ImGui::SetNextWindowFocus(); ImGui::SetNextWindowFocus();
nextWindow=GUI_WINDOW_NOTHING; nextWindow=GUI_WINDOW_NOTHING;
} }
if (!notesOpen) return; if (!notesOpen && !asChild) return;
if (ImGui::Begin("Song Comments",&notesOpen,globalWinFlags,_("Song Comments"))) { bool began=asChild?ImGui::BeginChild("Song Info##Song Information"):ImGui::Begin("Song Comments",&notesOpen,globalWinFlags,_("Song Comments"));
if (began) {
if (ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo)) { if (ImGui::InputTextMultiline("##SongNotes",&e->song.notes,ImGui::GetContentRegionAvail(),ImGuiInputTextFlags_UndoRedo)) {
MARK_MODIFIED; MARK_MODIFIED;
} }
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_NOTES; if (!asChild && ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_NOTES;
ImGui::End(); if (asChild) {
ImGui::EndChild();
} else {
ImGui::End();
}
} }