comparison src/audio/SDL_mixer.c @ 3784:37c9c4590689 SDL-ryan-multiple-audio-device

First batch of heavy lifting on supporting multiple audio devices at once. This has a long way to go yet, most of the drivers aren't updated for the new interfaces, and it's still got some obvious bugs, FIXMEs, and wistlist items. Don't use yet.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 01 Oct 2006 05:24:03 +0000
parents 7abe37467fa5
children 3ee59c43d784
comparison
equal deleted inserted replaced
3783:dc3870a3f30d 3784:37c9c4590689
87 87
88 /* The volume ranges from 0 - 128 */ 88 /* The volume ranges from 0 - 128 */
89 #define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME) 89 #define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME)
90 #define ADJUST_VOLUME_U8(s, v) (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128) 90 #define ADJUST_VOLUME_U8(s, v) (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128)
91 91
92 void
93 SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume)
94 {
95 /* Mix the user-level audio format */
96 if (current_audio) {
97 SDL_AudioFormat format;
98 if (current_audio->convert.needed) {
99 format = current_audio->convert.src_format;
100 } else {
101 format = current_audio->spec.format;
102 }
103 SDL_MixAudioFormat(dst, src, format, len, volume);
104 }
105 }
106
107 92
108 void 93 void
109 SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, 94 SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format,
110 Uint32 len, int volume) 95 Uint32 len, int volume)
111 { 96 {