aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-27 22:31:24 +0200
committerMax Kellermann <max@duempel.org>2013-10-02 08:57:55 +0200
commit060814daa83f6a94f5934464ae42a406c5c7e947 (patch)
treef636ec6cdbb8e52fda6db987d2a28fc73c7b94b4 /src/filter
parentc53492a76a8a05825e1c7f699c05645eee891199 (diff)
downloadmpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.gz
mpd-060814daa83f6a94f5934464ae42a406c5c7e947.tar.xz
mpd-060814daa83f6a94f5934464ae42a406c5c7e947.zip
Log: new logging library API
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
Diffstat (limited to 'src/filter')
-rw-r--r--src/filter/ReplayGainFilterPlugin.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/filter/ReplayGainFilterPlugin.cxx b/src/filter/ReplayGainFilterPlugin.cxx
index 0dd8905cb..d22a5232e 100644
--- a/src/filter/ReplayGainFilterPlugin.cxx
+++ b/src/filter/ReplayGainFilterPlugin.cxx
@@ -30,14 +30,12 @@
#include "pcm/PcmBuffer.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
-
-#include <glib.h>
+#include "Log.hxx"
#include <assert.h>
#include <string.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "replay_gain"
+static constexpr Domain replay_gain_domain("replay_gain");
class ReplayGainFilter final : public Filter {
/**
@@ -105,7 +103,9 @@ public:
/* no change */
return;
- g_debug("replay gain mode has changed %d->%d\n", mode, _mode);
+ FormatDebug(replay_gain_domain,
+ "replay gain mode has changed %d->%d\n",
+ mode, _mode);
mode = _mode;
Update();
@@ -122,15 +122,14 @@ public:
size_t *dest_size_r, Error &error);
};
-static constexpr Domain replay_gain_domain("replay_gain");
-
void
ReplayGainFilter::Update()
{
if (mode != REPLAY_GAIN_OFF) {
float scale = replay_gain_tuple_scale(&info.tuples[mode],
replay_gain_preamp, replay_gain_missing_preamp, replay_gain_limit);
- g_debug("scale=%f\n", (double)scale);
+ FormatDebug(replay_gain_domain,
+ "scale=%f\n", (double)scale);
volume = pcm_float_to_volume(scale);
} else
@@ -145,8 +144,7 @@ ReplayGainFilter::Update()
Error error;
if (!mixer_set_volume(mixer, _volume, error))
- g_warning("Failed to update hardware mixer: %s",
- error.GetMessage());
+ LogError(error, "Failed to update hardware mixer");
}
}