summaryrefslogtreecommitdiff
path: root/src/CrossFade.cxx
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/CrossFade.cxx
parentc53492a76a8a05825e1c7f699c05645eee891199 (diff)
Log: new logging library API
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
Diffstat (limited to 'src/CrossFade.cxx')
-rw-r--r--src/CrossFade.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/CrossFade.cxx b/src/CrossFade.cxx
index db335651a..420276970 100644
--- a/src/CrossFade.cxx
+++ b/src/CrossFade.cxx
@@ -21,23 +21,25 @@
#include "CrossFade.hxx"
#include "MusicChunk.hxx"
#include "AudioFormat.hxx"
+#include "util/Domain.hxx"
+#include "Log.hxx"
#include <cmath>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
-#include <glib.h>
-#undef G_LOG_DOMAIN
-#define G_LOG_DOMAIN "crossfade"
+static constexpr Domain cross_fade_domain("cross_fade");
+
+#ifdef WIN32
-#ifdef G_OS_WIN32
static char *
strtok_r(char *str, const char *delim, gcc_unused char **saveptr)
{
return strtok(str, delim);
}
+
#endif
static float mixramp_interpolate(char *ramp_list, float required_db)
@@ -123,14 +125,16 @@ unsigned cross_fade_calc(float duration, float total_time,
if (!std::isnan(mixramp_overlap) &&
mixramp_delay <= mixramp_overlap) {
chunks = (chunks_f * (mixramp_overlap - mixramp_delay));
- g_debug("will overlap %d chunks, %fs", chunks,
- mixramp_overlap - mixramp_delay);
+ FormatDebug(cross_fade_domain,
+ "will overlap %d chunks, %fs", chunks,
+ mixramp_overlap - mixramp_delay);
}
}
if (chunks > max_chunks) {
chunks = max_chunks;
- g_warning("audio_buffer_size too small for computed MixRamp overlap");
+ LogWarning(cross_fade_domain,
+ "audio_buffer_size too small for computed MixRamp overlap");
}
return chunks;