From ffb89ece041707235d317565ac84714e5991b742 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 24 Oct 2025 04:04:45 -0500 Subject: [PATCH] a couple fixes - fix export targets of mpg123 - initialize wavFormat - fix format string localization - fix certain settings being visible in per-chip export when they shouldn't --- extern/mpg123/CMakeLists.txt | 8 +++---- src/engine/engine.h | 1 + src/gui/exportOptions.cpp | 41 ++++++++++++++++++++---------------- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/extern/mpg123/CMakeLists.txt b/extern/mpg123/CMakeLists.txt index 55e0efbb7..128100898 100644 --- a/extern/mpg123/CMakeLists.txt +++ b/extern/mpg123/CMakeLists.txt @@ -15,10 +15,10 @@ include(GNUInstallDirs) set(PACKAGE_VERSION ${PROJECT_VERSION}) add_subdirectory("src") -install( - EXPORT targets - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" - NAMESPACE MPG123::) +#install( +# EXPORT targets +# DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" +# NAMESPACE MPG123::) configure_package_config_file( mpg123-config.cmake.in mpg123-config.cmake diff --git a/src/engine/engine.h b/src/engine/engine.h index 254a8ad02..f84981ed5 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -139,6 +139,7 @@ struct DivAudioExportOptions { mode(DIV_EXPORT_MODE_ONE), format(DIV_EXPORT_FORMAT_WAV), bitRateMode(DIV_EXPORT_BITRATE_CONSTANT), + wavFormat(DIV_EXPORT_WAV_S16), sampleRate(44100), chans(2), loops(0), diff --git a/src/gui/exportOptions.cpp b/src/gui/exportOptions.cpp index d55f1760a..c6d194f60 100644 --- a/src/gui/exportOptions.cpp +++ b/src/gui/exportOptions.cpp @@ -24,18 +24,20 @@ #include const char* audioExportFormats[]={ - _("Wave"), - _("Opus"), - _("FLAC (Free Lossless Audio Codec)"), - _("Vorbis"), - _("MP3") + _N("Wave"), + _N("Opus"), + _N("FLAC (Free Lossless Audio Codec)"), + _N("Vorbis"), + _N("MP3"), + NULL }; const char* audioExportWavFormats[]={ - _("Unsigned 8-bit"), - _("Signed 16-bit"), - _("Signed 32-bit"), - _("Float 32-bit"), + _N("8-bit int (unsigned)"), + _N("16-bit int"), + _N("32-bit int"), + _N("32-bit float"), + NULL }; void FurnaceGUI::drawExportAudio(bool onWindow) { @@ -58,14 +60,17 @@ void FurnaceGUI::drawExportAudio(bool onWindow) { ImGui::Unindent(); if (audioExportOptions.mode!=DIV_EXPORT_MODE_MANY_SYS) { - if (ImGui::BeginCombo(_("File Format"), audioExportFormats[audioExportOptions.format])) { - for (size_t i=0; i<(supportsMP3?5:4); i++) { - if (ImGui::Selectable(audioExportFormats[i],audioExportOptions.format==i)) { - audioExportOptions.format=(DivAudioExportFormats)i; + if (ImGui::BeginCombo(_("File Format"), audioExportFormats[audioExportOptions.format])) { + for (size_t i=0; i<(supportsMP3?5:4); i++) { + if (ImGui::Selectable(_(audioExportFormats[i]),audioExportOptions.format==i)) { + audioExportOptions.format=(DivAudioExportFormats)i; + } } + ImGui::EndCombo(); } - ImGui::EndCombo(); - } + } else { + audioExportOptions.format=DIV_EXPORT_FORMAT_WAV; + audioExportOptions.wavFormat=DIV_EXPORT_WAV_S16; } bool rateCheck=( @@ -142,10 +147,10 @@ void FurnaceGUI::drawExportAudio(bool onWindow) { if (audioExportOptions.bitRatemaxBitRate) audioExportOptions.bitRate=maxBitRate; } - } else { + } else if (audioExportOptions.mode!=DIV_EXPORT_MODE_MANY_SYS) { if (ImGui::BeginCombo(_("Format"), audioExportWavFormats[audioExportOptions.wavFormat])) { - for (size_t i=0; i<4; i++) { - if (ImGui::Selectable(audioExportWavFormats[i], audioExportOptions.wavFormat==i)) { + for (size_t i=0; audioExportWavFormats[i]; i++) { + if (ImGui::Selectable(_(audioExportWavFormats[i]), audioExportOptions.wavFormat==i)) { audioExportOptions.wavFormat=(DivAudioExportWavFormats)i; } }