src/crossfade.h File Reference

Go to the source code of this file.

Functions

unsigned cross_fade_calc (float duration, float total_time, const struct audio_format *af, const struct audio_format *old_format, unsigned max_chunks)
 Calculate how many music pipe chunks should be used for crossfading.
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)
 Applies cross fading to two chunks, i.e.


Function Documentation

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 
)

Applies cross fading to two chunks, i.e.

mixes these chunks. Internally, this calls pcm_mix().

Parameters:
a the chunk in the current song (and the destination chunk)
b the according chunk in the new song
format the audio format of both chunks (must be the same)
current_chunk the relative index of the current chunk
num_chunks the number of chunks used for cross fading

unsigned cross_fade_calc ( float  duration,
float  total_time,
const struct audio_format af,
const struct audio_format old_format,
unsigned  max_chunks 
)

Calculate how many music pipe chunks should be used for crossfading.

Parameters:
duration the requested crossfade duration
total_time total_time the duration of the new song
af the audio format of the new song
old_format the audio format of the current song
max_chunks the maximum number of chunks
Returns:
the number of chunks for crossfading, or 0 if cross fading should be disabled for this song change


Generated on Thu Sep 3 02:29:41 2009 for MPD by  doxygen 1.5.9