From 5ff0bbd0f8f9b885c3686647296f7985b8055723 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 4 Nov 2021 14:54:11 +0100 Subject: [PATCH] lib/fmt/AudioFormatFormatter: add formatter for SampleFormat --- src/lib/fmt/AudioFormatFormatter.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/fmt/AudioFormatFormatter.hxx b/src/lib/fmt/AudioFormatFormatter.hxx index 30206ff1d..6838644c4 100644 --- a/src/lib/fmt/AudioFormatFormatter.hxx +++ b/src/lib/fmt/AudioFormatFormatter.hxx @@ -35,6 +35,16 @@ #include +template<> +struct fmt::formatter : formatter +{ + template + auto format(const SampleFormat format, FormatContext &ctx) { + return formatter::format(sample_format_to_string(format), + ctx); + } +}; + template<> struct fmt::formatter : formatter {