OSS sound tidying up and change request from FreeBSD ports.
authorDavid Griffith <dave@661.org>
Tue, 26 May 2015 19:08:18 +0000 (12:08 -0700)
committerDavid Griffith <dave@661.org>
Tue, 26 May 2015 19:08:18 +0000 (12:08 -0700)
Makefile
src/curses/ux_audio_oss.c
src/misc/findsound.sh

index 9755675e31fbefe30bdd4606c1fcd699a5b5c21c..96cf7f4aca1a454e55e15e1a9126e401f7696fd4 100644 (file)
--- 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)
index ad5ee5b7ecf03affe42c37ed6d677bf06dda4c84..ab2e77aaea7d7b22d332fff5297a8f9a77a2eaaf 100644 (file)
@@ -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;
index c51769f522d8652d8103d33fbfd11852eff35c47..fcc6c71b382d4abf3adbc879b830fd418b637d70 100755 (executable)
@@ -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 <linux/soundcard.h>' >> $OUTFILE
+       else
+               echo "====================================="
+               echo "Oops...  Can't read $FILE!"
+               echo "====================================="
+               exit 3
+       fi
+       exit 0
+fi