aboutsummaryrefslogtreecommitdiffstats
path: root/src/crossfade.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-20 14:57:32 +0100
committerMax Kellermann <max@duempel.org>2009-02-20 14:57:32 +0100
commitcae7c160a3084acf9e68845b16bae34772d18e4e (patch)
treec22ae965c51326bed1fa2cb7e8eb41b64bfcd845 /src/crossfade.h
parent91ebf4685380eb3cb43b49d389ced8f8fbac7f6a (diff)
downloadmpd-cae7c160a3084acf9e68845b16bae34772d18e4e.tar.gz
mpd-cae7c160a3084acf9e68845b16bae34772d18e4e.tar.xz
mpd-cae7c160a3084acf9e68845b16bae34772d18e4e.zip
crossfade: added API documentation
Diffstat (limited to 'src/crossfade.h')
-rw-r--r--src/crossfade.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/crossfade.h b/src/crossfade.h
index 31495f806..8d6706b99 100644
--- a/src/crossfade.h
+++ b/src/crossfade.h
@@ -23,11 +23,32 @@
struct audio_format;
struct music_chunk;
+/**
+ * Calculate how many music pipe chunks should be used for crossfading.
+ *
+ * @param duration the requested crossfade duration
+ * @param total_time total_time the duration of the new song
+ * @param af the audio format of the new song
+ * @param old_format the audio format of the current song
+ * @param max_chunks the maximum number of chunks
+ * @return the number of chunks for crossfading, or 0 if cross fading
+ * should be disabled for this song change
+ */
unsigned cross_fade_calc(float duration, float total_time,
const struct audio_format *af,
const struct audio_format *old_format,
unsigned max_chunks);
+/*
+ * Applies cross fading to two chunks, i.e. mixes these chunks.
+ * Internally, this calls pcm_mix().
+ *
+ * @param a the chunk in the current song (and the destination chunk)
+ * @param b the according chunk in the new song
+ * @param format the audio format of both chunks (must be the same)
+ * @param current_chunk the relative index of the current chunk
+ * @param num_chunks the number of chunks used for cross fading
+ */
void cross_fade_apply(struct music_chunk *a, const struct music_chunk *b,
const struct audio_format *format,
unsigned int current_chunk, unsigned int num_chunks);