Mercurial > sdl-ios-xcode
comparison src/audio/SDL_audio.c @ 1190:173c063d4f55
OS/2 port!
This was mostly, if not entirely, written by "Doodle" and "Caetano":
doodle@scenergy.dfmk.hu
daniel@caetano.eng.br
--ryan.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Wed, 23 Nov 2005 07:29:56 +0000 |
parents | d74fbf56f2f6 |
children | f9794ee91dfc |
comparison
equal
deleted
inserted
replaced
1189:c96b326b90ba | 1190:173c063d4f55 |
---|---|
36 #include "SDL_error.h" | 36 #include "SDL_error.h" |
37 #include "SDL_audio_c.h" | 37 #include "SDL_audio_c.h" |
38 #include "SDL_audiomem.h" | 38 #include "SDL_audiomem.h" |
39 #include "SDL_sysaudio.h" | 39 #include "SDL_sysaudio.h" |
40 | 40 |
41 #ifdef __OS2__ | |
42 // We'll need the DosSetPriority() API! | |
43 #define INCL_DOSPROCESS | |
44 #include <os2.h> | |
45 #endif | |
46 | |
41 /* Available audio drivers */ | 47 /* Available audio drivers */ |
42 static AudioBootStrap *bootstrap[] = { | 48 static AudioBootStrap *bootstrap[] = { |
43 #ifdef OPENBSD_AUDIO_SUPPORT | 49 #ifdef OPENBSD_AUDIO_SUPPORT |
44 &OPENBSD_AUDIO_bootstrap, | 50 &OPENBSD_AUDIO_bootstrap, |
45 #endif | 51 #endif |
106 &DCAUD_bootstrap, | 112 &DCAUD_bootstrap, |
107 #endif | 113 #endif |
108 #ifdef DRENDERER_SUPPORT | 114 #ifdef DRENDERER_SUPPORT |
109 &DRENDERER_bootstrap, | 115 &DRENDERER_bootstrap, |
110 #endif | 116 #endif |
117 #ifdef __OS2__ | |
118 &DART_bootstrap, | |
119 #endif | |
111 NULL | 120 NULL |
112 }; | 121 }; |
113 SDL_AudioDevice *current_audio = NULL; | 122 SDL_AudioDevice *current_audio = NULL; |
114 | 123 |
115 /* Various local functions */ | 124 /* Various local functions */ |
179 #ifdef ENABLE_AHI | 188 #ifdef ENABLE_AHI |
180 SDL_mutexV(audio->mixer_lock); | 189 SDL_mutexV(audio->mixer_lock); |
181 D(bug("Entering audio loop...\n")); | 190 D(bug("Entering audio loop...\n")); |
182 #endif | 191 #endif |
183 | 192 |
193 #ifdef __OS2__ | |
194 // Increase the priority of this thread to make sure that | |
195 // the audio will be continuous all the time! | |
196 #ifdef USE_DOSSETPRIORITY | |
197 #ifdef DEBUG_BUILD | |
198 printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID()); | |
199 #endif | |
200 DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0); | |
201 #endif | |
202 #endif | |
184 | 203 |
185 /* Loop, filling the audio buffers */ | 204 /* Loop, filling the audio buffers */ |
186 while ( audio->enabled ) { | 205 while ( audio->enabled ) { |
187 | 206 |
188 /* Wait for new current buffer to finish playing */ | 207 /* Wait for new current buffer to finish playing */ |
246 | 265 |
247 audio->CloseAudio(audio); | 266 audio->CloseAudio(audio); |
248 | 267 |
249 D(bug("CloseAudio..Done, subtask exiting...\n")); | 268 D(bug("CloseAudio..Done, subtask exiting...\n")); |
250 audio_configured = 0; | 269 audio_configured = 0; |
270 #endif | |
271 #ifdef __OS2__ | |
272 #ifdef DEBUG_BUILD | |
273 printf("[SDL_RunAudio] : Task exiting. (TID%d)\n", SDL_ThreadID()); | |
274 #endif | |
251 #endif | 275 #endif |
252 return(0); | 276 return(0); |
253 } | 277 } |
254 | 278 |
255 static void SDL_LockAudio_Default(SDL_AudioDevice *audio) | 279 static void SDL_LockAudio_Default(SDL_AudioDevice *audio) |