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

@@ -45,7 +45,7 @@
*/
#ifndef lint
static char sccsid[] = "@(#)uudecode.c 5.5 (Berkeley) 7/6/88";
/* static char sccsid[] = "@(#)uudecode.c 5.5 (Berkeley) 7/6/88"; */
#endif /* not lint */
#ifdef __MSDOS__ /* For Turbo C */
@@ -60,6 +60,10 @@ static char sccsid[] = "@(#)uudecode.c 5.5 (Berkeley) 7/6/88";
#endif
#endif
#if __APPLE__
#include "config.h"
#endif
/*
* uudecode [input]
*
@@ -126,13 +130,13 @@ main(int argc, char **argv)
}
(void) sscanf(buf, "begin %o %s", &mode, dest);
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(MACOS)
/* handle ~user/file format */
if (dest[0] == '~') {
char *sl;
struct passwd *getpwnam();
struct passwd *user;
char dnbuf[100], *index(), *strcat(), *strcpy();
char dnbuf[100], *strchr(), *strcat(), *strcpy();
sl = strchr(dest, '/');
if (sl == NULL) {
@@ -235,7 +239,7 @@ outdec(char *p, FILE *f, int n)
putc(c3, f);
}
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32)
#if !defined(MSDOS) && !defined(VMS) && !defined(WIN32) && !defined(MACOS)
/*
* Return the ptr in sp at which the character c appears;
* NULL if not found