diff --git a/.gitmodules b/.gitmodules index 686382b6068..805afb1d26d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "libs/LuaJitLib/LuaJIT"] path = libs/LuaJitLib/LuaJIT url = https://github.com/LuaJIT/LuaJIT.git +[submodule "libs/fmt"] + path = libs/fmt + url = https://github.com/fmtlib/fmt.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 35d6e5ce4e5..f40ccf1d867 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,6 +167,7 @@ add_subdirectory(libs/airwindows) add_subdirectory(libs/catch2) add_subdirectory(libs/eurorack) add_subdirectory(libs/filesystem) +add_subdirectory(libs/fmt) add_subdirectory(libs/tinyxml) add_subdirectory(libs/oddsound-mts) if(MINGW) @@ -203,6 +204,7 @@ target_link_libraries(surge-shared PUBLIC samplerate surge-shared-binary tuning-library + fmt ) # We want to run this once alas, since JUCE needs it even though it is a byproduct of a phase to build the diff --git a/libs/fmt b/libs/fmt new file mode 160000 index 00000000000..d58d19ba323 --- /dev/null +++ b/libs/fmt @@ -0,0 +1 @@ +Subproject commit d58d19ba323582841cbf552d1b9230817b61ed01 diff --git a/src/gui/SurgeGUIEditor.cpp b/src/gui/SurgeGUIEditor.cpp index 779c2986834..64d2a3156a1 100644 --- a/src/gui/SurgeGUIEditor.cpp +++ b/src/gui/SurgeGUIEditor.cpp @@ -31,6 +31,7 @@ #include "SurgeSynthEditor.h" #include "SurgeGUIEditorTags.h" +#include "fmt/core.h" #include "overlays/AboutScreen.h" #include "overlays/CoveringMessageOverlay.h" @@ -2380,7 +2381,7 @@ juce::PopupMenu SurgeGUIEditor::makeTuningMenu(const juce::Point &where, bo [this](const std::string &s) { float freq = ::atof(s.c_str()); auto kb = Tunings::tuneA69To(freq); - kb.name = "Note 69 Retuned 440 to " + std::to_string(freq); + kb.name = fmt::format("Note 69 Retuned 440 to {:.2f}", freq); if (!this->synth->storage.remapToKeyboard(kb)) { synth->storage.reportError("This .kbm file is not valid!",