diff --git a/NEWS b/NEWS index f43df1bda..4503a78fe 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.23.1 (not yet released) +* protocol + - use decimal notation instead of scientific notation * output - pipewire: attempt to change the graph sample rate - snapcast: fix time stamp bug which caused "Failed to get chunk" diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx index 5a72473e0..dc05bed53 100644 --- a/src/SongPrint.cxx +++ b/src/SongPrint.cxx @@ -100,7 +100,7 @@ song_print_info(Response &r, const LightSong &song, bool base) noexcept const auto duration = song.GetDuration(); if (!duration.IsNegative()) r.Fmt(FMT_STRING("Time: {}\n" - "duration: {:1.3}\n"), + "duration: {:1.3f}\n"), duration.RoundS(), duration.ToDoubleS()); } @@ -123,7 +123,7 @@ song_print_info(Response &r, const DetachedSong &song, bool base) noexcept const auto duration = song.GetDuration(); if (!duration.IsNegative()) r.Fmt(FMT_STRING("Time: {}\n" - "duration: {:1.3}\n"), + "duration: {:1.3f}\n"), duration.RoundS(), duration.ToDoubleS()); } diff --git a/src/TagPrint.cxx b/src/TagPrint.cxx index 7b338751a..e4d80e9bf 100644 --- a/src/TagPrint.cxx +++ b/src/TagPrint.cxx @@ -60,7 +60,7 @@ tag_print(Response &r, const Tag &tag) noexcept { if (!tag.duration.IsNegative()) r.Fmt(FMT_STRING("Time: {}\n" - "duration: {:1.3}\n"), + "duration: {:1.3f}\n"), tag.duration.RoundS(), tag.duration.ToDoubleS()); diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx index 23dbeac6a..ca84468b7 100644 --- a/src/command/PlayerCommands.cxx +++ b/src/command/PlayerCommands.cxx @@ -171,7 +171,7 @@ handle_status(Client &client, [[maybe_unused]] Request args, Response &r) if (player_status.state != PlayerState::STOP) { r.Fmt(FMT_STRING(COMMAND_STATUS_TIME ": {}:{}\n" - "elapsed: {:1.3}\n" + "elapsed: {:1.3f}\n" COMMAND_STATUS_BITRATE ": {}\n"), player_status.elapsed_time.RoundS(), player_status.total_time.IsNegative() @@ -181,7 +181,7 @@ handle_status(Client &client, [[maybe_unused]] Request args, Response &r) player_status.bit_rate); if (!player_status.total_time.IsNegative()) - r.Fmt(FMT_STRING("duration: {:1.3}\n"), + r.Fmt(FMT_STRING("duration: {:1.3f}\n"), player_status.total_time.ToDoubleS()); if (player_status.audio_format.IsDefined()) diff --git a/src/pcm/SoxrResampler.cxx b/src/pcm/SoxrResampler.cxx index 1547afbc7..ea839c1f3 100644 --- a/src/pcm/SoxrResampler.cxx +++ b/src/pcm/SoxrResampler.cxx @@ -228,22 +228,22 @@ SoxrPcmResampler::Open(AudioFormat &af, unsigned new_sample_rate) FmtDebug(soxr_domain, "soxr engine '{}'", soxr_engine(soxr)); if (soxr_use_custom_recipe) FmtDebug(soxr_domain, - "soxr precision={:0.0}, phase_response={:0.2}, " - "passband_end={:0.2}, stopband_begin={:0.2} scale={:0.2}", + "soxr precision={:0.0f}, phase_response={:0.2f}, " + "passband_end={:0.2f}, stopband_begin={:0.2f} scale={:0.2f}", soxr_quality.precision, soxr_quality.phase_response, soxr_quality.passband_end, soxr_quality.stopband_begin, soxr_io_custom_recipe.scale); else FmtDebug(soxr_domain, - "soxr precision={:0.0}, phase_response={:0.2}, " - "passband_end={:0.2}, stopband_begin={:0.2}", + "soxr precision={:0.0f}, phase_response={:0.2f}, " + "passband_end={:0.2f}, stopband_begin={:0.2f}", soxr_quality.precision, soxr_quality.phase_response, soxr_quality.passband_end, soxr_quality.stopband_begin); channels = af.channels; ratio = float(new_sample_rate) / float(af.sample_rate); - FmtDebug(soxr_domain, "samplerate conversion ratio to {:.2}", ratio); + FmtDebug(soxr_domain, "samplerate conversion ratio to {:0.2f}", ratio); /* libsoxr works with floating point samples */ af.format = SampleFormat::FLOAT;