Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk.

  • Loading branch information
icculus committed Oct 17, 2006
1 parent 8c0ae5e commit bf035a46b4476e083d539009f63e993ed2d33403
Showing with 4,899 additions and 5,635 deletions.
  1. +41 −5 configure.in
  2. +27 −7 include/SDL_audio.h
  3. +3 −2 include/SDL_config.h.in
  4. +1 −1 include/SDL_thread.h
  5. +1 −0 src/SDL_error.c
  6. +579 −427 src/audio/SDL_audio.c
  7. +8 −10 src/audio/SDL_audiocvt.c
  8. +58 −104 src/audio/SDL_audiodev.c
  9. +4 −2 src/audio/SDL_audiodev_c.h
  10. +0 −15 src/audio/SDL_mixer.c
  11. +35 −100 src/audio/SDL_sysaudio.h
  12. +281 −362 src/audio/alsa/SDL_alsa_audio.c
  13. +1 −7 src/audio/alsa/SDL_alsa_audio.h
  14. +0 −360 src/audio/amigaos/SDL_ahiaudio.c
  15. +0 −62 src/audio/amigaos/SDL_ahiaudio.h
  16. +157 −158 src/audio/arts/SDL_artsaudio.c
  17. +1 −9 src/audio/arts/SDL_artsaudio.h
  18. +114 −147 src/audio/baudio/SDL_beaudio.cc
  19. +4 −6 src/audio/baudio/SDL_beaudio.h
  20. +218 −199 src/audio/bsd/SDL_bsdaudio.c
  21. +3 −10 src/audio/bsd/SDL_bsdaudio.h
  22. +141 −161 src/audio/dart/SDL_dart.c
  23. +5 −3 src/audio/dart/SDL_dart.h
  24. +65 −87 src/audio/dc/SDL_dcaudio.c
  25. +1 −1 src/audio/dc/SDL_dcaudio.h
  26. +65 −92 src/audio/disk/SDL_diskaudio.c
  27. +1 −1 src/audio/disk/SDL_diskaudio.h
  28. +271 −204 src/audio/dma/SDL_dmaaudio.c
  29. +6 −4 src/audio/dma/SDL_dmaaudio.h
  30. +76 −99 src/audio/dmedia/SDL_irixaudio.c
  31. +5 −10 src/audio/dmedia/SDL_irixaudio.h
  32. +173 −130 src/audio/dsp/SDL_dspaudio.c
  33. +1 −12 src/audio/dsp/SDL_dspaudio.h
  34. +8 −122 src/audio/dummy/SDL_dummyaudio.c
  35. +1 −1 src/audio/dummy/SDL_dummyaudio.h
  36. +151 −141 src/audio/esd/SDL_esdaudio.c
  37. +1 −9 src/audio/esd/SDL_esdaudio.h
  38. +427 −151 src/audio/macosx/SDL_coreaudio.c
  39. +3 −8 src/audio/macosx/SDL_coreaudio.h
  40. +56 −266 src/audio/macrom/SDL_romaudio.c
  41. +1 −14 src/audio/macrom/SDL_romaudio.h
  42. +116 −153 src/audio/mint/SDL_mintaudio_dma8.c
  43. +135 −168 src/audio/mint/SDL_mintaudio_gsxb.c
  44. +148 −181 src/audio/mint/SDL_mintaudio_mcsn.c
  45. +116 −159 src/audio/mint/SDL_mintaudio_stfa.c
  46. +127 −164 src/audio/mint/SDL_mintaudio_xbios.c
  47. +128 −146 src/audio/mme/SDL_mmeaudio.c
  48. +5 −8 src/audio/mme/SDL_mmeaudio.h
  49. +188 −98 src/audio/nas/SDL_nasaudio.c
  50. +2 −4 src/audio/nas/SDL_nasaudio.h
  51. +154 −217 src/audio/nto/SDL_nto_audio.c
  52. +0 −16 src/audio/nto/SDL_nto_audio.h
  53. +182 −146 src/audio/paudio/SDL_paudio.c
  54. +1 −12 src/audio/paudio/SDL_paudio.h
  55. +6 −1 src/audio/sun/SDL_sunaudio.c
  56. +5 −4 src/audio/sun/SDL_sunaudio.h
  57. +6 −2 src/audio/ums/SDL_umsaudio.c
  58. +1 −1 src/audio/ums/SDL_umsaudio.h
  59. +149 −154 src/audio/windib/SDL_dibaudio.c
  60. +4 −10 src/audio/windib/SDL_dibaudio.h
  61. +202 −425 src/audio/windx5/SDL_dx5audio.c
  62. +6 −17 src/audio/windx5/SDL_dx5audio.h
  63. +1 −1 src/events/SDL_mouse.c
  64. +23 −19 src/timer/os2/SDL_systimer.c
  65. +3 −3 src/video/SDL_rendercopy.h
  66. +7 −1 test/Makefile.in
  67. +1 −16 test/loopwave.c
  68. +53 −0 test/testaudioinfo.c
  69. +136 −0 test/testmultiaudio.c
