Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Audio improvements from Max Horn, including a new CoreAudio driver fo…
…r MacOSX
  • Loading branch information
slouken committed Aug 21, 2004
1 parent 85d8792 commit f5d726c
Show file tree
Hide file tree
Showing 12 changed files with 436 additions and 135 deletions.
32 changes: 31 additions & 1 deletion configure.in
Expand Up @@ -332,6 +332,7 @@ CheckDMEDIA()
],[
have_dmedia=yes
])
AC_MSG_RESULT($have_dmedia)
# Set up files for the audio library
if test x$have_dmedia = xyes; then
CFLAGS="$CFLAGS -DDMEDIA_SUPPORT"
Expand Down Expand Up @@ -489,6 +490,29 @@ CheckAtariAudio()
fi
}

dnl Check whether we want to use CoreAudio
CheckCoreAudio()
{
if test x$enable_audio = xyes; then
AC_MSG_CHECKING(for CoreAudio audio support)
have_coreaudio=no
AC_TRY_COMPILE([
#include <AudioUnit/AudioUnit.h>
],[
AudioUnitInputCallback callback;
],[
have_coreaudio=yes
])
AC_MSG_RESULT($have_coreaudio)
# Set up files for the audio library
if test x$have_coreaudio = xyes; then
CFLAGS="$CFLAGS -DCOREAUDIO_SUPPORT"
AUDIO_SUBDIRS="$AUDIO_SUBDIRS macosx"
AUDIO_DRIVERS="$AUDIO_DRIVERS macosx/libaudio_macosx.la"
fi
fi
}

dnl See if we can use x86 assembly blitters
# NASM is available from: http://nasm.octium.net/
CheckNASM()
Expand Down Expand Up @@ -2507,10 +2531,15 @@ case "$target" in
ARCH=macosx
CheckDummyVideo
CheckDiskAudio
CheckCoreAudio
CheckQUARTZ
CheckMacGL
CheckPTHREAD
CheckSIGACTION
# 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
SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit"
fi
# Set up files for the audio library
if test x$enable_audio = xyes; then
AUDIO_SUBDIRS="$AUDIO_SUBDIRS macrom"
Expand All @@ -2526,7 +2555,7 @@ case "$target" in
if test x$enable_cdrom = xyes; then
CDROM_SUBDIRS="$CDROM_SUBDIRS macosx"
CDROM_DRIVERS="$CDROM_DRIVERS macosx/libcdrom_macosx.la"
SYSTEM_LIBS="$SYSTEM_LIBS -framework AudioToolbox -framework AudioUnit -lstdc++"
SYSTEM_LIBS="$SYSTEM_LIBS -lstdc++"
fi
# Set up files for the thread library
if test x$enable_threads = xyes; then
Expand Down Expand Up @@ -2766,6 +2795,7 @@ src/audio/dma/Makefile
src/audio/dmedia/Makefile
src/audio/dsp/Makefile
src/audio/esd/Makefile
src/audio/macosx/Makefile
src/audio/macrom/Makefile
src/audio/mint/Makefile
src/audio/mme/Makefile
Expand Down
1 change: 1 addition & 0 deletions src/audio/Makefile.am
Expand Up @@ -15,6 +15,7 @@ DIST_SUBDIRS = \
dmedia \
dsp \
esd \
macosx \
macrom \
mint \
mme \
Expand Down
3 changes: 3 additions & 0 deletions src/audio/SDL_audio.c
Expand Up @@ -77,6 +77,9 @@ static AudioBootStrap *bootstrap[] = {
#ifdef __BEOS__
&BAUDIO_bootstrap,
#endif
#ifdef COREAUDIO_SUPPORT
&COREAUDIO_bootstrap,
#endif
#if defined(macintosh) || TARGET_API_MAC_CARBON
&SNDMGR_bootstrap,
#endif
Expand Down
3 changes: 3 additions & 0 deletions src/audio/SDL_sysaudio.h
Expand Up @@ -144,6 +144,9 @@ extern AudioBootStrap Paud_bootstrap;
#ifdef __BEOS__
extern AudioBootStrap BAUDIO_bootstrap;
#endif
#ifdef COREAUDIO_SUPPORT
extern AudioBootStrap COREAUDIO_bootstrap;
#endif
#if defined(macintosh) || TARGET_API_MAC_CARBON
extern AudioBootStrap SNDMGR_bootstrap;
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/audio/macosx/.cvsignore
@@ -0,0 +1,6 @@
Makefile.in
Makefile
.libs
*.o
*.lo
*.la
9 changes: 9 additions & 0 deletions src/audio/macosx/Makefile.am
@@ -0,0 +1,9 @@

## Makefile.am for SDL using the Mac OS X CoreAudio driver

noinst_LTLIBRARIES = libaudio_macosx.la
libaudio_macosx_la_SOURCES = $(SRCS)

# The SDL audio driver sources
SRCS = SDL_coreaudio.c \
SDL_coreaudio.h

0 comments on commit f5d726c

Please sign in to comment.