[PATCH] Re: Removing old cruft



Hi all,

here's the patch to drop our built-in audio-support, instead we simply
rely on playbin, /usr/bin/paplay by default.

Do `git rm src/play-sample.c' + apply the following patch:

*******************************************************

 --- a/OPTIONS
+++ b/OPTIONS
@@ -307,9 +307,8 @@
 ;;	  ".")
 ;;    "List of directories to search for sound samples.")

-;;  (define-special-variable play-sample-program nil
-;;    "The program used to play audio samples. If unset, built-in
-;;support for ESD is used.")
+;;  (define-special-variable play-sample-program "/usr/bin/paplay"
+;;    "The program used to play audio samples.")

 ;; edge flip options

diff --git a/config.h.in b/config.h.in
index 4125686..615489a 100644
--- a/config.h.in
+++ b/config.h.in
@@ -24,9 +24,6 @@
 /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
 #undef HAVE_DOPRNT

-/* Have ESD */
-#undef HAVE_ESD
-
 /* Define to 1 if you have the <fcntl.h> header file. */
 #undef HAVE_FCNTL_H

@@ -48,9 +45,6 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H

-/* Have libaudiofile */
-#undef HAVE_LIBAUDIOFILE
-
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL

diff --git a/configure.in b/configure.in
index f405ab1..8799249 100644
--- a/configure.in
+++ b/configure.in
@@ -261,36 +261,6 @@ if test "$with_gdk_pixbuf" = "no"; then
 			  ,AC_MSG_ERROR([cannot locate imlib1 library]))
 fi

-dnl Check for libaudiofile
-AUDIOFILE_MIN_VER="0.2.3"
-
-AC_ARG_WITH(audiofile,
-	    [  --with-audiofile	  Use libaudiofile for sound manipulation
-	     --without-audiofile], [], [with_audiofile=yes])
-
-if test "$with_audiofile" = "yes"; then
-    PKG_CHECK_MODULES(AUDIOFILE, audiofile >= ${AUDIOFILE_MIN_VER},
-		      ,AUDIOFILE_LIBS="`pkg-config --libs audiofile`"
-		      AUDIOFILE_CFLAGS="`pkg-config --cflags audiofile`"
-		      AC_DEFINE(HAVE_LIBAUDIOFILE, 1, [Have libaudiofile])
-		      ,AC_MSG_ERROR([cannot locate libaudiofile]))
-fi
-
-dnl Check for esound
-ESD_MIN_VER="0.2.23"
-
-AC_ARG_WITH(esd,
-	    [  --with-esd	  Use the Enlightened Sound Daemon
-	     --without-esd], [], [with_esd=yes])
-
-if test "$with_esd" = "yes"; then
-    PKG_CHECK_MODULES(ESD, esound >= ${ESD_MIN_VER}
-		      ,ESD_LIBS="`pkg-config --libs esound`"
-		      ESD_CFLAGS="`pkg-config --cflags esound`"
-		      AC_DEFINE(HAVE_ESD, 1, [Have ESD])
-		      ,AC_MSG_ERROR([cannot locate esound]))
-fi
-
 dnl Check wether to install mo files

 AC_ARG_WITH(nls,
diff --git a/lisp/sawfish/wm/ext/audio-events.jl
b/lisp/sawfish/wm/ext/audio-events.jl
index 7cf1a7a..9db9d5b 100644
--- a/lisp/sawfish/wm/ext/audio-events.jl
+++ b/lisp/sawfish/wm/ext/audio-events.jl
@@ -29,11 +29,12 @@
 	  rep.system
 	  sawfish.wm.custom
 	  sawfish.wm.windows
-	  sawfish.wm.state.maximize)
+	  sawfish.wm.state.maximize
+	  sawfish.wm.util.play-audio)

   (define-structure-alias audio-events sawfish.wm.ext.audio-events)

-  (defgroup audio "Sound"
+  (defgroup audio "Sound"
     :require sawfish.wm.ext.audio-events)

   ;; XXX it would be cool to merge the customization with the GNOME
sound prefs
diff --git a/lisp/sawfish/wm/util/play-audio.jl
b/lisp/sawfish/wm/util/play-audio.jl
index c5d2850..f121e6d 100644
--- a/lisp/sawfish/wm/util/play-audio.jl
+++ b/lisp/sawfish/wm/util/play-audio.jl
@@ -39,10 +39,9 @@
 	  ".")
     "List of directories to search for sound samples.")

-  (defcustom play-sample-program nil
-    "The program used to play audio samples. If unset, built-in support
for \
-ESD is used."
-    :type (optional program)
+  (defcustom play-sample-program "/usr/bin/paplay"
+    "The program used to play audio samples."
+    :type program
     :group audio)

   ;; currently running audio process
@@ -60,18 +59,13 @@ ESD is used."
 	(setq real-name (make-temp-name))
 	(copy-file filename real-name)
 	(setq delete-it t))
-      (if play-sample-program
-	  ;; start programs asynchronously in case they block..
-	  (let ((sentinel (lambda (proc)
-			    (when (eq play-sample-process proc)
-			      (setq play-sample-process nil))
-			    (when delete-it
-			      (delete-file real-name)))))
-	    (when play-sample-process
-	      (kill-process play-sample-process))
-	    (setq play-sample-process (make-process standard-error sentinel))
-	    (start-process play-sample-process play-sample-program real-name))
-	(require 'sawfish.wm.util.play-sample)
-	(primitive-play-sample real-name)
-	(when delete-it
-	  (delete-file real-name))))))
+	;; start programs asynchronously in case they block..
+	(let ((sentinel (lambda (proc)
+	    (when (eq play-sample-process proc)
+	      (setq play-sample-process nil))
+	    (when delete-it
+	      (delete-file real-name)))))
+	  (when play-sample-process
+	    (kill-process play-sample-process))
+	  (setq play-sample-process (make-process standard-error sentinel))
+	  (start-process play-sample-process play-sample-program
real-name)))))
diff --git a/src/Makefile.in b/src/Makefile.in
index b7b2d91..b62f89b 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -31,11 +31,10 @@ SRCS :=	colors.c cursors.c display.c events.c
fonts.c frames.c \
 	property-cache.c server.c session.c stacking-list.c windows.c
 OBJS := $(SRCS:.c=.o)

-DL_SRCS := gradient.c flippers.c x.c selection.c play-sample.c
+DL_SRCS := gradient.c flippers.c x.c selection.c
 DL_OBJS := $(DL_SRCS:%.c=%.la) client.la
 DL_DSTS = sawfish/wm/util/gradient.la sawfish/wm/util/flippers.la \
-	  sawfish/wm/util/x.la sawfish/wm/util/selection.la \
-	  sawfish/wm/util/play-sample.la
+	  sawfish/wm/util/x.la sawfish/wm/util/selection.la
 DL_DIRS = sawfish/wm/util

 override CFLAGS := $(CFLAGS) $(REP_CFLAGS) $(IMAGE_CFLAGS)
$(X11_CFLAGS) $(ESD_CFLAGS) $(PANGO_CFLAGS)
@@ -50,9 +49,6 @@ sawfish : $(OBJS) $(LIBOBJS)
 %.la : %.lo
 	$(rep_DL_LD) $(LDFLAGS) -o $@ $<

-play-sample.la : play-sample.lo
-	$(rep_DL_LD) $(LDFLAGS) -o $@ $< $(ESD_LIBS) $(AUDIOFILE_LIBS)
-
 libclient_.lo : libclient.c
 	$(rep_LIBTOOL) --mode=compile --tag=CC $(CC) -c $(CPPFLAGS) $(CFLAGS)
-o $@ $<

*******************************************************

No functionality loss, but less code!

What about this solution?
Chris

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]