crossfade: added API documentation

This commit is contained in:
Max Kellermann 2009-02-20 14:57:32 +01:00
parent 91ebf46853
commit cae7c160a3

View File

@ -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);