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

@@ -20,6 +20,7 @@
#include "AlsaMixerPlugin.hxx"
#include "lib/alsa/NonBlock.hxx"
#include "lib/alsa/Error.hxx"
#include "lib/fmt/RuntimeError.hxx"
#include "lib/fmt/ToBuffer.hxx"
#include "mixer/Mixer.hxx"
#include "mixer/Listener.hxx"
@@ -30,7 +31,6 @@
#include "util/ASCII.hxx"
#include "util/Domain.hxx"
#include "util/Math.hxx"
#include "util/RuntimeError.hxx"
#include "Log.hxx"
extern "C" {
@@ -279,7 +279,7 @@ AlsaMixer::Setup()
elem = alsa_mixer_lookup_elem(handle, control, index);
if (elem == nullptr)
throw FormatRuntimeError("no such mixer control: %s", control);
throw FmtRuntimeError("no such mixer control: {}", control);
snd_mixer_elem_set_callback_private(elem, this);
snd_mixer_elem_set_callback(elem, ElemCallback);

View File

@@ -20,11 +20,11 @@
#include "OssMixerPlugin.hxx"
#include "mixer/Mixer.hxx"
#include "config/Block.hxx"
#include "lib/fmt/RuntimeError.hxx"
#include "io/FileDescriptor.hxx"
#include "lib/fmt/SystemError.hxx"
#include "util/ASCII.hxx"
#include "util/Domain.hxx"
#include "util/RuntimeError.hxx"
#include "Log.hxx"
#include <cassert>
@@ -91,8 +91,8 @@ OssMixer::Configure(const ConfigBlock &block)
if (control != NULL) {
volume_control = oss_find_mixer(control);
if (volume_control < 0)
throw FormatRuntimeError("no such mixer control: %s",
control);
throw FmtRuntimeError("no such mixer control: {}",
control);
} else
volume_control = SOUND_MIXER_PCM;
}

View File

@@ -18,13 +18,13 @@
*/
#include "PulseMixerPlugin.hxx"
#include "lib/fmt/RuntimeError.hxx"
#include "lib/pulse/LogError.hxx"
#include "lib/pulse/LockGuard.hxx"
#include "mixer/Mixer.hxx"
#include "mixer/Listener.hxx"
#include "output/plugins/PulseOutputPlugin.hxx"
#include "util/NumberParser.hxx"
#include "util/RuntimeError.hxx"
#include "config/Block.hxx"
#include <pulse/context.h>
@@ -177,9 +177,9 @@ parse_volume_scale_factor(const char *value) {
float factor = ParseFloat(value, &endptr);
if (endptr == value || *endptr != '\0' || factor < 0.5f || factor > 5.0f)
throw FormatRuntimeError("\"%s\" is not a number in the "
"range 0.5 to 5.0",
value);
throw FmtRuntimeError("\"{}\" is not a number in the "
"range 0.5 to 5.0",
value);
return factor;
}