$NetBSD: patch-ad,v 1.1.1.1 2002/07/14 09:40:30 rh Exp $ --- sound.c.orig Mon Oct 16 22:10:55 2000 +++ sound.c @@ -43,6 +43,13 @@ # include #endif +#ifdef __NetBSD__ +# define USE_DSP +# define DEV_SOUND "/dev/sound" +# include +# include +#endif + #ifndef DEV_SOUND # define DEV_SOUND "/dev/audio" #endif @@ -61,7 +68,7 @@ #include "ulaw.h" - +char *midi_player = "/usr/bin/midiplay"; char *sound_device = DEV_SOUND; int sound_debug = 1; /* debug information print level * 0: print nothing, silent @@ -218,7 +225,7 @@ { if (sound_debug >= 2) fputs("sync", stderr); - ioctl(fd, SNDCTL_DSP_SYNC); + ioctl(fd, SNDCTL_DSP_SYNC, 0); if (sound_debug >= 2) fputs(" ", stderr); } @@ -639,6 +646,17 @@ if (!sound_enable) return 0; + + bufp = name; + while (strstr(bufp + 1, ".mid") != NULL) bufp = strstr(bufp + 1, ".mid"); + while (strstr(bufp + 1, ".MID") != NULL) bufp = strstr(bufp + 1, ".MID"); + if ((!strncmp(bufp, ".mid", 4) || !strncmp(bufp, ".MID", 4)) && + strlen(bufp) < 6) + { + snprintf(buf, sizeof(buf), "%s %s", midi_player, name); + ks_system2(buf); + return 0; + } bzero(&sf, sizeof(sf)); bzero(buf, sizeof(buf));