aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);