|
|
| version 1.13, 2010/11/07 14:01:54 | version 1.15, 2011/01/15 16:48:39 |
|---|---|
| Line 421 buffer_init(void) | Line 421 buffer_init(void) |
| } | } |
| sound_buffer[i] = (char *)_MALLOC(opna_frame, "sound buffer"); | sound_buffer[i] = (char *)_MALLOC(opna_frame, "sound buffer"); |
| if (sound_buffer[i] == NULL) { | if (sound_buffer[i] == NULL) { |
| fprintf(stderr, "buffer_init: can't alloc memory\n"); | g_printerr("buffer_init: can't alloc memory\n"); |
| sounddrv_unlock(); | sounddrv_unlock(); |
| return FAILURE; | return FAILURE; |
| } | } |
| Line 466 static BOOL | Line 466 static BOOL |
| nosound_drvinit(UINT rate, UINT bufmsec) | nosound_drvinit(UINT rate, UINT bufmsec) |
| { | { |
| UNUSED(rate); | |
| UNUSED(bufmsec); | |
| return SUCCESS; | return SUCCESS; |
| } | } |
| Line 511 static void * | Line 508 static void * |
| nosound_pcmload(UINT num, const char *path) | nosound_pcmload(UINT num, const char *path) |
| { | { |
| UNUSED(num); | |
| UNUSED(path); | |
| return NULL; | return NULL; |
| } | } |
| Line 521 static void | Line 515 static void |
| nosound_pcmdestroy(void *chanp, UINT num) | nosound_pcmdestroy(void *chanp, UINT num) |
| { | { |
| UNUSED(chanp); | |
| UNUSED(num); | |
| /* Nothing to do */ | /* Nothing to do */ |
| } | } |
| Line 531 static void | Line 522 static void |
| nosound_pcmplay(void *chanp, UINT num, BOOL loop) | nosound_pcmplay(void *chanp, UINT num, BOOL loop) |
| { | { |
| UNUSED(chanp); | |
| UNUSED(num); | |
| UNUSED(loop); | |
| /* Nothing to do */ | /* Nothing to do */ |
| } | } |
| Line 542 static void | Line 529 static void |
| nosound_pcmstop(void *chanp, UINT num) | nosound_pcmstop(void *chanp, UINT num) |
| { | { |
| UNUSED(chanp); | |
| UNUSED(num); | |
| /* Nothing to do */ | /* Nothing to do */ |
| } | } |
| Line 552 static void | Line 536 static void |
| nosound_pcmvolume(void *chanp, UINT num, int volume) | nosound_pcmvolume(void *chanp, UINT num, int volume) |
| { | { |
| UNUSED(chanp); | |
| UNUSED(num); | |
| UNUSED(volume); | |
| /* Nothing to do */ | /* Nothing to do */ |
| } | } |
| Line 807 sdlaudio_init(UINT rate, UINT samples) | Line 787 sdlaudio_init(UINT rate, UINT samples) |
| rv = SDL_InitSubSystem(SDL_INIT_AUDIO); | rv = SDL_InitSubSystem(SDL_INIT_AUDIO); |
| if (rv < 0) { | if (rv < 0) { |
| fprintf(stderr, "sdlaudio_init: SDL_InitSubSystem\n"); | g_printerr("sdlmixer_init: SDL_InitSubSystem(): %s\n", |
| SDL_GetError()); | |
| return FAILURE; | return FAILURE; |
| } | } |
| audio_fd = SDL_OpenAudio(&fmt, NULL); | audio_fd = SDL_OpenAudio(&fmt, NULL); |
| if (audio_fd < 0) { | if (audio_fd < 0) { |
| fprintf(stderr, "sdlaudio_init: SDL_OpenAudio\n"); | g_printerr("sdlaudio_init: SDL_OpenAudio(): %s\n", |
| SDL_GetError()); | |
| SDL_QuitSubSystem(SDL_INIT_AUDIO); | SDL_QuitSubSystem(SDL_INIT_AUDIO); |
| return FAILURE; | return FAILURE; |
| } | } |
| Line 861 sdlmixer_init(UINT rate, UINT samples) | Line 843 sdlmixer_init(UINT rate, UINT samples) |
| rv = SDL_InitSubSystem(SDL_INIT_AUDIO); | rv = SDL_InitSubSystem(SDL_INIT_AUDIO); |
| if (rv < 0) { | if (rv < 0) { |
| fprintf(stderr, "sdlmixer_init: SDL_InitSubSystem(): %s\n", | g_printerr("sdlmixer_init: SDL_InitSubSystem(): %s\n", |
| SDL_GetError()); | SDL_GetError()); |
| goto failure; | goto failure; |
| } | } |
| rv = Mix_OpenAudio(rate, AUDIO_S16SYS, 2, samples); | rv = Mix_OpenAudio(rate, AUDIO_S16SYS, 2, samples); |
| if (rv < 0) { | if (rv < 0) { |
| fprintf(stderr, "sdlmixer_init: Mix_OpenAudio(): %s\n", | g_printerr("sdlmixer_init: Mix_OpenAudio(): %s\n", |
| Mix_GetError()); | Mix_GetError()); |
| goto failure1; | goto failure1; |
| } | } |
| rv = Mix_AllocateChannels(SOUND_MAXPCM); | rv = Mix_AllocateChannels(SOUND_MAXPCM); |
| if (rv < 0) { | if (rv < 0) { |
| fprintf(stderr, "sdlmixer_init: Mix_AllocateChannels(): %s\n", | g_printerr("sdlmixer_init: Mix_AllocateChannels(): %s\n", |
| Mix_GetError()); | Mix_GetError()); |
| goto failure1; | goto failure1; |
| } | } |
| Line 905 sdlmixer_pcmload(UINT num, const char *p | Line 887 sdlmixer_pcmload(UINT num, const char *p |
| { | { |
| Mix_Chunk *chunk; | Mix_Chunk *chunk; |
| UNUSED(num); | |
| chunk = Mix_LoadWAV(path); | chunk = Mix_LoadWAV(path); |
| return (void *)chunk; | return (void *)chunk; |
| } | } |
| Line 932 static void | Line 912 static void |
| sdlmixer_pcmstop(void *chanp, UINT num) | sdlmixer_pcmstop(void *chanp, UINT num) |
| { | { |
| UNUSED(chanp); | |
| Mix_HaltChannel(num); | Mix_HaltChannel(num); |
| } | } |
| Line 941 static void | Line 919 static void |
| sdlmixer_pcmvolume(void *chanp, UINT num, int volume) | sdlmixer_pcmvolume(void *chanp, UINT num, int volume) |
| { | { |
| UNUSED(chanp); | |
| Mix_Volume(num, (MIX_MAX_VOLUME * volume) / 100); | Mix_Volume(num, (MIX_MAX_VOLUME * volume) / 100); |
| } | } |