@@ -511,9 +511,17 @@ CheckNAS()
AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
, enable_nas=yes)
if test x$enable_audio = xyes -a x$enable_nas = xyes; then
AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)

AC_MSG_CHECKING(for NAS audio support)
have_nas=no
if test -r /usr/X11R6/include/audio/audiolib.h; then

if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
have_nas=yes
NAS_LIBS="-laudio"

elif test -r /usr/X11R6/include/audio/audiolib.h; then
have_nas=yes
NAS_CFLAGS="-I/usr/X11R6/include/"
NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
@@ -525,12 +533,40 @@ AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
have_nas=yes
NAS_LIBS="-lnas -lXt"
fi

AC_MSG_RESULT($have_nas)

if test x$have_nas = xyes; then
AC_ARG_ENABLE(nas-shared,
AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
, enable_nas_shared=yes)
if test "x`echo $NAS_LIBS | grep -- -L`" = "x"; then
if test "x`ls /lib/libaudio.so.* 2> /dev/null`" != "x"; then
NAS_LIBS="-L/lib $NAS_LIBS"
elif test "x`ls /usr/lib/libaudio.so.* 2> /dev/null`" != "x"; then
NAS_LIBS="-L/usr/lib $NAS_LIBS"
elif test "x`ls /usr/local/lib/libaudio.so.* 2> /dev/null`" != "x"; then
NAS_LIBS="-L/usr/local/lib $NAS_LIBS"
fi
fi
nas_lib_spec=`echo $NAS_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libaudio.so.*/'`
nas_lib=`ls -- $nas_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
echo "-- $nas_lib_spec -> $nas_lib"

if test x$have_loadso != xyes && \
test x$enable_nas_shared = xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
fi
if test x$have_loadso = xyes && \
test x$enable_nas_shared = xyes && test x$alsa_lib != x; then
AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib")
else
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
fi

AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
have_audio=yes
fi
fi
@@ -2006,7 +2042,7 @@ case "$host" in
have_audio=yes
;;
aix)
AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO)
SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
have_audio=yes
;;
@@ -2206,7 +2242,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
CheckBeGL
# Set up files for the audio library
if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
AC_DEFINE(SDL_AUDIO_DRIVER_BEOSAUDIO)
SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
have_audio=yes
fi
@@ -2323,7 +2359,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
# If either the audio or CD driver is used, add the AudioUnit framework
if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -framework,AudioToolbox -Wl,-framework,AudioUnit"
fi
;;
*-*-mint*)
@@ -153,7 +153,7 @@ typedef struct SDL_AudioCVT

/* Function prototypes */

/* These functions return the list of built in video drivers, in the
/* These functions return the list of built in audio drivers, in the
* order that they are normally initialized by default.
*/
extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
@@ -212,7 +212,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
* may modify the requested size of the audio buffer, you should allocate
* any local mixing buffers after you open the audio device.
*/
extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
extern DECLSPEC int SDLCALL SDL_OpenAudio(const SDL_AudioSpec * desired,
SDL_AudioSpec * obtained);

/*
@@ -228,22 +228,42 @@ typedef Uint32 SDL_AudioDeviceID;
/*
* Get the number of available devices exposed by the current driver.
* Only valid after a successfully initializing the audio subsystem.
* Returns -1 if an explicit list of devices can't be determined; this is
* not an error. For example, if SDL is set up to talk to a remote audio
* server, it can't list every one available on the Internet, but it will
* still allow a specific host to be specified to SDL_OpenAudioDevice().
* In many common cases, when this function returns a value <= 0, it can still
* successfully open the default device (NULL for first argument of
* SDL_OpenAudioDevice()).
*/
extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);

/*
* Get the human-readable name of a specific audio device.
* Must be a value between 0 and (number of audio devices-1).
* Only valid after a successfully initializing the audio subsystem.
* The values returned by this function reflect the latest call to
* SDL_GetNumAudioDevices(); recall that function to redetect available
* hardware.
*
* The string returned by this function is UTF-8 encoded, read-only, and
* managed internally. You are not to free it. If you need to keep the
* string for any length of time, you should make your own copy of it, as it
* will be invalid next time any of several other SDL functions is called.
*/
extern DECLSPEC const char *SDLCALL SDL_GetAudioDevice(int index,
int iscapture);
extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
int iscapture);


/*
* Open a specific audio device. Passing in a device name of NULL is
* equivalent to SDL_OpenAudio(). Returns 0 on error, a valid device ID
* on success.
* Open a specific audio device. Passing in a device name of NULL requests
* the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
* The device name is a UTF-8 string reported by SDL_GetAudioDevice(), but
* some drivers allow arbitrary and driver-specific strings, such as a
* hostname/IP address for a remote audio server, or a filename in the
* diskaudio driver.
* Returns 0 on error, a valid device ID that is >= 2 on success.
* SDL_OpenAudio(), unlike this function, always acts on device ID 1.
*/
extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char
*device,
@@ -154,7 +154,7 @@
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
#undef SDL_AUDIO_DRIVER_ARTS
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
#undef SDL_AUDIO_DRIVER_BAUDIO
#undef SDL_AUDIO_DRIVER_BEOSAUDIO
#undef SDL_AUDIO_DRIVER_BSD
#undef SDL_AUDIO_DRIVER_COREAUDIO
#undef SDL_AUDIO_DRIVER_DART
@@ -168,9 +168,10 @@
#undef SDL_AUDIO_DRIVER_MINT
#undef SDL_AUDIO_DRIVER_MMEAUDIO
#undef SDL_AUDIO_DRIVER_NAS
#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
#undef SDL_AUDIO_DRIVER_OSS
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
#undef SDL_AUDIO_DRIVER_PAUD
#undef SDL_AUDIO_DRIVER_PAUDIO
#undef SDL_AUDIO_DRIVER_QNXNTO
#undef SDL_AUDIO_DRIVER_SNDMGR
#undef SDL_AUDIO_DRIVER_SUNAUDIO
@@ -91,7 +91,7 @@ typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
#endif

extern DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int (*fn) (void *),
extern DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int (SDLCALL * f) (void *),
void *data,
pfnSDL_CurrentBeginThread
pfnBeginThread,
@@ -28,6 +28,7 @@

/* Routine to get the thread-specific error variable */
#if SDL_THREADS_DISABLED
/* !!! FIXME: what does this comment mean? Victim of Search and Replace? */
/* The SDL_arraysize(The ),default (non-thread-safe) global error variable */
static SDL_error SDL_global_error;
#define SDL_GetErrBuf() (&SDL_global_error)

0 comments on commit bf035a4

Please sign in to comment.