From 58a174d4e6558b97487e757461ccba8d0caad628 Mon Sep 17 00:00:00 2001 From: David Griffith Date: Tue, 26 May 2015 12:08:18 -0700 Subject: [PATCH] OSS sound tidying up and change request from FreeBSD ports. --- Makefile | 4 ++-- src/curses/ux_audio_oss.c | 4 ++-- src/misc/findsound.sh | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9755675..96cf7f4 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ COLOR_DEFS = -DCOLOR_SUPPORT # Define your sound device # This should probably be a command-line/config-file option. # -#SOUND_DEV = /dev/dsp +SOUND_DEV = /dev/dsp #SOUND_DEV = /dev/sound #SOUND_DEV = /dev/audio @@ -184,7 +184,7 @@ BLORB_OBJECT = $(BLORB_DIR)/blorblib.o TARGETS = $(COMMON_TARGET) $(CURSES_TARGET) $(BLORB_TARGET) OPT_DEFS = -DCONFIG_DIR="\"$(CONFIG_DIR)\"" $(CURSES_DEF) \ - -DVERSION="\"$(VERSION)\"" + -DVERSION="\"$(VERSION)\"" -DSOUND_DEV="\"$(SOUND_DEV)\"" CURSES_DEFS = $(OPT_DEFS) $(COLOR_DEFS) $(SOUND_DEFS) $(SOUNDCARD) \ $(MEMMOVE_DEF) diff --git a/src/curses/ux_audio_oss.c b/src/curses/ux_audio_oss.c index ad5ee5b..ab2e77a 100644 --- a/src/curses/ux_audio_oss.c +++ b/src/curses/ux_audio_oss.c @@ -80,7 +80,7 @@ static void sigterm_handler(int signal) { _exit(0); } -static void sigint_handler(int signal) { +static void oss_sigint_handler(int signal) { num_repeats = 1; } @@ -141,7 +141,7 @@ static void play_sound(int volume, int repeats) { sigaddset(&sa.sa_mask, SIGTERM); sa.sa_flags = 0; sigaction(SIGTERM, &sa, NULL); - sa.sa_handler = sigint_handler; + sa.sa_handler = oss_sigint_handler; sigaction(SIGINT, &sa, NULL); for (num_repeats = repeats; num_repeats > 0; diff --git a/src/misc/findsound.sh b/src/misc/findsound.sh index c51769f..fcc6c71 100755 --- a/src/misc/findsound.sh +++ b/src/misc/findsound.sh @@ -14,6 +14,7 @@ INCLUDE1="/usr/include/sys" INCLUDE2="/usr/include" INCLUDE3="/usr/include/machine" +INCLUDE4="/usr/include/linux" SOUNDCARD_H="soundcard.h" OUTFILE="$1/soundcard.h" @@ -88,3 +89,18 @@ if [ -f $FILE ] ; then fi + +FILE=$INCLUDE4/$SOUNDCARD_H +if [ -f $FILE ] ; then + echo "I see we have $FILE..." + echo + if [ -r $FILE ] ; then + echo '#include ' >> $OUTFILE + else + echo "=====================================" + echo "Oops... Can't read $FILE!" + echo "=====================================" + exit 3 + fi + exit 0 +fi