diff options
author | Max Kellermann <max@duempel.org> | 2008-09-07 19:19:55 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-07 19:19:55 +0200 |
commit | f1dd9c209c3a1cf6826d3a38b60f638e0faeadab (patch) | |
tree | 91e369d89eac8d298f1473c0dbcdf43065ae3b40 /src/pcm_utils.c | |
parent | bd81fd8b0c4f4f3c20533e21d6a837326eb8682b (diff) |
audio_format: converted typedef AudioFormat to struct audio_format
Get rid of CamelCase, and don't use a typedef, so we can
forward-declare it, and unclutter the include dependencies.
Diffstat (limited to 'src/pcm_utils.c')
-rw-r--r-- | src/pcm_utils.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/pcm_utils.c b/src/pcm_utils.c index 90856fa1d..a9706e019 100644 --- a/src/pcm_utils.c +++ b/src/pcm_utils.c @@ -22,9 +22,11 @@ #include "log.h" #include "utils.h" #include "conf.h" +#include "audio_format.h" #include "os_compat.h" -void pcm_volumeChange(char *buffer, int bufferSize, const AudioFormat * format, +void pcm_volumeChange(char *buffer, int bufferSize, + const struct audio_format *format, int volume) { mpd_sint32 temp32; @@ -76,7 +78,7 @@ void pcm_volumeChange(char *buffer, int bufferSize, const AudioFormat * format, static void pcm_add(char *buffer1, const char *buffer2, size_t bufferSize1, size_t bufferSize2, int vol1, int vol2, - const AudioFormat * format) + const struct audio_format *format) { mpd_sint32 temp32; mpd_sint8 *buffer8_1 = (mpd_sint8 *) buffer1; @@ -130,7 +132,8 @@ static void pcm_add(char *buffer1, const char *buffer2, size_t bufferSize1, } void pcm_mix(char *buffer1, const char *buffer2, size_t bufferSize1, - size_t bufferSize2, const AudioFormat * format, float portion1) + size_t bufferSize2, const struct audio_format *format, + float portion1) { int vol1; float s = sin(M_PI_2 * portion1); @@ -392,9 +395,9 @@ static const char *pcm_convertTo16bit(mpd_sint8 bits, const char *inBuffer, } /* outFormat bits must be 16 and channels must be 1 or 2! */ -size_t pcm_convertAudioFormat(const AudioFormat * inFormat, +size_t pcm_convertAudioFormat(const struct audio_format *inFormat, const char *inBuffer, size_t inSize, - const AudioFormat * outFormat, + const struct audio_format *outFormat, char *outBuffer, ConvState *convState) { const char *buf; @@ -430,8 +433,8 @@ size_t pcm_convertAudioFormat(const AudioFormat * inFormat, return len; } -size_t pcm_sizeOfConvBuffer(const AudioFormat * inFormat, size_t inSize, - const AudioFormat * outFormat) +size_t pcm_sizeOfConvBuffer(const struct audio_format *inFormat, size_t inSize, + const struct audio_format *outFormat) { const double ratio = (double)outFormat->sampleRate / (double)inFormat->sampleRate; |