the massive preparations - GUI

This commit is contained in:
tildearrow 2024-05-26 19:31:17 -05:00
parent 34c176a799
commit 00e0679442
48 changed files with 41493 additions and 2734 deletions

View file

@ -26,68 +26,68 @@
void FurnaceGUI::drawExportAudio(bool onWindow) {
exitDisabledTimer=1;
ImGui::Text("Export type:");
ImGui::Text(_("Export type:"));
ImGui::Indent();
if (ImGui::RadioButton("one file",audioExportOptions.mode==DIV_EXPORT_MODE_ONE)) {
if (ImGui::RadioButton(_("one file"),audioExportOptions.mode==DIV_EXPORT_MODE_ONE)) {
audioExportOptions.mode=DIV_EXPORT_MODE_ONE;
}
if (ImGui::RadioButton("multiple files (one per chip)",audioExportOptions.mode==DIV_EXPORT_MODE_MANY_SYS)) {
if (ImGui::RadioButton(_("multiple files (one per chip)"),audioExportOptions.mode==DIV_EXPORT_MODE_MANY_SYS)) {
audioExportOptions.mode=DIV_EXPORT_MODE_MANY_SYS;
}
if (ImGui::RadioButton("multiple files (one per channel)",audioExportOptions.mode==DIV_EXPORT_MODE_MANY_CHAN)) {
if (ImGui::RadioButton(_("multiple files (one per channel)"),audioExportOptions.mode==DIV_EXPORT_MODE_MANY_CHAN)) {
audioExportOptions.mode=DIV_EXPORT_MODE_MANY_CHAN;
}
ImGui::Unindent();
if (audioExportOptions.mode!=DIV_EXPORT_MODE_MANY_SYS) {
ImGui::Text("Bit depth:");
ImGui::Text(_("Bit depth:"));
ImGui::Indent();
if (ImGui::RadioButton("16-bit integer",audioExportOptions.format==DIV_EXPORT_FORMAT_S16)) {
if (ImGui::RadioButton(_("16-bit integer"),audioExportOptions.format==DIV_EXPORT_FORMAT_S16)) {
audioExportOptions.format=DIV_EXPORT_FORMAT_S16;
}
if (ImGui::RadioButton("32-bit float",audioExportOptions.format==DIV_EXPORT_FORMAT_F32)) {
if (ImGui::RadioButton(_("32-bit float"),audioExportOptions.format==DIV_EXPORT_FORMAT_F32)) {
audioExportOptions.format=DIV_EXPORT_FORMAT_F32;
}
ImGui::Unindent();
}
if (ImGui::InputInt("Sample rate",&audioExportOptions.sampleRate,100,10000)) {
if (ImGui::InputInt(_("Sample rate"),&audioExportOptions.sampleRate,100,10000)) {
if (audioExportOptions.sampleRate<8000) audioExportOptions.sampleRate=8000;
if (audioExportOptions.sampleRate>384000) audioExportOptions.sampleRate=384000;
}
if (audioExportOptions.mode!=DIV_EXPORT_MODE_MANY_SYS) {
if (ImGui::InputInt("Channels in file",&audioExportOptions.chans,1,1)) {
if (ImGui::InputInt(_("Channels in file"),&audioExportOptions.chans,1,1)) {
if (audioExportOptions.chans<1) audioExportOptions.chans=1;
if (audioExportOptions.chans>16) audioExportOptions.chans=16;
}
}
if (ImGui::InputInt("Loops",&audioExportOptions.loops,1,2)) {
if (ImGui::InputInt(_("Loops"),&audioExportOptions.loops,1,2)) {
if (audioExportOptions.loops<0) audioExportOptions.loops=0;
}
if (ImGui::InputDouble("Fade out (seconds)",&audioExportOptions.fadeOut,1.0,2.0,"%.1f")) {
if (ImGui::InputDouble(_("Fade out (seconds)"),&audioExportOptions.fadeOut,1.0,2.0,"%.1f")) {
if (audioExportOptions.fadeOut<0.0) audioExportOptions.fadeOut=0.0;
}
bool isOneOn=false;
if (audioExportOptions.mode==DIV_EXPORT_MODE_MANY_CHAN) {
ImGui::Text("Channels to export:");
ImGui::Text(_("Channels to export:"));
ImGui::SameLine();
if (ImGui::SmallButton("All")) {
if (ImGui::SmallButton(_("All"))) {
for (int i=0; i<DIV_MAX_CHANS; i++) {
audioExportOptions.channelMask[i]=true;
}
}
ImGui::SameLine();
if (ImGui::SmallButton("None")) {
if (ImGui::SmallButton(_("None"))) {
for (int i=0; i<DIV_MAX_CHANS; i++) {
audioExportOptions.channelMask[i]=false;
}
}
ImGui::SameLine();
if (ImGui::SmallButton("Invert")) {
if (ImGui::SmallButton(_("Invert"))) {
for (int i=0; i<DIV_MAX_CHANS; i++) {
audioExportOptions.channelMask[i]=!audioExportOptions.channelMask[i];
}
@ -107,12 +107,12 @@ void FurnaceGUI::drawExportAudio(bool onWindow) {
if (onWindow) {
ImGui::Separator();
if (ImGui::Button("Cancel",ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
if (ImGui::Button(_("Cancel"),ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
ImGui::SameLine();
}
if (isOneOn) {
if (ImGui::Button("Export",ImVec2(200.0f*dpiScale,0))) {
if (ImGui::Button(_("Export"),ImVec2(200.0f*dpiScale,0))) {
switch (audioExportOptions.mode) {
case DIV_EXPORT_MODE_ONE:
openFileDialog(GUI_FILE_EXPORT_AUDIO_ONE);
@ -127,15 +127,15 @@ void FurnaceGUI::drawExportAudio(bool onWindow) {
ImGui::CloseCurrentPopup();
}
} else {
ImGui::Text("select at least one channel");
ImGui::Text(_("select at least one channel"));
}
}
void FurnaceGUI::drawExportVGM(bool onWindow) {
exitDisabledTimer=1;
ImGui::Text("settings:");
if (ImGui::BeginCombo("format version",fmt::sprintf("%d.%.2x",vgmExportVersion>>8,vgmExportVersion&0xff).c_str())) {
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];
@ -143,17 +143,17 @@ void FurnaceGUI::drawExportVGM(bool onWindow) {
}
ImGui::EndCombo();
}
ImGui::Checkbox("loop",&vgmExportLoop);
ImGui::Checkbox(_("loop"),&vgmExportLoop);
if (vgmExportLoop && e->song.loopModality==2) {
ImGui::Text("loop trail:");
ImGui::Text(_("loop trail:"));
ImGui::Indent();
if (ImGui::RadioButton("auto-detect",vgmExportTrailingTicks==-1)) {
if (ImGui::RadioButton(_("auto-detect"),vgmExportTrailingTicks==-1)) {
vgmExportTrailingTicks=-1;
}
if (ImGui::RadioButton("add one loop",vgmExportTrailingTicks==-2)) {
if (ImGui::RadioButton(_("add one loop"),vgmExportTrailingTicks==-2)) {
vgmExportTrailingTicks=-2;
}
if (ImGui::RadioButton("custom",vgmExportTrailingTicks>=0)) {
if (ImGui::RadioButton(_("custom"),vgmExportTrailingTicks>=0)) {
vgmExportTrailingTicks=0;
}
if (vgmExportTrailingTicks>=0) {
@ -164,9 +164,9 @@ void FurnaceGUI::drawExportVGM(bool onWindow) {
}
ImGui::Unindent();
}
ImGui::Checkbox("add pattern change hints",&vgmExportPatternHints);
ImGui::Checkbox(_("add pattern change hints"),&vgmExportPatternHints);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(
ImGui::SetTooltip(_(
"inserts data blocks on pattern changes.\n"
"useful if you are writing a playback routine.\n\n"
@ -178,17 +178,17 @@ void FurnaceGUI::drawExportVGM(bool onWindow) {
"- pp: pattern index (one per channel)\n\n"
"pattern indexes are ordered as they appear in the song."
);
));
}
ImGui::Checkbox("direct stream mode",&vgmExportDirectStream);
ImGui::Checkbox(_("direct stream mode"),&vgmExportDirectStream);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(
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:");
ImGui::Text(_("chips to export:"));
bool hasOneAtLeast=false;
for (int i=0; i<e->song.systemLen; i++) {
int minVersion=e->minVGMVersion(e->song.system[i]);
@ -197,32 +197,32 @@ void FurnaceGUI::drawExportVGM(bool onWindow) {
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);
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!");
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);
ImGui::Text(_("select the chip you wish to export, but only up to %d of each type."),(vgmExportVersion>=0x151)?2:1);
if (hasOneAtLeast) {
if (onWindow) {
ImGui::Separator();
if (ImGui::Button("Cancel",ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
if (ImGui::Button(_("Cancel"),ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
ImGui::SameLine();
}
if (ImGui::Button("Export",ImVec2(200.0f*dpiScale,0))) {
if (ImGui::Button(_("Export"),ImVec2(200.0f*dpiScale,0))) {
openFileDialog(GUI_FILE_EXPORT_VGM);
ImGui::CloseCurrentPopup();
}
} else {
ImGui::Text("nothing to export");
ImGui::Text(_("nothing to export"));
if (onWindow) {
ImGui::Separator();
if (ImGui::Button("Cancel",ImVec2(400.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
if (ImGui::Button(_("Cancel"),ImVec2(400.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
}
}
}
@ -230,20 +230,20 @@ void FurnaceGUI::drawExportVGM(bool onWindow) {
void FurnaceGUI::drawExportZSM(bool onWindow) {
exitDisabledTimer=1;
ImGui::Text("Commander X16 Zsound Music File");
if (ImGui::InputInt("Tick Rate (Hz)",&zsmExportTickRate,1,2)) {
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::Checkbox(_("loop"),&zsmExportLoop);
ImGui::SameLine();
ImGui::Checkbox("optimize size",&zsmExportOptimize);
ImGui::Checkbox(_("optimize size"),&zsmExportOptimize);
if (onWindow) {
ImGui::Separator();
if (ImGui::Button("Cancel",ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
if (ImGui::Button(_("Cancel"),ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
ImGui::SameLine();
}
if (ImGui::Button("Export",ImVec2(200.0f*dpiScale,0))) {
if (ImGui::Button(_("Export"),ImVec2(200.0f*dpiScale,0))) {
openFileDialog(GUI_FILE_EXPORT_ZSM);
ImGui::CloseCurrentPopup();
}
@ -252,21 +252,21 @@ void FurnaceGUI::drawExportZSM(bool onWindow) {
void FurnaceGUI::drawExportAmigaVal(bool onWindow) {
exitDisabledTimer=1;
ImGui::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."
);
));
ImGui::AlignTextToFramePadding();
ImGui::Text("Directory");
ImGui::Text(_("Directory"));
ImGui::SameLine();
ImGui::InputText("##AVDPath",&workingDirROMExport);
if (onWindow) {
ImGui::Separator();
if (ImGui::Button("Cancel",ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
if (ImGui::Button(_("Cancel"),ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
ImGui::SameLine();
}
if (ImGui::Button("Bake Data",ImVec2(200.0f*dpiScale,0))) {
if (ImGui::Button(_("Bake Data"),ImVec2(200.0f*dpiScale,0))) {
std::vector<DivROMExportOutput> out=e->buildROM(DIV_ROM_AMIGA_VALIDATION);
if (workingDirROMExport.size()>0) {
if (workingDirROMExport[workingDirROMExport.size()-1]!=DIR_SEPARATOR) workingDirROMExport+=DIR_SEPARATOR_STR;
@ -281,7 +281,7 @@ void FurnaceGUI::drawExportAmigaVal(bool onWindow) {
i.data->finish();
delete i.data;
}
showError(fmt::sprintf("Done! Baked %d files.",(int)out.size()));
showError(fmt::sprintf(_("Done! Baked %d files."),(int)out.size()));
ImGui::CloseCurrentPopup();
}
}
@ -290,14 +290,14 @@ void FurnaceGUI::drawExportText(bool onWindow) {
exitDisabledTimer=1;
ImGui::Text(
"this option exports the song to a text file.\n"
_("this option exports the song to a text file.\n")
);
if (onWindow) {
ImGui::Separator();
if (ImGui::Button("Cancel",ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
if (ImGui::Button(_("Cancel"),ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
ImGui::SameLine();
}
if (ImGui::Button("Export",ImVec2(200.0f*dpiScale,0))) {
if (ImGui::Button(_("Export"),ImVec2(200.0f*dpiScale,0))) {
openFileDialog(GUI_FILE_EXPORT_TEXT);
ImGui::CloseCurrentPopup();
}
@ -306,19 +306,19 @@ void FurnaceGUI::drawExportText(bool onWindow) {
void FurnaceGUI::drawExportCommand(bool onWindow) {
exitDisabledTimer=1;
ImGui::Text(
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 (onWindow) {
ImGui::Separator();
if (ImGui::Button("Cancel",ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
if (ImGui::Button(_("Cancel"),ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
ImGui::SameLine();
}
if (ImGui::Button("Export",ImVec2(200.0f*dpiScale,0))) {
if (ImGui::Button(_("Export"),ImVec2(200.0f*dpiScale,0))) {
openFileDialog(GUI_FILE_EXPORT_CMDSTREAM);
ImGui::CloseCurrentPopup();
}
@ -327,21 +327,21 @@ void FurnaceGUI::drawExportCommand(bool onWindow) {
void FurnaceGUI::drawExportDMF(bool onWindow) {
exitDisabledTimer=1;
ImGui::Text(
ImGui::Text(_(
"export in DefleMask module format.\n"
"only do it if you really, really need to, or are downgrading an existing .dmf."
);
));
ImGui::Text("format version:");
ImGui::RadioButton("1.1.3 and higher",&dmfExportVersion,0);
ImGui::RadioButton("1.0/legacy (0.12)",&dmfExportVersion,1);
ImGui::Text(_("format version:"));
ImGui::RadioButton(_("1.1.3 and higher"),&dmfExportVersion,0);
ImGui::RadioButton(_("1.0/legacy (0.12)"),&dmfExportVersion,1);
if (onWindow) {
ImGui::Separator();
if (ImGui::Button("Cancel",ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
if (ImGui::Button(_("Cancel"),ImVec2(200.0f*dpiScale,0))) ImGui::CloseCurrentPopup();
ImGui::SameLine();
}
if (ImGui::Button("Export",ImVec2(200.0f*dpiScale,0))) {
if (ImGui::Button(_("Export"),ImVec2(200.0f*dpiScale,0))) {
if (dmfExportVersion==1) {
openFileDialog(GUI_FILE_SAVE_DMF_LEGACY);
} else {
@ -354,11 +354,11 @@ void FurnaceGUI::drawExportDMF(bool onWindow) {
void FurnaceGUI::drawExport() {
if (settings.exportOptionsLayout==1 || curExportType==GUI_EXPORT_NONE) {
if (ImGui::BeginTabBar("ExportTypes")) {
if (ImGui::BeginTabItem("Audio")) {
if (ImGui::BeginTabItem(_("Audio"))) {
drawExportAudio(true);
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("VGM")) {
if (ImGui::BeginTabItem(_("VGM"))) {
drawExportVGM(true);
ImGui::EndTabItem();
}
@ -367,7 +367,7 @@ void FurnaceGUI::drawExport() {
if ((e->song.system[i]==DIV_SYSTEM_VERA) || (e->song.system[i]==DIV_SYSTEM_YM2151)) numZSMCompat++;
}
if (numZSMCompat>0) {
if (ImGui::BeginTabItem("ZSM")) {
if (ImGui::BeginTabItem(_("ZSM"))) {
drawExportZSM(true);
ImGui::EndTabItem();
}
@ -377,20 +377,20 @@ void FurnaceGUI::drawExport() {
if (e->song.system[i]==DIV_SYSTEM_AMIGA) numAmiga++;
}
if (numAmiga && settings.iCannotWait) {
if (ImGui::BeginTabItem("Amiga Validation")) {
if (ImGui::BeginTabItem(_("Amiga Validation"))) {
drawExportAmigaVal(true);
ImGui::EndTabItem();
}
}
if (ImGui::BeginTabItem("Text")) {
if (ImGui::BeginTabItem(_("Text"))) {
drawExportText(true);
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Command Stream")) {
if (ImGui::BeginTabItem(_("Command Stream"))) {
drawExportCommand(true);
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("DMF")) {
if (ImGui::BeginTabItem(_("DMF"))) {
drawExportDMF(true);
ImGui::EndTabItem();
}
@ -419,39 +419,39 @@ void FurnaceGUI::drawExport() {
drawExportDMF(true);
break;
default:
ImGui::Text("congratulations! you've unlocked a secret panel.");
if (ImGui::Button("Toggle hidden systems")) {
ImGui::Text(_("congratulations! you've unlocked a secret panel."));
if (ImGui::Button(_("Toggle hidden systems"))) {
settings.hiddenSystems=!settings.hiddenSystems;
ImGui::CloseCurrentPopup();
}
if (ImGui::Button("Toggle all instrument types")) {
if (ImGui::Button(_("Toggle all instrument types"))) {
settings.displayAllInsTypes=!settings.displayAllInsTypes;
ImGui::CloseCurrentPopup();
}
if (ImGui::Button("Set pitch linearity to Partial")) {
if (ImGui::Button(_("Set pitch linearity to Partial"))) {
e->song.linearPitch=1;
ImGui::CloseCurrentPopup();
}
if (ImGui::Button("Enable multi-threading settings")) {
if (ImGui::Button(_("Enable multi-threading settings"))) {
settings.showPool=1;
ImGui::CloseCurrentPopup();
}
if (ImGui::Button("Set fat to max")) {
if (ImGui::Button(_("Set fat to max"))) {
ImGuiStyle& sty=ImGui::GetStyle();
sty.FramePadding=ImVec2(20.0f*dpiScale,20.0f*dpiScale);
sty.ItemSpacing=ImVec2(10.0f*dpiScale,10.0f*dpiScale);
sty.ItemInnerSpacing=ImVec2(10.0f*dpiScale,10.0f*dpiScale);
ImGui::CloseCurrentPopup();
}
if (ImGui::Button("Set muscle and fat to zero")) {
if (ImGui::Button(_("Set muscle and fat to zero"))) {
ImGuiStyle& sty=ImGui::GetStyle();
sty.FramePadding=ImVec2(0,0);
sty.ItemSpacing=ImVec2(0,0);
sty.ItemInnerSpacing=ImVec2(0,0);
ImGui::CloseCurrentPopup();
}
if (ImGui::Button("Tell tildearrow this must be a mistake")) {
showError("yeah, it's a bug. write a bug report in the GitHub page and tell me how did you get here.");
if (ImGui::Button(_("Tell tildearrow this must be a mistake"))) {
showError(_("yeah, it's a bug. write a bug report in the GitHub page and tell me how did you get here."));
ImGui::CloseCurrentPopup();
}
break;