crossfade: added API documentation
This commit is contained in:
parent
91ebf46853
commit
cae7c160a3
@ -23,11 +23,32 @@
|
|||||||
struct audio_format;
|
struct audio_format;
|
||||||
struct music_chunk;
|
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,
|
unsigned cross_fade_calc(float duration, float total_time,
|
||||||
const struct audio_format *af,
|
const struct audio_format *af,
|
||||||
const struct audio_format *old_format,
|
const struct audio_format *old_format,
|
||||||
unsigned max_chunks);
|
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,
|
void cross_fade_apply(struct music_chunk *a, const struct music_chunk *b,
|
||||||
const struct audio_format *format,
|
const struct audio_format *format,
|
||||||
unsigned int current_chunk, unsigned int num_chunks);
|
unsigned int current_chunk, unsigned int num_chunks);
|
||||||
|
Loading…
Reference in New Issue
Block a user