Mercurial > sdl-ios-xcode
comparison src/audio/macrom/SDL_romaudio.c @ 1402:d910939febfa
Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 21 Feb 2006 08:46:50 +0000 |
parents | 19418e4422cb |
children | f12379c41042 |
comparison
equal
deleted
inserted
replaced
1401:1819fd069e89 | 1402:d910939febfa |
---|---|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
18 | 18 |
19 Sam Lantinga | 19 Sam Lantinga |
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 #include "SDL_config.h" | |
22 | 23 |
23 #if defined(__APPLE__) && defined(__MACH__) | 24 #if defined(__APPLE__) && defined(__MACH__) |
24 # include <Carbon/Carbon.h> | 25 # include <Carbon/Carbon.h> |
25 #elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335) | 26 #elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335) |
26 # include <Carbon.h> | 27 # include <Carbon.h> |
90 this->CloseAudio = Mac_CloseAudio; | 91 this->CloseAudio = Mac_CloseAudio; |
91 this->LockAudio = Mac_LockAudio; | 92 this->LockAudio = Mac_LockAudio; |
92 this->UnlockAudio = Mac_UnlockAudio; | 93 this->UnlockAudio = Mac_UnlockAudio; |
93 this->free = Audio_DeleteDevice; | 94 this->free = Audio_DeleteDevice; |
94 | 95 |
95 #ifdef MACOSX /* MacOS X uses threaded audio, so normal thread code is okay */ | 96 #ifdef __MACOSX__ /* MacOS X uses threaded audio, so normal thread code is okay */ |
96 this->LockAudio = NULL; | 97 this->LockAudio = NULL; |
97 this->UnlockAudio = NULL; | 98 this->UnlockAudio = NULL; |
98 #endif | 99 #endif |
99 return this; | 100 return this; |
100 } | 101 } |
118 static volatile Uint32 fill_me = 0; | 119 static volatile Uint32 fill_me = 0; |
119 | 120 |
120 static void mix_buffer(SDL_AudioDevice *audio, UInt8 *buffer) | 121 static void mix_buffer(SDL_AudioDevice *audio, UInt8 *buffer) |
121 { | 122 { |
122 if ( ! audio->paused ) { | 123 if ( ! audio->paused ) { |
123 #ifdef MACOSX | 124 #ifdef __MACOSX__ |
124 SDL_mutexP(audio->mixer_lock); | 125 SDL_mutexP(audio->mixer_lock); |
125 #endif | 126 #endif |
126 if ( audio->convert.needed ) { | 127 if ( audio->convert.needed ) { |
127 audio->spec.callback(audio->spec.userdata, | 128 audio->spec.callback(audio->spec.userdata, |
128 (Uint8 *)audio->convert.buf,audio->convert.len); | 129 (Uint8 *)audio->convert.buf,audio->convert.len); |
132 } | 133 } |
133 SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt); | 134 SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt); |
134 } else { | 135 } else { |
135 audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size); | 136 audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size); |
136 } | 137 } |
137 #ifdef MACOSX | 138 #ifdef __MACOSX__ |
138 SDL_mutexV(audio->mixer_lock); | 139 SDL_mutexV(audio->mixer_lock); |
139 #endif | 140 #endif |
140 } | 141 } |
141 | 142 |
142 DecrementAtomic((SInt32 *) &need_to_mix); | 143 DecrementAtomic((SInt32 *) &need_to_mix); |