Moved AudioBootstrap section in converted drivers to bottom of source, so I SDL-ryan-multiple-audio-device
authorRyan C. Gordon
Fri, 06 Oct 2006 04:46:58 +0000
branchSDL-ryan-multiple-audio-device
changeset 38169d070c1a45fa
parent 3815 3234d6eee011
child 3817 103bbe13f5eb
Moved AudioBootstrap section in converted drivers to bottom of source, so I
could delete the predeclarations (one more thing to forget to update when
changing the API, otherwise). There're a few other cleanups that snuck into
this commit, too.
src/audio/arts/SDL_artsaudio.c
src/audio/bsd/SDL_bsdaudio.c
src/audio/dc/SDL_dcaudio.c
src/audio/disk/SDL_diskaudio.c
src/audio/dma/SDL_dmaaudio.c
src/audio/dsp/SDL_dspaudio.c
src/audio/dummy/SDL_dummyaudio.c
src/audio/esd/SDL_esdaudio.c
src/audio/macosx/SDL_coreaudio.c
src/audio/macrom/SDL_romaudio.c
     1.1 --- a/src/audio/arts/SDL_artsaudio.c	Fri Oct 06 04:16:11 2006 +0000
     1.2 +++ b/src/audio/arts/SDL_artsaudio.c	Fri Oct 06 04:46:58 2006 +0000
     1.3 @@ -39,14 +39,6 @@
     1.4  /* The tag name used by artsc audio */
     1.5  #define ARTS_DRIVER_NAME         "arts"
     1.6  
     1.7 -/* Audio driver functions */
     1.8 -static int ARTS_OpenDevice(_THIS, const char *devname, int iscapture);
     1.9 -static void ARTS_WaitDevice(_THIS);
    1.10 -static void ARTS_PlayDevice(_THIS);
    1.11 -static Uint8 *ARTS_GetDeviceBuf(_THIS);
    1.12 -static void ARTS_CloseDevice(_THIS);
    1.13 -static void ARTS_WaitDone(_THIS);
    1.14 -
    1.15  #ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
    1.16  
    1.17  static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
    1.18 @@ -160,28 +152,6 @@
    1.19  }
    1.20  
    1.21  
    1.22 -static int
    1.23 -ARTS_Init(SDL_AudioDriverImpl *impl)
    1.24 -{
    1.25 -    /* Set the function pointers */
    1.26 -    impl->OpenDevice = ARTS_OpenDevice;
    1.27 -    impl->PlayDevice = ARTS_PlayDevice;
    1.28 -    impl->WaitDevice = ARTS_WaitDevice;
    1.29 -    impl->GetDeviceBuf = ARTS_GetDeviceBuf;
    1.30 -    impl->CloseDevice = ARTS_CloseDevice;
    1.31 -    impl->WaitDone = ARTS_WaitDone;
    1.32 -    impl->OnlyHasDefaultOutputDevice = 1;
    1.33 -
    1.34 -    return 1;
    1.35 -}
    1.36 -
    1.37 -
    1.38 -AudioBootStrap ARTS_bootstrap = {
    1.39 -    ARTS_DRIVER_NAME, "Analog RealTime Synthesizer",
    1.40 -    ARTS_Available, ARTS_Init, 0
    1.41 -};
    1.42 -
    1.43 -
    1.44  /* This function waits until it is possible to write a full sound buffer */
    1.45  static void
    1.46  ARTS_WaitDevice(_THIS)
    1.47 @@ -370,4 +340,26 @@
    1.48      return 1;
    1.49  }
    1.50  
    1.51 +
    1.52 +static int
    1.53 +ARTS_Init(SDL_AudioDriverImpl *impl)
    1.54 +{
    1.55 +    /* Set the function pointers */
    1.56 +    impl->OpenDevice = ARTS_OpenDevice;
    1.57 +    impl->PlayDevice = ARTS_PlayDevice;
    1.58 +    impl->WaitDevice = ARTS_WaitDevice;
    1.59 +    impl->GetDeviceBuf = ARTS_GetDeviceBuf;
    1.60 +    impl->CloseDevice = ARTS_CloseDevice;
    1.61 +    impl->WaitDone = ARTS_WaitDone;
    1.62 +    impl->OnlyHasDefaultOutputDevice = 1;
    1.63 +
    1.64 +    return 1;
    1.65 +}
    1.66 +
    1.67 +
    1.68 +AudioBootStrap ARTS_bootstrap = {
    1.69 +    ARTS_DRIVER_NAME, "Analog RealTime Synthesizer",
    1.70 +    ARTS_Available, ARTS_Init, 0
    1.71 +};
    1.72 +
    1.73  /* vi: set ts=4 sw=4 expandtab: */
     2.1 --- a/src/audio/bsd/SDL_bsdaudio.c	Fri Oct 06 04:16:11 2006 +0000
     2.2 +++ b/src/audio/bsd/SDL_bsdaudio.c	Fri Oct 06 04:46:58 2006 +0000
     2.3 @@ -269,46 +269,18 @@
     2.4              "waiting		:   %s\n"
     2.5              "active		:   %s\n"
     2.6              "",
     2.7 -            info.
     2.8 -            play.
     2.9 -            buffer_size,
    2.10 -            info.
    2.11 -            play.
    2.12 -            sample_rate,
    2.13 -            info.
    2.14 -            play.
    2.15 -            channels,
    2.16 -            info.
    2.17 -            play.
    2.18 -            precision,
    2.19 -            info.
    2.20 -            play.
    2.21 -            encoding,
    2.22 -            info.
    2.23 -            play.
    2.24 -            seek,
    2.25 -            info.
    2.26 -            play.
    2.27 -            samples,
    2.28 -            info.
    2.29 -            play.
    2.30 -            eof,
    2.31 -            info.
    2.32 -            play.
    2.33 -            pause
    2.34 -            ?
    2.35 -            "yes"
    2.36 -            :
    2.37 -            "no",
    2.38 -            info.
    2.39 -            play.
    2.40 -            error
    2.41 -            ?
    2.42 -            "yes"
    2.43 -            :
    2.44 -            "no",
    2.45 -            info.
    2.46 -            play.waiting ? "yes" : "no", info.play.active ? "yes" : "no");
    2.47 +            info.play.buffer_size,
    2.48 +            info.play.sample_rate,
    2.49 +            info.play.channels,
    2.50 +            info.play.precision,
    2.51 +            info.play.encoding,
    2.52 +            info.play.seek,
    2.53 +            info.play.samples,
    2.54 +            info.play.eof,
    2.55 +            info.play.pause ? "yes" : "no",
    2.56 +            info.play.error ? "yes" : "no",
    2.57 +            info.play.waiting ? "yes" : "no",
    2.58 +            info.play.active ? "yes" : "no");
    2.59  
    2.60      fprintf(stderr, "\n"
    2.61              "[audio info]\n"
     3.1 --- a/src/audio/dc/SDL_dcaudio.c	Fri Oct 06 04:16:11 2006 +0000
     3.2 +++ b/src/audio/dc/SDL_dcaudio.c	Fri Oct 06 04:46:58 2006 +0000
     3.3 @@ -28,7 +28,6 @@
     3.4  #include "SDL_audio.h"
     3.5  #include "../SDL_audiomem.h"
     3.6  #include "../SDL_audio_c.h"
     3.7 -#include "../SDL_audiodev_c.h"
     3.8  #include "SDL_dcaudio.h"
     3.9  
    3.10  #include "aica.h"
     4.1 --- a/src/audio/disk/SDL_diskaudio.c	Fri Oct 06 04:16:11 2006 +0000
     4.2 +++ b/src/audio/disk/SDL_diskaudio.c	Fri Oct 06 04:46:58 2006 +0000
     4.3 @@ -45,13 +45,6 @@
     4.4  #define DISKENVR_WRITEDELAY      "SDL_DISKAUDIODELAY"
     4.5  #define DISKDEFAULT_WRITEDELAY   150
     4.6  
     4.7 -/* Audio driver functions */
     4.8 -static int DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture);
     4.9 -static void DISKAUD_WaitDevice(_THIS);
    4.10 -static void DISKAUD_PlayDevice(_THIS);
    4.11 -static Uint8 *DISKAUD_GetDeviceBuf(_THIS);
    4.12 -static void DISKAUD_CloseDevice(_THIS);
    4.13 -
    4.14  static const char *
    4.15  DISKAUD_GetOutputFilename(const char *devname)
    4.16  {
    4.17 @@ -71,27 +64,6 @@
    4.18      return 1;  /* always available. */
    4.19  }
    4.20  
    4.21 -static int
    4.22 -DISKAUD_Init(SDL_AudioDriverImpl *impl)
    4.23 -{
    4.24 -    /* Initialize all variables that we clean on shutdown */
    4.25 -    SDL_memset(impl, '\0', sizeof (SDL_AudioDriverImpl));
    4.26 -
    4.27 -    /* Set the function pointers */
    4.28 -    impl->OpenDevice = DISKAUD_OpenDevice;
    4.29 -    impl->WaitDevice = DISKAUD_WaitDevice;
    4.30 -    impl->PlayDevice = DISKAUD_PlayDevice;
    4.31 -    impl->GetDeviceBuf = DISKAUD_GetDeviceBuf;
    4.32 -    impl->CloseDevice = DISKAUD_CloseDevice;
    4.33 -
    4.34 -    return 1;
    4.35 -}
    4.36 -
    4.37 -AudioBootStrap DISKAUD_bootstrap = {
    4.38 -    DISKAUD_DRIVER_NAME, "direct-to-disk audio",
    4.39 -    DISKAUD_Available, DISKAUD_Init, 1
    4.40 -};
    4.41 -
    4.42  /* This function waits until it is possible to write a full sound buffer */
    4.43  static void
    4.44  DISKAUD_WaitDevice(_THIS)
    4.45 @@ -183,4 +155,25 @@
    4.46      return 1;
    4.47  }
    4.48  
    4.49 +static int
    4.50 +DISKAUD_Init(SDL_AudioDriverImpl *impl)
    4.51 +{
    4.52 +    /* Initialize all variables that we clean on shutdown */
    4.53 +    SDL_memset(impl, '\0', sizeof (SDL_AudioDriverImpl));
    4.54 +
    4.55 +    /* Set the function pointers */
    4.56 +    impl->OpenDevice = DISKAUD_OpenDevice;
    4.57 +    impl->WaitDevice = DISKAUD_WaitDevice;
    4.58 +    impl->PlayDevice = DISKAUD_PlayDevice;
    4.59 +    impl->GetDeviceBuf = DISKAUD_GetDeviceBuf;
    4.60 +    impl->CloseDevice = DISKAUD_CloseDevice;
    4.61 +
    4.62 +    return 1;
    4.63 +}
    4.64 +
    4.65 +AudioBootStrap DISKAUD_bootstrap = {
    4.66 +    DISKAUD_DRIVER_NAME, "direct-to-disk audio",
    4.67 +    DISKAUD_Available, DISKAUD_Init, 1
    4.68 +};
    4.69 +
    4.70  /* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/src/audio/dma/SDL_dmaaudio.c	Fri Oct 06 04:16:11 2006 +0000
     5.2 +++ b/src/audio/dma/SDL_dmaaudio.c	Fri Oct 06 04:46:58 2006 +0000
     5.3 @@ -62,18 +62,6 @@
     5.4  #define OPEN_FLAGS_INPUT    (O_RDWR|O_NONBLOCK)
     5.5  #define OPEN_FLAGS_OUTPUT   (O_RDWR|O_NONBLOCK)
     5.6  
     5.7 -/* Audio driver functions */
     5.8 -static int DMA_DetectDevices(int iscapture);
     5.9 -static const char *DMA_GetDeviceName(int index, int iscapture);
    5.10 -static int DMA_OpenDevice(_THIS, const char *devname, int iscapture);
    5.11 -static void DMA_WaitDevice(_THIS);
    5.12 -static void DMA_PlayDevice(_THIS);
    5.13 -static Uint8 *DMA_GetDeviceBuf(_THIS);
    5.14 -static void DMA_CloseDevice(_THIS);
    5.15 -static void DMA_Deinitialize(void);
    5.16 -
    5.17 -/* Audio driver bootstrap functions */
    5.18 -
    5.19  static char **outputDevices = NULL;
    5.20  static int outputDeviceCount = 0;
    5.21  static char **inputDevices = NULL;
    5.22 @@ -138,29 +126,6 @@
    5.23      return available;
    5.24  }
    5.25  
    5.26 -
    5.27 -static int
    5.28 -DMA_Init(SDL_AudioDriverImpl *impl)
    5.29 -{
    5.30 -    /* Set the function pointers */
    5.31 -    impl->DetectDevices = DMA_DetectDevices;
    5.32 -    impl->GetDeviceName = DMA_GetDeviceName;
    5.33 -    impl->OpenDevice = DMA_OpenDevice;
    5.34 -    impl->WaitDevice = DMA_WaitDevice;
    5.35 -    impl->PlayDevice = DMA_PlayDevice;
    5.36 -    impl->GetDeviceBuf = DMA_GetDeviceBuf;
    5.37 -    impl->CloseDevice = DMA_CloseDevice;
    5.38 -    impl->Deinitialize = DMA_Deinitialize;
    5.39 -
    5.40 -    build_device_lists();
    5.41 -    return 1;
    5.42 -}
    5.43 -
    5.44 -AudioBootStrap DMA_bootstrap = {
    5.45 -    DMA_DRIVER_NAME, "OSS /dev/dsp DMA audio",
    5.46 -    DMA_Available, DMA_Init, 0
    5.47 -};
    5.48 -
    5.49  static void DMA_Deinitialize(void)
    5.50  {
    5.51      free_device_lists();
    5.52 @@ -557,4 +522,26 @@
    5.53      }
    5.54  }
    5.55  
    5.56 +static int
    5.57 +DMA_Init(SDL_AudioDriverImpl *impl)
    5.58 +{
    5.59 +    /* Set the function pointers */
    5.60 +    impl->DetectDevices = DMA_DetectDevices;
    5.61 +    impl->GetDeviceName = DMA_GetDeviceName;
    5.62 +    impl->OpenDevice = DMA_OpenDevice;
    5.63 +    impl->WaitDevice = DMA_WaitDevice;
    5.64 +    impl->PlayDevice = DMA_PlayDevice;
    5.65 +    impl->GetDeviceBuf = DMA_GetDeviceBuf;
    5.66 +    impl->CloseDevice = DMA_CloseDevice;
    5.67 +    impl->Deinitialize = DMA_Deinitialize;
    5.68 +
    5.69 +    build_device_lists();
    5.70 +    return 1;
    5.71 +}
    5.72 +
    5.73 +AudioBootStrap DMA_bootstrap = {
    5.74 +    DMA_DRIVER_NAME, "OSS /dev/dsp DMA audio",
    5.75 +    DMA_Available, DMA_Init, 0
    5.76 +};
    5.77 +
    5.78  /* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/audio/dsp/SDL_dspaudio.c	Fri Oct 06 04:16:11 2006 +0000
     6.2 +++ b/src/audio/dsp/SDL_dspaudio.c	Fri Oct 06 04:46:58 2006 +0000
     6.3 @@ -58,16 +58,6 @@
     6.4  #define OPEN_FLAGS_OUTPUT    (O_WRONLY|O_NONBLOCK)
     6.5  #define OPEN_FLAGS_INPUT    (O_RDONLY|O_NONBLOCK)
     6.6  
     6.7 -/* Audio driver functions */
     6.8 -static int DSP_DetectDevices(int iscapture);
     6.9 -static const char *DSP_GetDeviceName(int index, int iscapture);
    6.10 -static int DSP_OpenDevice(_THIS, const char *devname, int iscapture);
    6.11 -static void DSP_WaitDevice(_THIS);
    6.12 -static void DSP_PlayDevice(_THIS);
    6.13 -static Uint8 *DSP_GetDeviceBuf(_THIS);
    6.14 -static void DSP_CloseDevice(_THIS);
    6.15 -static void DSP_Deinitialize(void);
    6.16 -
    6.17  /* Audio driver bootstrap functions */
    6.18  
    6.19  static char **outputDevices = NULL;
    6.20 @@ -116,29 +106,6 @@
    6.21  }
    6.22  
    6.23  
    6.24 -static int
    6.25 -DSP_Init(SDL_AudioDriverImpl *impl)
    6.26 -{
    6.27 -    /* Set the function pointers */
    6.28 -    impl->DetectDevices = DSP_DetectDevices;
    6.29 -    impl->GetDeviceName = DSP_GetDeviceName;
    6.30 -    impl->OpenDevice = DSP_OpenDevice;
    6.31 -    impl->PlayDevice = DSP_PlayDevice;
    6.32 -    impl->GetDeviceBuf = DSP_GetDeviceBuf;
    6.33 -    impl->CloseDevice = DSP_CloseDevice;
    6.34 -    impl->Deinitialize = DSP_Deinitialize;
    6.35 -
    6.36 -    build_device_lists();
    6.37 -    return 1;
    6.38 -}
    6.39 -
    6.40 -
    6.41 -AudioBootStrap DSP_bootstrap = {
    6.42 -    DSP_DRIVER_NAME, "OSS /dev/dsp standard audio",
    6.43 -    DSP_Available, DSP_Init, 0
    6.44 -};
    6.45 -
    6.46 -
    6.47  static void DSP_Deinitialize(void)
    6.48  {
    6.49      free_device_lists();
    6.50 @@ -402,4 +369,26 @@
    6.51      }
    6.52  }
    6.53  
    6.54 +static int
    6.55 +DSP_Init(SDL_AudioDriverImpl *impl)
    6.56 +{
    6.57 +    /* Set the function pointers */
    6.58 +    impl->DetectDevices = DSP_DetectDevices;
    6.59 +    impl->GetDeviceName = DSP_GetDeviceName;
    6.60 +    impl->OpenDevice = DSP_OpenDevice;
    6.61 +    impl->PlayDevice = DSP_PlayDevice;
    6.62 +    impl->GetDeviceBuf = DSP_GetDeviceBuf;
    6.63 +    impl->CloseDevice = DSP_CloseDevice;
    6.64 +    impl->Deinitialize = DSP_Deinitialize;
    6.65 +
    6.66 +    build_device_lists();
    6.67 +    return 1;
    6.68 +}
    6.69 +
    6.70 +
    6.71 +AudioBootStrap DSP_bootstrap = {
    6.72 +    DSP_DRIVER_NAME, "OSS /dev/dsp standard audio",
    6.73 +    DSP_Available, DSP_Init, 0
    6.74 +};
    6.75 +
    6.76  /* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/audio/dummy/SDL_dummyaudio.c	Fri Oct 06 04:16:11 2006 +0000
     7.2 +++ b/src/audio/dummy/SDL_dummyaudio.c	Fri Oct 06 04:46:58 2006 +0000
     7.3 @@ -35,10 +35,6 @@
     7.4  /* The tag name used by DUMMY audio */
     7.5  #define DUMMYAUD_DRIVER_NAME         "dummy"
     7.6  
     7.7 -/* Audio driver functions */
     7.8 -static int DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture);
     7.9 -
    7.10 -/* Audio driver bootstrap functions */
    7.11  static int
    7.12  DUMMYAUD_Available(void)
    7.13  {
    7.14 @@ -46,6 +42,13 @@
    7.15  }
    7.16  
    7.17  static int
    7.18 +DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture)
    7.19 +{
    7.20 +    return 1;   /* always succeeds. */
    7.21 +}
    7.22 +
    7.23 +
    7.24 +static int
    7.25  DUMMYAUD_Init(SDL_AudioDriverImpl *impl)
    7.26  {
    7.27      /* Set the function pointers */
    7.28 @@ -60,10 +63,4 @@
    7.29      DUMMYAUD_Available, DUMMYAUD_Init, 1
    7.30  };
    7.31  
    7.32 -static int
    7.33 -DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture)
    7.34 -{
    7.35 -    return 1;   /* always succeeds. */
    7.36 -}
    7.37 -
    7.38  /* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/audio/esd/SDL_esdaudio.c	Fri Oct 06 04:16:11 2006 +0000
     8.2 +++ b/src/audio/esd/SDL_esdaudio.c	Fri Oct 06 04:46:58 2006 +0000
     8.3 @@ -45,13 +45,6 @@
     8.4  /* The tag name used by ESD audio */
     8.5  #define ESD_DRIVER_NAME		"esd"
     8.6  
     8.7 -/* Audio driver functions */
     8.8 -static int ESD_OpenDevice(_THIS, const char *devname, int iscapture);
     8.9 -static void ESD_WaitDevice(_THIS);
    8.10 -static void ESD_PlayDevice(_THIS);
    8.11 -static Uint8 *ESD_GetDeviceBuf(_THIS);
    8.12 -static void ESD_CloseDevice(_THIS);
    8.13 -
    8.14  #ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
    8.15  
    8.16  static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC;
    8.17 @@ -122,8 +115,6 @@
    8.18  
    8.19  #endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */
    8.20  
    8.21 -/* Audio driver bootstrap functions */
    8.22 -
    8.23  static int
    8.24  ESD_Available(void)
    8.25  {
    8.26 @@ -144,26 +135,6 @@
    8.27  }
    8.28  
    8.29  
    8.30 -static int
    8.31 -ESD_Init(SDL_AudioDriverImpl *impl)
    8.32 -{
    8.33 -    /* Set the function pointers */
    8.34 -    impl->OpenDevice = ESD_OpenDevice;
    8.35 -    impl->PlayDevice = ESD_PlayDevice;
    8.36 -    impl->WaitDevice = ESD_WaitDevice;
    8.37 -    impl->GetDeviceBuf = ESD_GetDeviceBuf;
    8.38 -    impl->CloseDevice = ESD_CloseDevice;
    8.39 -    impl->OnlyHasDefaultOutputDevice = 1;
    8.40 -
    8.41 -    return 1;
    8.42 -}
    8.43 -
    8.44 -
    8.45 -AudioBootStrap ESD_bootstrap = {
    8.46 -    ESD_DRIVER_NAME, "Enlightened Sound Daemon",
    8.47 -    ESD_Available, ESD_Init, 0
    8.48 -};
    8.49 -
    8.50  /* This function waits until it is possible to write a full sound buffer */
    8.51  static void
    8.52  ESD_WaitDevice(_THIS)
    8.53 @@ -360,4 +331,25 @@
    8.54      return 1;
    8.55  }
    8.56  
    8.57 +
    8.58 +static int
    8.59 +ESD_Init(SDL_AudioDriverImpl *impl)
    8.60 +{
    8.61 +    /* Set the function pointers */
    8.62 +    impl->OpenDevice = ESD_OpenDevice;
    8.63 +    impl->PlayDevice = ESD_PlayDevice;
    8.64 +    impl->WaitDevice = ESD_WaitDevice;
    8.65 +    impl->GetDeviceBuf = ESD_GetDeviceBuf;
    8.66 +    impl->CloseDevice = ESD_CloseDevice;
    8.67 +    impl->OnlyHasDefaultOutputDevice = 1;
    8.68 +
    8.69 +    return 1;
    8.70 +}
    8.71 +
    8.72 +
    8.73 +AudioBootStrap ESD_bootstrap = {
    8.74 +    ESD_DRIVER_NAME, "Enlightened Sound Daemon",
    8.75 +    ESD_Available, ESD_Init, 0
    8.76 +};
    8.77 +
    8.78  /* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/audio/macosx/SDL_coreaudio.c	Fri Oct 06 04:16:11 2006 +0000
     9.2 +++ b/src/audio/macosx/SDL_coreaudio.c	Fri Oct 06 04:46:58 2006 +0000
     9.3 @@ -201,20 +201,6 @@
     9.4      return 0;
     9.5  }
     9.6  
     9.7 -
     9.8 -/* Audio driver functions */
     9.9 -
    9.10 -static int COREAUDIO_DetectDevices(int iscapture);
    9.11 -static const char *COREAUDIO_GetDeviceName(int index, int iscapture);
    9.12 -static int COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture);
    9.13 -static void COREAUDIO_WaitDevice(_THIS);
    9.14 -static void COREAUDIO_PlayDevice(_THIS);
    9.15 -static Uint8 *COREAUDIO_GetDeviceBuf(_THIS);
    9.16 -static void COREAUDIO_CloseDevice(_THIS);
    9.17 -static void COREAUDIO_Deinitialize(void);
    9.18 -
    9.19 -/* Audio driver bootstrap functions */
    9.20 -
    9.21  static int
    9.22  COREAUDIO_Available(void)
    9.23  {
    9.24 @@ -222,28 +208,6 @@
    9.25  }
    9.26  
    9.27  static int
    9.28 -COREAUDIO_Init(SDL_AudioDriverImpl *impl)
    9.29 -{
    9.30 -    /* Set the function pointers */
    9.31 -    impl->DetectDevices = COREAUDIO_DetectDevices;
    9.32 -    impl->GetDeviceName = COREAUDIO_GetDeviceName;
    9.33 -    impl->OpenDevice = COREAUDIO_OpenDevice;
    9.34 -    impl->CloseDevice = COREAUDIO_CloseDevice;
    9.35 -    impl->Deinitialize = COREAUDIO_Deinitialize;
    9.36 -    impl->ProvidesOwnCallbackThread = 1;
    9.37 -
    9.38 -    build_device_lists();  /* do an initial check for devices... */
    9.39 -
    9.40 -    return 1;
    9.41 -}
    9.42 -
    9.43 -AudioBootStrap COREAUDIO_bootstrap = {
    9.44 -    "coreaudio", "Mac OS X CoreAudio",
    9.45 -    COREAUDIO_Available, COREAUDIO_Init, 0
    9.46 -};
    9.47 -
    9.48 -
    9.49 -static int
    9.50  COREAUDIO_DetectDevices(int iscapture)
    9.51  {
    9.52      if (iscapture) {
    9.53 @@ -601,4 +565,25 @@
    9.54      return 1;  /* good to go. */
    9.55  }
    9.56  
    9.57 +static int
    9.58 +COREAUDIO_Init(SDL_AudioDriverImpl *impl)
    9.59 +{
    9.60 +    /* Set the function pointers */
    9.61 +    impl->DetectDevices = COREAUDIO_DetectDevices;
    9.62 +    impl->GetDeviceName = COREAUDIO_GetDeviceName;
    9.63 +    impl->OpenDevice = COREAUDIO_OpenDevice;
    9.64 +    impl->CloseDevice = COREAUDIO_CloseDevice;
    9.65 +    impl->Deinitialize = COREAUDIO_Deinitialize;
    9.66 +    impl->ProvidesOwnCallbackThread = 1;
    9.67 +
    9.68 +    build_device_lists();  /* do an initial check for devices... */
    9.69 +
    9.70 +    return 1;
    9.71 +}
    9.72 +
    9.73 +AudioBootStrap COREAUDIO_bootstrap = {
    9.74 +    "coreaudio", "Mac OS X CoreAudio",
    9.75 +    COREAUDIO_Available, COREAUDIO_Init, 0
    9.76 +};
    9.77 +
    9.78  /* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/audio/macrom/SDL_romaudio.c	Fri Oct 06 04:16:11 2006 +0000
    10.2 +++ b/src/audio/macrom/SDL_romaudio.c	Fri Oct 06 04:46:58 2006 +0000
    10.3 @@ -50,15 +50,6 @@
    10.4  #include "../SDL_sysaudio.h"
    10.5  #include "SDL_romaudio.h"
    10.6  
    10.7 -/* Audio driver functions */
    10.8 -
    10.9 -static void SNDMGR_CloseDevice(_THIS);
   10.10 -static int SNDMGR_OpenDevice(_THIS, const char *devname, int iscapture);
   10.11 -static void SNDMGR_LockDevice(_THIS);
   10.12 -static void SNDMGR_UnlockDevice(_THIS);
   10.13 -
   10.14 -/* Audio driver bootstrap functions */
   10.15 -
   10.16  static int
   10.17  SNDMGR_Available(void)
   10.18  {
   10.19 @@ -66,28 +57,6 @@
   10.20  }
   10.21  
   10.22  
   10.23 -static int
   10.24 -SNDMGR_Init(SDL_AudioDriverImpl *impl)
   10.25 -{
   10.26 -    /* Set the function pointers */
   10.27 -    impl->OpenDevice = SNDMGR_OpenDevice;
   10.28 -    impl->CloseDevice = SNDMGR_CloseDevice;
   10.29 -    impl->ProvidesOwnCallbackThread = 1;
   10.30 -    impl->OnlyHasDefaultOutputDevice = 1;
   10.31 -
   10.32 -#ifndef __MACOSX__               /* Mac OS X uses threaded audio, so normal thread code is okay */
   10.33 -    impl->LockDevice = SNDMGR_LockDevice;
   10.34 -    impl->UnlockDevice = SNDMGR_UnlockDevice;
   10.35 -#endif
   10.36 -
   10.37 -    return 1;
   10.38 -}
   10.39 -
   10.40 -AudioBootStrap SNDMGR_bootstrap = {
   10.41 -    "sndmgr", SDL_MACOS_NAME " SoundManager",
   10.42 -    SNDMGR_Available, SNDMGR_Init, 0
   10.43 -};
   10.44 -
   10.45  #pragma options align=power
   10.46  
   10.47  static volatile SInt32 audio_is_locked = 0;
   10.48 @@ -331,4 +300,26 @@
   10.49      this->hidden = NULL;
   10.50  }
   10.51  
   10.52 +static int
   10.53 +SNDMGR_Init(SDL_AudioDriverImpl *impl)
   10.54 +{
   10.55 +    /* Set the function pointers */
   10.56 +    impl->OpenDevice = SNDMGR_OpenDevice;
   10.57 +    impl->CloseDevice = SNDMGR_CloseDevice;
   10.58 +    impl->ProvidesOwnCallbackThread = 1;
   10.59 +    impl->OnlyHasDefaultOutputDevice = 1;
   10.60 +
   10.61 +#ifndef __MACOSX__               /* Mac OS X uses threaded audio, so normal thread code is okay */
   10.62 +    impl->LockDevice = SNDMGR_LockDevice;
   10.63 +    impl->UnlockDevice = SNDMGR_UnlockDevice;
   10.64 +#endif
   10.65 +
   10.66 +    return 1;
   10.67 +}
   10.68 +
   10.69 +AudioBootStrap SNDMGR_bootstrap = {
   10.70 +    "sndmgr", SDL_MACOS_NAME " SoundManager",
   10.71 +    SNDMGR_Available, SNDMGR_Init, 0
   10.72 +};
   10.73 +
   10.74  /* vi: set ts=4 sw=4 expandtab: */