Implemented dummy audio driver.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 14 Mar 2006 08:53:33 +0000
changeset 153230f189cdd82b
parent 1531 543ffd71ab6d
child 1533 38c1eb6b0083
Implemented dummy audio driver.

Fixes Bugzilla #161.
configure.in
include/SDL_config.h
include/SDL_config.h.in
include/SDL_config.h.minimal
include/SDL_config_amiga.h
include/SDL_config_dreamcast.h
include/SDL_config_macos.h
include/SDL_config_macosx.h
include/SDL_config_os2.h
include/SDL_config_win32.h
src/audio/SDL_audio.c
src/audio/SDL_sysaudio.h
src/audio/dummy/.cvsignore
src/audio/dummy/SDL_dummyaudio.c
src/audio/dummy/SDL_dummyaudio.h
     1.1 --- a/configure.in	Tue Mar 14 08:35:39 2006 +0000
     1.2 +++ b/configure.in	Tue Mar 14 08:53:33 2006 +0000
     1.3 @@ -533,6 +533,18 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl rcg03142006 See if the user wants the dummy audio driver...
     1.8 +CheckDummyAudio()
     1.9 +{
    1.10 +    AC_ARG_ENABLE(dummyaudio,
    1.11 +AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [default=yes]]),
    1.12 +                  , enable_dummyaudio=yes)
    1.13 +    if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
    1.14 +        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY)
    1.15 +        SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
    1.16 +    fi
    1.17 +}
    1.18 +
    1.19  dnl Set up the Atari Audio driver
    1.20  CheckAtariAudio()
    1.21  {
    1.22 @@ -1915,6 +1927,7 @@
    1.23          esac
    1.24          CheckDummyVideo
    1.25          CheckDiskAudio
    1.26 +        CheckDummyAudio
    1.27          CheckDLOPEN
    1.28          CheckNASM
    1.29          CheckAltivec
    1.30 @@ -2029,6 +2042,7 @@
    1.31          ARCH=qnx
    1.32          CheckDummyVideo
    1.33          CheckDiskAudio
    1.34 +        CheckDummyAudio
    1.35          # CheckNASM
    1.36          CheckDLOPEN
    1.37          CheckNAS
    1.38 @@ -2069,6 +2083,7 @@
    1.39          fi
    1.40          CheckDummyVideo
    1.41          CheckDiskAudio
    1.42 +        CheckDummyAudio
    1.43          CheckWIN32
    1.44          CheckWIN32GL
    1.45          CheckDIRECTX
    1.46 @@ -2131,6 +2146,7 @@
    1.47          ac_default_prefix=/boot/develop/tools/gnupro
    1.48          CheckDummyVideo
    1.49          CheckDiskAudio
    1.50 +        CheckDummyAudio
    1.51          CheckNASM
    1.52          CheckBWINDOW
    1.53          CheckBeGL
    1.54 @@ -2183,6 +2199,7 @@
    1.55          ARCH=macosx
    1.56          CheckDummyVideo
    1.57          CheckDiskAudio
    1.58 +        CheckDummyAudio
    1.59          CheckDLOPEN
    1.60          CheckCOCOA
    1.61          CheckCARBON
    1.62 @@ -2249,6 +2266,7 @@
    1.63          ARCH=mint
    1.64          CheckDummyVideo
    1.65          CheckDiskAudio
    1.66 +        CheckDummyAudio
    1.67          CheckAtariBiosEvent
    1.68          CheckAtariXbiosVideo
    1.69          CheckAtariGemVideo
     2.1 --- a/include/SDL_config.h	Tue Mar 14 08:35:39 2006 +0000
     2.2 +++ b/include/SDL_config.h	Tue Mar 14 08:53:33 2006 +0000
     2.3 @@ -1,3 +1,4 @@
     2.4 +/* include/SDL_config.h.  Generated by configure.  */
     2.5  /*
     2.6      SDL - Simple DirectMedia Layer
     2.7      Copyright (C) 1997-2006 Sam Lantinga
     2.8 @@ -23,56 +24,276 @@
     2.9  #ifndef _SDL_config_h
    2.10  #define _SDL_config_h
    2.11  
    2.12 +/* This is a set of defines to configure the SDL features */
    2.13 +
    2.14 +/* General platform specific identifiers */
    2.15  #include "SDL_platform.h"
    2.16  
    2.17 -/* Add any platform that doesn't build using the configure system */
    2.18 -#if defined(__AMIGA__)
    2.19 -#include "SDL_config_amiga.h"
    2.20 -#elif defined(__DREAMCAST__)
    2.21 -#include "SDL_config_dreamcast.h"
    2.22 -#elif defined(__MACOS__)
    2.23 -#include "SDL_config_macos.h"
    2.24 -#elif defined(__MACOSX__)
    2.25 -#include "SDL_config_macosx.h"
    2.26 -#elif defined(__WIN32__)
    2.27 -#include "SDL_config_win32.h"
    2.28 -#elif defined(__OS2__)
    2.29 -#include "SDL_config_os2.h"
    2.30 +/* C language features */
    2.31 +/* #undef const */
    2.32 +/* #undef inline */
    2.33 +/* #undef volatile */
    2.34 +
    2.35 +/* C datatypes */
    2.36 +/* #undef size_t */
    2.37 +/* #undef int8_t */
    2.38 +/* #undef uint8_t */
    2.39 +/* #undef int16_t */
    2.40 +/* #undef uint16_t */
    2.41 +/* #undef int32_t */
    2.42 +/* #undef uint32_t */
    2.43 +/* #undef int64_t */
    2.44 +/* #undef uint64_t */
    2.45 +/* #undef uintptr_t */
    2.46 +#define SDL_HAS_64BIT_TYPE 1
    2.47 +
    2.48 +/* Endianness */
    2.49 +#define SDL_BYTEORDER 1234
    2.50 +
    2.51 +/* Comment this if you want to build without any C library requirements */
    2.52 +#define HAVE_LIBC 1
    2.53 +#if HAVE_LIBC
    2.54 +
    2.55 +/* Useful headers */
    2.56 +#define HAVE_ALLOCA_H 1
    2.57 +#define HAVE_SYS_TYPES_H 1
    2.58 +#define HAVE_STDIO_H 1
    2.59 +#define STDC_HEADERS 1
    2.60 +#define HAVE_STDLIB_H 1
    2.61 +#define HAVE_STDARG_H 1
    2.62 +#define HAVE_MALLOC_H 1
    2.63 +#define HAVE_MEMORY_H 1
    2.64 +#define HAVE_STRING_H 1
    2.65 +#define HAVE_STRINGS_H 1
    2.66 +#define HAVE_INTTYPES_H 1
    2.67 +#define HAVE_STDINT_H 1
    2.68 +#define HAVE_CTYPE_H 1
    2.69 +#define HAVE_MATH_H 1
    2.70 +#define HAVE_ICONV_H 1
    2.71 +#define HAVE_SIGNAL_H 1
    2.72 +/* #undef HAVE_ALTIVEC_H */
    2.73 +
    2.74 +/* C library functions */
    2.75 +#define HAVE_MALLOC 1
    2.76 +#define HAVE_CALLOC 1
    2.77 +#define HAVE_REALLOC 1
    2.78 +#define HAVE_FREE 1
    2.79 +#define HAVE_ALLOCA 1
    2.80 +#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
    2.81 +#define HAVE_GETENV 1
    2.82 +#define HAVE_PUTENV 1
    2.83 +#define HAVE_UNSETENV 1
    2.84 +#endif
    2.85 +#define HAVE_QSORT 1
    2.86 +#define HAVE_ABS 1
    2.87 +#define HAVE_BCOPY 1
    2.88 +#define HAVE_MEMSET 1
    2.89 +#define HAVE_MEMCPY 1
    2.90 +#define HAVE_MEMMOVE 1
    2.91 +#define HAVE_MEMCMP 1
    2.92 +#define HAVE_STRLEN 1
    2.93 +/* #undef HAVE_STRLCPY */
    2.94 +/* #undef HAVE_STRLCAT */
    2.95 +#define HAVE_STRDUP 1
    2.96 +/* #undef HAVE__STRREV */
    2.97 +/* #undef HAVE__STRUPR */
    2.98 +/* #undef HAVE__STRLWR */
    2.99 +/* #undef HAVE_INDEX */
   2.100 +/* #undef HAVE_RINDEX */
   2.101 +#define HAVE_STRCHR 1
   2.102 +#define HAVE_STRRCHR 1
   2.103 +#define HAVE_STRSTR 1
   2.104 +/* #undef HAVE_ITOA */
   2.105 +/* #undef HAVE__LTOA */
   2.106 +/* #undef HAVE__UITOA */
   2.107 +/* #undef HAVE__ULTOA */
   2.108 +#define HAVE_STRTOL 1
   2.109 +#define HAVE_STRTOUL 1
   2.110 +/* #undef HAVE__I64TOA */
   2.111 +/* #undef HAVE__UI64TOA */
   2.112 +#define HAVE_STRTOLL 1
   2.113 +#define HAVE_STRTOULL 1
   2.114 +#define HAVE_STRTOD 1
   2.115 +#define HAVE_ATOI 1
   2.116 +#define HAVE_ATOF 1
   2.117 +#define HAVE_STRCMP 1
   2.118 +#define HAVE_STRNCMP 1
   2.119 +/* #undef HAVE__STRICMP */
   2.120 +#define HAVE_STRCASECMP 1
   2.121 +/* #undef HAVE__STRNICMP */
   2.122 +#define HAVE_STRNCASECMP 1
   2.123 +#define HAVE_SSCANF 1
   2.124 +#define HAVE_SNPRINTF 1
   2.125 +#define HAVE_VSNPRINTF 1
   2.126 +#define HAVE_ICONV 1
   2.127 +#define HAVE_SIGACTION 1
   2.128 +#define HAVE_SETJMP 1
   2.129 +#define HAVE_NANOSLEEP 1
   2.130 +/* #undef HAVE_CLOCK_GETTIME */
   2.131 +#define HAVE_DLVSYM 1
   2.132 +
   2.133  #else
   2.134 -/* This is the minimal configuration that can be used to build SDL */
   2.135 +/* We may need some replacement for stdarg.h here */
   2.136 +#include <stdarg.h>
   2.137 +#endif /* HAVE_LIBC */
   2.138  
   2.139 -#include <stdarg.h>
   2.140 +/* Allow disabling of core subsystems */
   2.141 +/* #undef SDL_AUDIO_DISABLED */
   2.142 +/* #undef SDL_CDROM_DISABLED */
   2.143 +/* #undef SDL_CPUINFO_DISABLED */
   2.144 +/* #undef SDL_EVENTS_DISABLED */
   2.145 +/* #undef SDL_FILE_DISABLED */
   2.146 +/* #undef SDL_JOYSTICK_DISABLED */
   2.147 +/* #undef SDL_LOADSO_DISABLED */
   2.148 +/* #undef SDL_THREADS_DISABLED */
   2.149 +/* #undef SDL_TIMERS_DISABLED */
   2.150 +/* #undef SDL_VIDEO_DISABLED */
   2.151  
   2.152 -typedef signed char int8_t;
   2.153 -typedef unsigned char uint8_t;
   2.154 -typedef signed short int16_t;
   2.155 -typedef unsigned short uint16_t;
   2.156 -typedef signed int int32_t;
   2.157 -typedef unsigned int uint32_t;
   2.158 -typedef unsigned int size_t;
   2.159 -typedef unsigned long uintptr_t;
   2.160 +/* Enable various audio drivers */
   2.161 +/* #undef SDL_AUDIO_DRIVER_AHI */
   2.162 +#define SDL_AUDIO_DRIVER_ALSA 1
   2.163 +#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC "libasound.so.2"
   2.164 +/* #undef SDL_AUDIO_DRIVER_ARTS */
   2.165 +/* #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
   2.166 +/* #undef SDL_AUDIO_DRIVER_BAUDIO */
   2.167 +/* #undef SDL_AUDIO_DRIVER_COREAUDIO */
   2.168 +/* #undef SDL_AUDIO_DRIVER_DART */
   2.169 +/* #undef SDL_AUDIO_DRIVER_DC */
   2.170 +#define SDL_AUDIO_DRIVER_DISK 1
   2.171 +#define SDL_AUDIO_DRIVER_DUMMY 1
   2.172 +/* #undef SDL_AUDIO_DRIVER_DMEDIA */
   2.173 +/* #undef SDL_AUDIO_DRIVER_DSOUND */
   2.174 +/* #undef SDL_AUDIO_DRIVER_ESD */
   2.175 +/* #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC */
   2.176 +/* #undef SDL_AUDIO_DRIVER_MINT */
   2.177 +/* #undef SDL_AUDIO_DRIVER_MMEAUDIO */
   2.178 +/* #undef SDL_AUDIO_DRIVER_NAS */
   2.179 +/* #undef SDL_AUDIO_DRIVER_OPENBSD */
   2.180 +#define SDL_AUDIO_DRIVER_OSS 1
   2.181 +/* #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H */
   2.182 +/* #undef SDL_AUDIO_DRIVER_PAUD */
   2.183 +/* #undef SDL_AUDIO_DRIVER_QNXNTO */
   2.184 +/* #undef SDL_AUDIO_DRIVER_SNDMGR */
   2.185 +/* #undef SDL_AUDIO_DRIVER_SUNAUDIO */
   2.186 +/* #undef SDL_AUDIO_DRIVER_WAVEOUT */
   2.187  
   2.188 -/* Enable the disk audio driver (src/audio/disk/\*.c) */
   2.189 -#define SDL_AUDIO_DRIVER_DISK	1
   2.190 +/* Enable various cdrom drivers */
   2.191 +/* #undef SDL_CDROM_AIX */
   2.192 +/* #undef SDL_CDROM_BEOS */
   2.193 +/* #undef SDL_CDROM_BSDI */
   2.194 +/* #undef SDL_CDROM_DC */
   2.195 +/* #undef SDL_CDROM_DUMMY */
   2.196 +/* #undef SDL_CDROM_FREEBSD */
   2.197 +#define SDL_CDROM_LINUX 1
   2.198 +/* #undef SDL_CDROM_MACOS */
   2.199 +/* #undef SDL_CDROM_MACOSX */
   2.200 +/* #undef SDL_CDROM_MINT */
   2.201 +/* #undef SDL_CDROM_OPENBSD */
   2.202 +/* #undef SDL_CDROM_OS2 */
   2.203 +/* #undef SDL_CDROM_OSF */
   2.204 +/* #undef SDL_CDROM_QNX */
   2.205 +/* #undef SDL_CDROM_WIN32 */
   2.206  
   2.207 -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
   2.208 -#define SDL_CDROM_DISABLED	1
   2.209 +/* Enable various input drivers */
   2.210 +/* #undef SDL_INPUT_TSLIB */
   2.211 +/* #undef SDL_JOYSTICK_AMIGA */
   2.212 +/* #undef SDL_JOYSTICK_BEOS */
   2.213 +/* #undef SDL_JOYSTICK_DC */
   2.214 +/* #undef SDL_JOYSTICK_DUMMY */
   2.215 +/* #undef SDL_JOYSTICK_IOKIT */
   2.216 +#define SDL_JOYSTICK_LINUX 1
   2.217 +/* #undef SDL_JOYSTICK_LINUXEV */
   2.218 +/* #undef SDL_JOYSTICK_MACOS */
   2.219 +/* #undef SDL_JOYSTICK_MINT */
   2.220 +/* #undef SDL_JOYSTICK_OS2 */
   2.221 +/* #undef SDL_JOYSTICK_RISCOS */
   2.222 +/* #undef SDL_JOYSTICK_WINMM */
   2.223 +/* #undef SDL_JOYSTICK_USBHID */
   2.224  
   2.225 -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
   2.226 -#define SDL_JOYSTICK_DISABLED	1
   2.227 +/* Enable various shared object loading systems */
   2.228 +/* #undef SDL_LOADSO_BEOS */
   2.229 +/* #undef SDL_LOADSO_DLCOMPAT */
   2.230 +#define SDL_LOADSO_DLOPEN 1
   2.231 +/* #undef SDL_LOADSO_LDG */
   2.232 +/* #undef SDL_LOADSO_MACOS */
   2.233 +/* #undef SDL_LOADSO_OS2 */
   2.234 +/* #undef SDL_LOADSO_WIN32 */
   2.235  
   2.236 -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
   2.237 -#define SDL_LOADSO_DISABLED	1
   2.238 +/* Enable various threading systems */
   2.239 +/* #undef SDL_THREAD_AMIGA */
   2.240 +/* #undef SDL_THREAD_BEOS */
   2.241 +/* #undef SDL_THREAD_DC */
   2.242 +/* #undef SDL_THREAD_EPOC */
   2.243 +/* #undef SDL_THREAD_OS2 */
   2.244 +/* #undef SDL_THREAD_PTH */
   2.245 +#define SDL_THREAD_PTHREAD 1
   2.246 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
   2.247 +/* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
   2.248 +/* #undef SDL_THREAD_SPROC */
   2.249 +/* #undef SDL_THREAD_WIN32 */
   2.250  
   2.251 -/* Enable the stub thread support (src/thread/generic/\*.c) */
   2.252 -#define SDL_THREADS_DISABLED	1
   2.253 +/* Enable various timer systems */
   2.254 +/* #undef SDL_TIMER_AMIGA */
   2.255 +/* #undef SDL_TIMER_BEOS */
   2.256 +/* #undef SDL_TIMER_DC */
   2.257 +/* #undef SDL_TIMER_EPOC */
   2.258 +/* #undef SDL_TIMER_MACOS */
   2.259 +/* #undef SDL_TIMER_MINT */
   2.260 +/* #undef SDL_TIMER_OS2 */
   2.261 +/* #undef SDL_TIMER_RISCOS */
   2.262 +#define SDL_TIMER_UNIX 1
   2.263 +/* #undef SDL_TIMER_WIN32 */
   2.264 +/* #undef SDL_TIMER_WINCE */
   2.265  
   2.266 -/* Enable the stub timer support (src/timer/dummy/\*.c) */
   2.267 -#define SDL_TIMERS_DISABLED	1
   2.268 +/* Enable various video drivers */
   2.269 +/* #undef SDL_VIDEO_DRIVER_AALIB */
   2.270 +/* #undef SDL_VIDEO_DRIVER_BWINDOW */
   2.271 +/* #undef SDL_VIDEO_DRIVER_CYBERGRAPHICS */
   2.272 +/* #undef SDL_VIDEO_DRIVER_DC */
   2.273 +/* #undef SDL_VIDEO_DRIVER_DDRAW */
   2.274 +#define SDL_VIDEO_DRIVER_DGA 1
   2.275 +/* #undef SDL_VIDEO_DRIVER_DIRECTFB */
   2.276 +/* #undef SDL_VIDEO_DRIVER_DRAWSPROCKET */
   2.277 +#define SDL_VIDEO_DRIVER_DUMMY 1
   2.278 +/* #undef SDL_VIDEO_DRIVER_EPOC */
   2.279 +#define SDL_VIDEO_DRIVER_FBCON 1
   2.280 +/* #undef SDL_VIDEO_DRIVER_GAPI */
   2.281 +/* #undef SDL_VIDEO_DRIVER_GEM */
   2.282 +/* #undef SDL_VIDEO_DRIVER_GGI */
   2.283 +/* #undef SDL_VIDEO_DRIVER_IPOD */
   2.284 +/* #undef SDL_VIDEO_DRIVER_NANOX */
   2.285 +/* #undef SDL_VIDEO_DRIVER_OS2FS */
   2.286 +/* #undef SDL_VIDEO_DRIVER_PHOTON */
   2.287 +/* #undef SDL_VIDEO_DRIVER_PICOGUI */
   2.288 +/* #undef SDL_VIDEO_DRIVER_PS2GS */
   2.289 +/* #undef SDL_VIDEO_DRIVER_QTOPIA */
   2.290 +/* #undef SDL_VIDEO_DRIVER_QUARTZ */
   2.291 +/* #undef SDL_VIDEO_DRIVER_RISCOS */
   2.292 +/* #undef SDL_VIDEO_DRIVER_SVGALIB */
   2.293 +/* #undef SDL_VIDEO_DRIVER_TOOLBOX */
   2.294 +/* #undef SDL_VIDEO_DRIVER_VGL */
   2.295 +/* #undef SDL_VIDEO_DRIVER_WINDIB */
   2.296 +/* #undef SDL_VIDEO_DRIVER_WSCONS */
   2.297 +#define SDL_VIDEO_DRIVER_X11 1
   2.298 +#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1
   2.299 +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC */
   2.300 +/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT */
   2.301 +#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
   2.302 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
   2.303 +#define SDL_VIDEO_DRIVER_X11_XME 1
   2.304 +#define SDL_VIDEO_DRIVER_X11_XV 1
   2.305 +/* #undef SDL_VIDEO_DRIVER_XBIOS */
   2.306  
   2.307 -/* Enable the dummy video driver (src/video/dummy/\*.c) */
   2.308 -#define SDL_VIDEO_DRIVER_DUMMY	1
   2.309 +/* Enable OpenGL support */
   2.310 +#define SDL_VIDEO_OPENGL 1
   2.311 +#define SDL_VIDEO_OPENGL_GLX 1
   2.312 +/* #undef SDL_VIDEO_OPENGL_WGL */
   2.313 +/* #undef SDL_VIDEO_OPENGL_OSMESA */
   2.314 +/* #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC */
   2.315  
   2.316 -#endif /* platform config */
   2.317 +/* Enable assembly routines */
   2.318 +#define SDL_ASSEMBLY_ROUTINES 1
   2.319 +/* #undef SDL_HERMES_BLITTERS */
   2.320 +/* #undef SDL_ALTIVEC_BLITTERS */
   2.321  
   2.322  #endif /* _SDL_config_h */
     3.1 --- a/include/SDL_config.h.in	Tue Mar 14 08:35:39 2006 +0000
     3.2 +++ b/include/SDL_config.h.in	Tue Mar 14 08:53:33 2006 +0000
     3.3 @@ -159,6 +159,7 @@
     3.4  #undef SDL_AUDIO_DRIVER_DART
     3.5  #undef SDL_AUDIO_DRIVER_DC
     3.6  #undef SDL_AUDIO_DRIVER_DISK
     3.7 +#undef SDL_AUDIO_DRIVER_DUMMY
     3.8  #undef SDL_AUDIO_DRIVER_DMEDIA
     3.9  #undef SDL_AUDIO_DRIVER_DSOUND
    3.10  #undef SDL_AUDIO_DRIVER_ESD
     4.1 --- a/include/SDL_config.h.minimal	Tue Mar 14 08:35:39 2006 +0000
     4.2 +++ b/include/SDL_config.h.minimal	Tue Mar 14 08:53:33 2006 +0000
     4.3 @@ -52,8 +52,8 @@
     4.4  typedef unsigned int size_t;
     4.5  typedef unsigned long uintptr_t;
     4.6  
     4.7 -/* Enable the disk audio driver (src/audio/disk/\*.c) */
     4.8 -#define SDL_AUDIO_DRIVER_DISK	1
     4.9 +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
    4.10 +#define SDL_AUDIO_DRIVER_DUMMY	1
    4.11  
    4.12  /* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
    4.13  #define SDL_CDROM_DISABLED	1
     5.1 --- a/include/SDL_config_amiga.h	Tue Mar 14 08:35:39 2006 +0000
     5.2 +++ b/include/SDL_config_amiga.h	Tue Mar 14 08:53:33 2006 +0000
     5.3 @@ -50,6 +50,8 @@
     5.4  
     5.5  /* Enable various audio drivers */
     5.6  #define SDL_AUDIO_DRIVER_AHI	1
     5.7 +#define SDL_AUDIO_DRIVER_DUMMY	1
     5.8 +#define SDL_AUDIO_DRIVER_DISK	1
     5.9  
    5.10  /* Enable various cdrom drivers */
    5.11  #define SDL_CDROM_DUMMY	1
     6.1 --- a/include/SDL_config_dreamcast.h	Tue Mar 14 08:35:39 2006 +0000
     6.2 +++ b/include/SDL_config_dreamcast.h	Tue Mar 14 08:53:33 2006 +0000
     6.3 @@ -79,6 +79,7 @@
     6.4  
     6.5  /* Enable various audio drivers */
     6.6  #define SDL_AUDIO_DRIVER_DC	1
     6.7 +#define SDL_AUDIO_DRIVER_DUMMY	1
     6.8  
     6.9  /* Enable various cdrom drivers */
    6.10  #define SDL_CDROM_DC	1
     7.1 --- a/include/SDL_config_macos.h	Tue Mar 14 08:35:39 2006 +0000
     7.2 +++ b/include/SDL_config_macos.h	Tue Mar 14 08:53:33 2006 +0000
     7.3 @@ -67,6 +67,8 @@
     7.4  
     7.5  /* Enable various audio drivers */
     7.6  #define SDL_AUDIO_DRIVER_SNDMGR	1
     7.7 +#define SDL_AUDIO_DRIVER_DISK	1
     7.8 +#define SDL_AUDIO_DRIVER_DUMMY	1
     7.9  
    7.10  /* Enable various cdrom drivers */
    7.11  #define SDL_CDROM_MACOS	1
     8.1 --- a/include/SDL_config_macosx.h	Tue Mar 14 08:35:39 2006 +0000
     8.2 +++ b/include/SDL_config_macosx.h	Tue Mar 14 08:53:33 2006 +0000
     8.3 @@ -83,6 +83,8 @@
     8.4  /* Enable various audio drivers */
     8.5  #define SDL_AUDIO_DRIVER_COREAUDIO	1
     8.6  #define SDL_AUDIO_DRIVER_SNDMGR	1
     8.7 +#define SDL_AUDIO_DRIVER_DISK	1
     8.8 +#define SDL_AUDIO_DRIVER_DUMMY	1
     8.9  
    8.10  /* Enable various cdrom drivers */
    8.11  #define SDL_CDROM_MACOSX	1
     9.1 --- a/include/SDL_config_os2.h	Tue Mar 14 08:35:39 2006 +0000
     9.2 +++ b/include/SDL_config_os2.h	Tue Mar 14 08:53:33 2006 +0000
     9.3 @@ -108,6 +108,8 @@
     9.4  
     9.5  /* Enable various audio drivers */
     9.6  #define SDL_AUDIO_DRIVER_DART	1
     9.7 +#define SDL_AUDIO_DRIVER_DISK	1
     9.8 +#define SDL_AUDIO_DRIVER_DUMMY	1
     9.9  
    9.10  /* Enable various cdrom drivers */
    9.11  #define SDL_CDROM_OS2	1
    10.1 --- a/include/SDL_config_win32.h	Tue Mar 14 08:35:39 2006 +0000
    10.2 +++ b/include/SDL_config_win32.h	Tue Mar 14 08:53:33 2006 +0000
    10.3 @@ -115,6 +115,8 @@
    10.4  #define SDL_AUDIO_DRIVER_DSOUND	1
    10.5  #endif
    10.6  #define SDL_AUDIO_DRIVER_WAVEOUT	1
    10.7 +#define SDL_AUDIO_DRIVER_DISK	1
    10.8 +#define SDL_AUDIO_DRIVER_DUMMY	1
    10.9  
   10.10  /* Enable various cdrom drivers */
   10.11  #ifdef _WIN32_WCE
    11.1 --- a/src/audio/SDL_audio.c	Tue Mar 14 08:35:39 2006 +0000
    11.2 +++ b/src/audio/SDL_audio.c	Tue Mar 14 08:53:33 2006 +0000
    11.3 @@ -95,6 +95,9 @@
    11.4  #if SDL_AUDIO_DRIVER_DISK
    11.5  	&DISKAUD_bootstrap,
    11.6  #endif
    11.7 +#if SDL_AUDIO_DRIVER_DUMMY
    11.8 +	&DUMMYAUD_bootstrap,
    11.9 +#endif
   11.10  #if SDL_AUDIO_DRIVER_DC
   11.11  	&DCAUD_bootstrap,
   11.12  #endif
    12.1 --- a/src/audio/SDL_sysaudio.h	Tue Mar 14 08:35:39 2006 +0000
    12.2 +++ b/src/audio/SDL_sysaudio.h	Tue Mar 14 08:53:33 2006 +0000
    12.3 @@ -159,6 +159,9 @@
    12.4  #if SDL_AUDIO_DRIVER_DISK
    12.5  extern AudioBootStrap DISKAUD_bootstrap;
    12.6  #endif
    12.7 +#if SDL_AUDIO_DRIVER_DUMMY
    12.8 +extern AudioBootStrap DUMMYAUD_bootstrap;
    12.9 +#endif
   12.10  #if SDL_AUDIO_DRIVER_DC
   12.11  extern AudioBootStrap DCAUD_bootstrap;
   12.12  #endif
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/src/audio/dummy/.cvsignore	Tue Mar 14 08:53:33 2006 +0000
    13.3 @@ -0,0 +1,6 @@
    13.4 +Makefile.in
    13.5 +Makefile
    13.6 +.libs
    13.7 +*.o
    13.8 +*.lo
    13.9 +*.la
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/src/audio/dummy/SDL_dummyaudio.c	Tue Mar 14 08:53:33 2006 +0000
    14.3 @@ -0,0 +1,154 @@
    14.4 +/*
    14.5 +    SDL - Simple DirectMedia Layer
    14.6 +    Copyright (C) 1997-2006 Sam Lantinga
    14.7 +
    14.8 +    This library is free software; you can redistribute it and/or
    14.9 +    modify it under the terms of the GNU Lesser General Public
   14.10 +    License as published by the Free Software Foundation; either
   14.11 +    version 2.1 of the License, or (at your option) any later version.
   14.12 +
   14.13 +    This library is distributed in the hope that it will be useful,
   14.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   14.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   14.16 +    Lesser General Public License for more details.
   14.17 +
   14.18 +    You should have received a copy of the GNU Lesser General Public
   14.19 +    License along with this library; if not, write to the Free Software
   14.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   14.21 +
   14.22 +    Sam Lantinga
   14.23 +    slouken@libsdl.org
   14.24 +
   14.25 +    This file hacked^H^H^H^H^H^Hwritten by Ryan C. Gordon
   14.26 +        (icculus@icculus.org)
   14.27 +*/
   14.28 +#include "SDL_config.h"
   14.29 +
   14.30 +/* Output raw audio data to a file. */
   14.31 +
   14.32 +#if HAVE_STDIO_H
   14.33 +#include <stdio.h>
   14.34 +#endif
   14.35 +
   14.36 +#include "SDL_rwops.h"
   14.37 +#include "SDL_timer.h"
   14.38 +#include "SDL_audio.h"
   14.39 +#include "../SDL_audiomem.h"
   14.40 +#include "../SDL_audio_c.h"
   14.41 +#include "../SDL_audiodev_c.h"
   14.42 +#include "SDL_dummyaudio.h"
   14.43 +
   14.44 +/* The tag name used by DUMMY audio */
   14.45 +#define DUMMYAUD_DRIVER_NAME         "dummy"
   14.46 +
   14.47 +/* environment variables and defaults. */
   14.48 +#define DUMMYENVR_WRITEDELAY      "SDL_DUMMYAUDIODELAY"
   14.49 +#define DUMMYDEFAULT_WRITEDELAY   150
   14.50 +
   14.51 +/* Audio driver functions */
   14.52 +static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec *spec);
   14.53 +static void DUMMYAUD_WaitAudio(_THIS);
   14.54 +static void DUMMYAUD_PlayAudio(_THIS);
   14.55 +static Uint8 *DUMMYAUD_GetAudioBuf(_THIS);
   14.56 +static void DUMMYAUD_CloseAudio(_THIS);
   14.57 +
   14.58 +/* Audio driver bootstrap functions */
   14.59 +static int DUMMYAUD_Available(void)
   14.60 +{
   14.61 +	const char *envr = SDL_getenv("SDL_AUDIODRIVER");
   14.62 +	if (envr && (SDL_strcmp(envr, DUMMYAUD_DRIVER_NAME) == 0)) {
   14.63 +		return(1);
   14.64 +	}
   14.65 +	return(0);
   14.66 +}
   14.67 +
   14.68 +static void DUMMYAUD_DeleteDevice(SDL_AudioDevice *device)
   14.69 +{
   14.70 +	SDL_free(device->hidden);
   14.71 +	SDL_free(device);
   14.72 +}
   14.73 +
   14.74 +static SDL_AudioDevice *DUMMYAUD_CreateDevice(int devindex)
   14.75 +{
   14.76 +	SDL_AudioDevice *this;
   14.77 +	const char *envr;
   14.78 +
   14.79 +	/* Initialize all variables that we clean on shutdown */
   14.80 +	this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
   14.81 +	if ( this ) {
   14.82 +		SDL_memset(this, 0, (sizeof *this));
   14.83 +		this->hidden = (struct SDL_PrivateAudioData *)
   14.84 +				SDL_malloc((sizeof *this->hidden));
   14.85 +	}
   14.86 +	if ( (this == NULL) || (this->hidden == NULL) ) {
   14.87 +		SDL_OutOfMemory();
   14.88 +		if ( this ) {
   14.89 +			SDL_free(this);
   14.90 +		}
   14.91 +		return(0);
   14.92 +	}
   14.93 +	SDL_memset(this->hidden, 0, (sizeof *this->hidden));
   14.94 +
   14.95 +	envr = SDL_getenv(DUMMYENVR_WRITEDELAY);
   14.96 +	this->hidden->write_delay = (envr) ? SDL_atoi(envr) : DUMMYDEFAULT_WRITEDELAY;
   14.97 +
   14.98 +	/* Set the function pointers */
   14.99 +	this->OpenAudio = DUMMYAUD_OpenAudio;
  14.100 +	this->WaitAudio = DUMMYAUD_WaitAudio;
  14.101 +	this->PlayAudio = DUMMYAUD_PlayAudio;
  14.102 +	this->GetAudioBuf = DUMMYAUD_GetAudioBuf;
  14.103 +	this->CloseAudio = DUMMYAUD_CloseAudio;
  14.104 +
  14.105 +	this->free = DUMMYAUD_DeleteDevice;
  14.106 +
  14.107 +	return this;
  14.108 +}
  14.109 +
  14.110 +AudioBootStrap DUMMYAUD_bootstrap = {
  14.111 +	DUMMYAUD_DRIVER_NAME, "SDL dummy audio driver",
  14.112 +	DUMMYAUD_Available, DUMMYAUD_CreateDevice
  14.113 +};
  14.114 +
  14.115 +/* This function waits until it is possible to write a full sound buffer */
  14.116 +static void DUMMYAUD_WaitAudio(_THIS)
  14.117 +{
  14.118 +	SDL_Delay(this->hidden->write_delay);
  14.119 +}
  14.120 +
  14.121 +static void DUMMYAUD_PlayAudio(_THIS)
  14.122 +{
  14.123 +    /* no-op...this is a null driver. */
  14.124 +}
  14.125 +
  14.126 +static Uint8 *DUMMYAUD_GetAudioBuf(_THIS)
  14.127 +{
  14.128 +	return(this->hidden->mixbuf);
  14.129 +}
  14.130 +
  14.131 +static void DUMMYAUD_CloseAudio(_THIS)
  14.132 +{
  14.133 +	if ( this->hidden->mixbuf != NULL ) {
  14.134 +		SDL_FreeAudioMem(this->hidden->mixbuf);
  14.135 +		this->hidden->mixbuf = NULL;
  14.136 +	}
  14.137 +}
  14.138 +
  14.139 +static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
  14.140 +{
  14.141 +#if HAVE_STDIO_H
  14.142 +	fprintf(stderr, "\nWARNING: You are using the SDL dummy audio driver!"
  14.143 +                    " No sound will be output!\n\n");
  14.144 +#endif
  14.145 +
  14.146 +	/* Allocate mixing buffer */
  14.147 +	this->hidden->mixlen = spec->size;
  14.148 +	this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
  14.149 +	if ( this->hidden->mixbuf == NULL ) {
  14.150 +		return(-1);
  14.151 +	}
  14.152 +	SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
  14.153 +
  14.154 +	/* We're ready to rock and roll. :-) */
  14.155 +	return(0);
  14.156 +}
  14.157 +
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/src/audio/dummy/SDL_dummyaudio.h	Tue Mar 14 08:53:33 2006 +0000
    15.3 @@ -0,0 +1,39 @@
    15.4 +/*
    15.5 +    SDL - Simple DirectMedia Layer
    15.6 +    Copyright (C) 1997-2006 Sam Lantinga
    15.7 +
    15.8 +    This library is free software; you can redistribute it and/or
    15.9 +    modify it under the terms of the GNU Lesser General Public
   15.10 +    License as published by the Free Software Foundation; either
   15.11 +    version 2.1 of the License, or (at your option) any later version.
   15.12 +
   15.13 +    This library is distributed in the hope that it will be useful,
   15.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   15.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15.16 +    Lesser General Public License for more details.
   15.17 +
   15.18 +    You should have received a copy of the GNU Lesser General Public
   15.19 +    License along with this library; if not, write to the Free Software
   15.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   15.21 +
   15.22 +    Sam Lantinga
   15.23 +    slouken@libsdl.org
   15.24 +*/
   15.25 +#include "SDL_config.h"
   15.26 +
   15.27 +#ifndef _SDL_dummyaudio_h
   15.28 +#define _SDL_dummyaudio_h
   15.29 +
   15.30 +#include "../SDL_sysaudio.h"
   15.31 +
   15.32 +/* Hidden "this" pointer for the video functions */
   15.33 +#define _THIS	SDL_AudioDevice *this
   15.34 +
   15.35 +struct SDL_PrivateAudioData {
   15.36 +	/* The file descriptor for the audio device */
   15.37 +	Uint8 *mixbuf;
   15.38 +	Uint32 mixlen;
   15.39 +	Uint32 write_delay;
   15.40 +};
   15.41 +
   15.42 +#endif /* _SDL_dummyaudio_h */