lib/fmt/RuntimeError: new library

Replacing FormatRuntimeError().
This commit is contained in:
Max Kellermann
2022-11-28 21:58:21 +01:00
parent 45b13fc2a6
commit fa58db798b
105 changed files with 551 additions and 502 deletions

View File

@@ -47,8 +47,8 @@
#include "pcm/AudioFormat.hxx"
#include "pcm/Buffer.hxx"
#include "pcm/Silence.hxx"
#include "lib/fmt/RuntimeError.hxx"
#include "util/StringStrip.hxx"
#include "util/RuntimeError.hxx"
#include <array>
#include <cstdint>
@@ -159,8 +159,8 @@ PreparedRouteFilter::PreparedRouteFilter(const ConfigBlock &block)
throw std::runtime_error("Malformed 'routes' specification");
if (source >= MAX_CHANNELS)
throw FormatRuntimeError("Invalid source channel number: %u",
source);
throw FmtRuntimeError("Invalid source channel number: {}",
source);
if (source >= min_input_channels)
min_input_channels = source + 1;
@@ -173,8 +173,8 @@ PreparedRouteFilter::PreparedRouteFilter(const ConfigBlock &block)
throw std::runtime_error("Malformed 'routes' specification");
if (dest >= MAX_CHANNELS)
throw FormatRuntimeError("Invalid destination channel number: %u",
dest);
throw FmtRuntimeError("Invalid destination channel number: {}",
dest);
if (dest >= min_output_channels)
min_output_channels = dest + 1;

View File

@@ -19,7 +19,8 @@
#include "TwoFilters.hxx"
#include "pcm/AudioFormat.hxx"
#include "util/RuntimeError.hxx"
#include "lib/fmt/AudioFormatFormatter.hxx"
#include "lib/fmt/RuntimeError.hxx"
#include "util/StringBuffer.hxx"
std::span<const std::byte>
@@ -50,9 +51,8 @@ PreparedTwoFilters::Open(AudioFormat &audio_format)
auto b = second->Open(b_in_format);
if (b_in_format != a_out_format)
throw FormatRuntimeError("Audio format not supported by filter '%s': %s",
second_name.c_str(),
ToString(a_out_format).c_str());
throw FmtRuntimeError("Audio format not supported by filter '{}': {}",
second_name, a_out_format);
return std::make_unique<TwoFilters>(std::move(a),
std::move(b));