Search
lxdream.org :: lxdream/src/drivers/audio_sdl.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/audio_sdl.c
changeset 1024:c67f2d61ab97
prev1021:848db285a184
next1049:e723f379ec88
author nkeynes
date Sat Jun 13 00:50:48 2009 +0000 (11 years ago)
permissions -rw-r--r--
last change Build drivers with library dependencies as shared objects (ie plugins)
file annotate diff log raw
1.1 --- a/src/drivers/audio_sdl.c Wed Jun 03 11:37:10 2009 +0000
1.2 +++ b/src/drivers/audio_sdl.c Sat Jun 13 00:50:48 2009 +0000
1.3 @@ -28,13 +28,12 @@
1.4 #define BUFFER_MIN_SIZE SDL_SAMPLES * BYTES_PER_SAMPLE * 4
1.5 #define BUFFER_MAX_SIZE SDL_SAMPLES * BYTES_PER_SAMPLE * 16
1.6
1.7 -char *audio_buffer;
1.8 -int buffer_pos;
1.9 +static char *audio_buffer;
1.10 +static int buffer_pos;
1.11
1.12 -void mix_audio(void *userdata, Uint8 *stream, int len);
1.13 -void audio_sdl_start();
1.14 +static void mix_audio(void *userdata, Uint8 *stream, int len);
1.15
1.16 -gboolean audio_sdl_init( )
1.17 +static gboolean audio_sdl_init( )
1.18 {
1.19 int rate = DEFAULT_SAMPLE_RATE;
1.20 int format = DEFAULT_SAMPLE_FORMAT;
1.21 @@ -67,9 +66,6 @@
1.22 return FALSE;
1.23 }
1.24
1.25 - //hmm, this doesn't seem to get called externally...
1.26 - audio_sdl_start();
1.27 -
1.28 return TRUE;
1.29 }
1.30
1.31 @@ -90,7 +86,7 @@
1.32 return TRUE;
1.33 }
1.34
1.35 -void mix_audio(void *userdata, Uint8 *stream, int len)
1.36 +static void mix_audio(void *userdata, Uint8 *stream, int len)
1.37 {
1.38 if (len < buffer_pos)
1.39 {
1.40 @@ -107,26 +103,27 @@
1.41 }
1.42 }
1.43
1.44 -gboolean audio_sdl_shutdown()
1.45 +static gboolean audio_sdl_shutdown()
1.46 {
1.47 SDL_CloseAudio();
1.48 free(audio_buffer);
1.49 return TRUE;
1.50 }
1.51
1.52 -void audio_sdl_start()
1.53 +static void audio_sdl_start()
1.54 {
1.55 SDL_PauseAudio(0);
1.56 }
1.57
1.58 -void audio_sdl_stop()
1.59 +static void audio_sdl_stop()
1.60 {
1.61 SDL_PauseAudio(1);
1.62 }
1.63
1.64 -struct audio_driver audio_sdl_driver = {
1.65 +static struct audio_driver audio_sdl_driver = {
1.66 "sdl",
1.67 N_("SDL sound driver"),
1.68 + 20,
1.69 DEFAULT_SAMPLE_RATE,
1.70 DEFAULT_SAMPLE_FORMAT,
1.71 audio_sdl_init,
1.72 @@ -136,3 +133,4 @@
1.73 audio_sdl_shutdown
1.74 };
1.75
1.76 +AUDIO_DRIVER( "sdl", audio_sdl_driver );
.