take initial stab at macsound interface

Use macOS AppKit framework routines for a first cut at a
macsound soundlib interface.

Requires WANT_MACSOUND=1 on build.

Nothing has been done to move the stock sounds into the resources
of a bundle, so after building, if you want to try the stock sounds
out:
	cp sound/wav/*.wav ~/Library/Sounds

Because the NSSound macOS routines always do the search, supposedly
the following locations are searched in this order:
   1. the application’s main bundle
   2. ~/Library/Sounds
   3. /Library/Sounds
   4. /Network/Library/Sounds
   5. /System/Library/Sounds

Although not specifically implemented as of yet, it may be pretty
close to being able to put soundeffects wav files (by se_ name)
into ~/Library/Sounds working for the SND_SOUNDEFFECTS_AUTOMAP feature.

Feedback is welcome. Contributions for improving it are even more
welcome.

The new soundlib supporting file is named
sound/macsound/macsound.m since it's got objective C in it.

Known bugs and glitches:

The Hero_playnotes on a set of 5 notes goes too fast, so there
needs to be a slight delay added between the note of a multi-note
play.
This commit is contained in:
nhmall
2023-01-23 23:50:43 -05:00
parent ae6bb2420b
commit 3d908c49ef
14 changed files with 524 additions and 50 deletions

View File

@@ -539,9 +539,9 @@ HACKINCL = align.h artifact.h artilist.h attrib.h botl.h \
micro.h mkroom.h monattk.h mondata.h monflag.h monst.h monsters.h \
obj.h objects.h objclass.h optlist.h patchlevel.h pcconf.h \
permonst.h prop.h rect.h region.h sym.h defsym.h rm.h sp_lev.h \
spell.h sys.h system.h tcap.h timeout.h tradstdc.h trap.h unixconf.h \
vision.h vmsconf.h wintty.h wincurs.h winX.h winprocs.h wintype.h \
you.h youprop.h
spell.h sndprocs.h sys.h system.h tcap.h timeout.h tradstdc.h \
trap.h unixconf.h vision.h vmsconf.h wintty.h wincurs.h winX.h \
winprocs.h wintype.h you.h youprop.h
HSOURCES = $(HACKINCL) dgn_file.h
@@ -591,7 +591,7 @@ HOBJ = $(TARGETPFX)allmain.o $(TARGETPFX)alloc.o \
$(TARGETPFX)were.o $(TARGETPFX)wield.o $(TARGETPFX)windows.o \
$(TARGETPFX)wizard.o $(TARGETPFX)worm.o $(TARGETPFX)worn.o \
$(TARGETPFX)write.o $(TARGETPFX)zap.o \
$(REGEXOBJ) $(RANDOBJ) $(SYSOBJ) $(WINOBJ) $(HINTOBJ) \
$(REGEXOBJ) $(RANDOBJ) $(SYSOBJ) $(WINOBJ) $(HINTOBJ) $(SNDLIBOBJ) \
$(TARGETPFX)version.o
#
DATE_O = $(TARGETPFX)date.o
@@ -605,7 +605,7 @@ all: $(GAME)
pregame:
$(PREGAME)
$(GAME): pregame $(MAKEDEFS) $(LUALIB) $(SYSTEM)
$(GAME): pregame $(MAKEDEFS) $(LUALIB) $(WAVS) $(SYSTEM)
@echo "$(GAME) is up to date."
Sysunix: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@@ -811,7 +811,7 @@ $(HACK_H): ../include/hack.h $(CONFIG_H) ../include/lint.h ../include/align.h \
../include/obj.h ../include/engrave.h ../include/you.h \
../include/attrib.h ../include/monst.h ../include/mextra.h \
../include/skills.h ../include/timeout.h ../include/flag.h \
../include/winprocs.h ../include/sys.h
../include/winprocs.h ../include/sndprocs.h ../include/sys.h
touch $(HACK_H)
#
$(TARGETPFX)pcmain.o: ../sys/share/pcmain.c $(HACK_H) ../include/dlb.h

View File

@@ -141,6 +141,7 @@
31B8A46121A26AF60055BD01 /* panic.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A42721A267E60055BD01 /* panic.c */; };
31B8A46221A26B020055BD01 /* alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 31B8A36521A238040055BD01 /* alloc.c */; };
5439B3BC275AADC600B8FB2F /* date.c in Sources */ = {isa = PBXBuildFile; fileRef = 5439B3BB275AADC600B8FB2F /* date.c */; };
543ECF6C297EEF3800A13155 /* macsound.m in Sources */ = {isa = PBXBuildFile; fileRef = 54AEB885297EE7C4005F1B13 /* macsound.m */; };
54435B52247999CB00804CB3 /* nhlobj.c in Sources */ = {isa = PBXBuildFile; fileRef = 54435B51247999CB00804CB3 /* nhlobj.c */; };
544768AB239949FA004B9739 /* sfstruct.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768A8239949FA004B9739 /* sfstruct.c */; };
544768AE23994A17004B9739 /* nhlsel.c in Sources */ = {isa = PBXBuildFile; fileRef = 544768AC23994A17004B9739 /* nhlsel.c */; };
@@ -503,7 +504,17 @@
544768B523995488004B9739 /* nhlua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nhlua.h; path = ../../include/nhlua.h; sourceTree = "<group>"; };
544768B923995BB7004B9739 /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../lib/lua/liblua.a; sourceTree = "<group>"; };
5462D14723E7B19200969423 /* insight.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = insight.c; path = ../../src/insight.c; sourceTree = "<group>"; };
548FB9F9297F2B03000D04CF /* sndprocs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = sndprocs.h; path = ../../include/sndprocs.h; sourceTree = "<group>"; };
548FB9FA297F2BBD000D04CF /* optlist.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = optlist.h; path = ../../include/optlist.h; sourceTree = "<group>"; };
548FB9FB297F2BBD000D04CF /* hacklib.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = hacklib.h; path = ../../include/hacklib.h; sourceTree = "<group>"; };
548FB9FC297F2BBD000D04CF /* warnings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = warnings.h; path = ../../include/warnings.h; sourceTree = "<group>"; };
548FB9FD297F2BBD000D04CF /* defsym.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = defsym.h; path = ../../include/defsym.h; sourceTree = "<group>"; };
548FB9FE297F2BBD000D04CF /* fnamesiz.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = fnamesiz.h; path = ../../include/fnamesiz.h; sourceTree = "<group>"; };
548FB9FF297F2BBD000D04CF /* objects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = objects.h; path = ../../include/objects.h; sourceTree = "<group>"; };
548FBA00297F2BBD000D04CF /* tile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = tile.h; path = ../../include/tile.h; sourceTree = "<group>"; };
548FBA01297F2BBD000D04CF /* monsters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = monsters.h; path = ../../include/monsters.h; sourceTree = "<group>"; };
54A3D3EB282C55A900143F8C /* utf8map.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = utf8map.c; path = ../../src/utf8map.c; sourceTree = "<group>"; };
54AEB885297EE7C4005F1B13 /* macsound.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = macsound.m; path = ../../sound/macsound/macsound.m; sourceTree = "<group>"; };
54FB2B4A246310A600397C0E /* symbols.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = symbols.c; path = ../../src/symbols.c; sourceTree = "<group>"; };
54FCE8282223261F00F393C8 /* isaac64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = isaac64.c; path = ../../src/isaac64.c; sourceTree = "<group>"; };
BAE8010A27B97760002B3786 /* libnhlua.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libnhlua.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -587,6 +598,8 @@
3189576821A1FCC100FB2ABE = {
isa = PBXGroup;
children = (
54AEB886297EE7E9005F1B13 /* sound */,
54AEB885297EE7C4005F1B13 /* macsound.m */,
BAE8015827B99D44002B3786 /* nhlualib */,
2A953FB221A3F404007906E5 /* XCode.xcconfig */,
31B8A3F821A23E490055BD01 /* win */,
@@ -748,6 +761,15 @@
3189579621A2046700FB2ABE /* include */ = {
isa = PBXGroup;
children = (
548FB9FD297F2BBD000D04CF /* defsym.h */,
548FB9FE297F2BBD000D04CF /* fnamesiz.h */,
548FB9FB297F2BBD000D04CF /* hacklib.h */,
548FBA01297F2BBD000D04CF /* monsters.h */,
548FB9FF297F2BBD000D04CF /* objects.h */,
548FB9FA297F2BBD000D04CF /* optlist.h */,
548FBA00297F2BBD000D04CF /* tile.h */,
548FB9FC297F2BBD000D04CF /* warnings.h */,
548FB9F9297F2B03000D04CF /* sndprocs.h */,
544768B523995488004B9739 /* nhlua.h */,
544768B423995447004B9739 /* isaac64.h */,
3186A3B721A4B0FD0052BF02 /* align.h */,
@@ -903,6 +925,13 @@
name = Frameworks;
sourceTree = "<group>";
};
54AEB886297EE7E9005F1B13 /* sound */ = {
isa = PBXGroup;
children = (
);
path = sound;
sourceTree = "<group>";
};
BAE8015827B99D44002B3786 /* nhlualib */ = {
isa = PBXGroup;
children = (
@@ -1608,6 +1637,7 @@
544768AB239949FA004B9739 /* sfstruct.c in Sources */,
31B8A3A721A238060055BD01 /* minion.c in Sources */,
31B8A3F021A23D420055BD01 /* unixtty.c in Sources */,
543ECF6C297EEF3800A13155 /* macsound.m in Sources */,
31B8A37F21A238060055BD01 /* extralev.c in Sources */,
31B8A39B21A238060055BD01 /* dogmove.c in Sources */,
54A3D3EC282C55A900143F8C /* utf8map.c in Sources */,
@@ -1801,7 +1831,7 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "c++98";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
@@ -1828,6 +1858,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -1872,6 +1903,9 @@
"-DHACKDIR=\\\"$(NH_INSTALL_DIR)\\\"",
"-DSECURE",
"-DCURSES_GRAPHICS",
"-DSND_LIB_MACSOUND",
"-DSND_SOUNDEFFECTS_AUTOMAP",
"-DUSER_SOUNDS",
);
SDKROOT = macosx;
};
@@ -1886,7 +1920,7 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "c++98";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
@@ -1913,6 +1947,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -1960,8 +1995,10 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
GCC_C_LANGUAGE_STANDARD = c99;
INSTALL_PATH = "$(NH_INSTALL_DIR)";
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
"OTHER_LDFLAGS[arch=*]" = "-L${NH_LIB_DIR}/lua";
PRODUCT_NAME = "$(TARGET_NAME)";
};
@@ -1972,8 +2009,10 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
GCC_C_LANGUAGE_STANDARD = c99;
INSTALL_PATH = "$(NH_INSTALL_DIR)";
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
"OTHER_LDFLAGS[arch=*]" = "-L${NH_LIB_DIR}/lua";
PRODUCT_NAME = "$(TARGET_NAME)";
};
@@ -1984,6 +2023,8 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -1993,6 +2034,8 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
@@ -2002,6 +2045,8 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -2011,6 +2056,8 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
@@ -2020,6 +2067,8 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -2029,6 +2078,8 @@
buildSettings = {
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
@@ -2043,11 +2094,13 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 6978C4Q2VB;
EXECUTABLE_PREFIX = lib;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
OTHER_CFLAGS = (
"-DNOMAIL",
"-DNOTPARMDECL",
@@ -2077,11 +2130,13 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_STYLE = Automatic;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 6978C4Q2VB;
EXECUTABLE_PREFIX = lib;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
OTHER_CFLAGS = (
"-DNOMAIL",
"-DNOTPARMDECL",

View File

@@ -145,7 +145,8 @@ ifdef WANT_WIN_QT
WINCFLAGS += -DQT_GRAPHICS
WINSRC += $(WINQTSRC)
WINOBJ0 += $(WINQTOBJ)
SNDCFLAGS += -DSND_LIB_QTSOUND -DUSER_SOUNDS
SNDCFLAGS += -DSND_LIB_QTSOUND
HAVE_SNDLIB = 1 # Indicates a sndlib, so USER_SOUNDS gets defined later
XTRASRC += tile.c
XTRAOBJ += $(TARGETPFX)tile.o
#

View File

@@ -113,6 +113,12 @@ endif #MAKEFILE_SRC
endif #HAVE_NCURSESW
endif #WANT_WIN_CURSES
# HAVE_SNDLIB could have been set in multiw-2 for Qt.
# If it is set, add USER_SOUNDS
ifeq "$(HAVE_SNDLIB)" "1"
SNDCFLAGS+= -DUSER_SOUNDS
endif
CFLAGS+= $(WINCFLAGS) #WINCFLAGS set from multiw-2.370
CFLAGS+= $(SNDCFLAGS) #SNDCFLAGS set from multiw-2.370
CFLAGS+= $(NHCFLAGS)

View File

@@ -155,6 +155,21 @@ endif #CURSES_UNICODE=0
endif #CURSES_UNIODE=sys
endif #MAKEFILE_SRC
ifdef WANT_MACSOUND
HAVE_SNDLIB = 1
SNDCFLAGS+= -DSND_LIB_MACSOUND -DSND_SOUNDEFFECTS_AUTOMAP
SNDLIBSRC = ../sound/macsound/macsound.m
SNDLIBOBJ = macsound.o
LFLAGS += -framework AppKit
endif
# HAVE_SNDLIB could have been set just above, or it could
# have been set in multiw-2 for Qt. Either way, if it is
# set, add USER_SOUNDS
ifeq "$(HAVE_SNDLIB)" "1"
SNDCFLAGS+= -DUSER_SOUNDS
endif
CFLAGS+= $(PKGCFLAGS) $(WINCFLAGS) #WINCFLAGS set from multiw-2.370
CFLAGS+= $(SNDCFLAGS) #SNDCFLAGS set from multiw-2.370
CFLAGS+= $(NHCFLAGS)
@@ -373,12 +388,48 @@ VARDIR=$(HACKDIR)
#
#-INCLUDE gbdates-pre.370
#
ifdef WANT_MACSOUND
WAVDIR = ../sound/wav
SNDWAVS = se_squeak_A se_squeak_B se_squeak_B_flat se_squeak_C se_squeak_D \
se_squeak_D_flat se_squeak_E se_squeak_E_flat se_squeak_F \
se_squeak_F_sharp se_squeak_G se_squeak_G_sharp sound_Bell \
sound_Bugle_A sound_Bugle_B sound_Bugle_C sound_Bugle_D \
sound_Bugle_E sound_Bugle_F sound_Bugle_G \
sound_Drum_Of_Earthquake sound_Fire_Horn sound_Frost_Horn \
sound_Leather_Drum sound_Magic_Harp_A sound_Magic_Harp_B \
sound_Magic_Harp_C sound_Magic_Harp_D sound_Magic_Harp_E \
sound_Magic_Harp_F sound_Magic_Harp_G sound_Tooled_Horn_A \
sound_Tooled_Horn_B sound_Tooled_Horn_C sound_Tooled_Horn_D \
sound_Tooled_Horn_E sound_Tooled_Horn_F sound_Tooled_Horn_G \
sound_Wooden_Flute_A sound_Wooden_Flute_B sound_Wooden_Flute_C \
sound_Wooden_Flute_D sound_Wooden_Flute_E sound_Wooden_Flute_F \
sound_Wooden_Flute_G sound_Wooden_Harp_A sound_Wooden_Harp_B \
sound_Wooden_Harp_C sound_Wooden_Harp_D sound_Wooden_Harp_E \
sound_Wooden_Harp_F sound_Wooden_Harp_G
WAVS = $(addprefix $(WAVDIR)/, $(addsuffix .wav, $(SNDWAVS)))
endif
#-POST
#
#-INCLUDE gbdates-post.370
#
ifdef WANT_MACSOUND
$(TARGETPFX)$(SNDLIBOBJ): $(SNDLIBSRC) $(HACK_H)
$(CC) $(CFLAGS) -c -o$@ $(SNDLIBSRC)
$(WAVDIR)/%.wav: ../util/uudecode $(WAVDIR)/%.uu
$^
mv $(notdir $@) $@
../util/uudecode: uudecode.o
$(CC) $(LFLAGS) uudecode.o -o $@
uudecode.o: ../sys/share/uudecode.c
$(CC) $(CFLAGS) -c -o $@ ../sys/share/uudecode.c
endif # WANT_MACSOUND
ifdef WANT_LIBNH
$(TARGETPFX)libnh.a: $(HOBJ) $(LIBNHSYSOBJ) ../lib/lua/liblua.a
$(AR) rcs $@ $(HOBJ) $(LIBNHSYSOBJ) ../lib/lua/liblua.a

View File

@@ -102,6 +102,18 @@ main(int argc, char *argv[])
choose_windows(DEFAULT_WINDOW_SYS);
#ifdef SND_LIB_INTEGRATED
/* One of the soundlib interfaces was integrated on build.
* We can leave a hint here for activate_chosen_soundlib later.
* assign_soundlib() just sets an indicator, it doesn't initialize
* any soundlib, and the indicator could be overturned before
* activate_chosen_soundlib() gets called.
*/
#if defined(SND_LIB_MACSOUND) && !defined(SND_LIB_QTSOUND)
assign_soundlib(soundlib_macsound);
#endif
#endif
#ifdef CHDIR /* otherwise no chdir() */
/*
* See if we must change directory to the playground.