]> granicus.if.org Git - nethack/commit
take initial stab at macsound interface
authornhmall <nhmall@nethack.org>
Tue, 24 Jan 2023 04:50:43 +0000 (23:50 -0500)
committernhmall <nhmall@nethack.org>
Tue, 24 Jan 2023 04:50:43 +0000 (23:50 -0500)
commit3d908c49ef50ce5662e8d893c78d3c9e8b359d23
tree029fa38fbc681609ca63454ee480fe0f790695f3
parentae6bb2420b60f973ea2d9c447e0ff85180d37298
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.
14 files changed:
include/extern.h
include/sndprocs.h
sound/macsound/macsound.m [new file with mode: 0644]
src/apply.c
src/decl.c
src/music.c
src/sounds.c
sys/share/uudecode.c
sys/unix/Makefile.src
sys/unix/NetHack.xcodeproj/project.pbxproj
sys/unix/hints/include/multiw-2.370
sys/unix/hints/linux.370
sys/unix/hints/macOS.370
sys/unix/unixmain.c