emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] 168/255: adding option to play a sound during moves


From: Eric Schulte
Subject: [elpa] 168/255: adding option to play a sound during moves
Date: Sun, 16 Mar 2014 01:02:41 +0000

eschulte pushed a commit to branch go
in repository elpa.

commit 5ae676f28a5bbab6914de5b2c21dc492362652f6
Author: Eric Schulte <address@hidden>
Date:   Tue Jun 5 15:02:02 2012 -0600

    adding option to play a sound during moves
---
 go-board.el |    7 +++++++
 stone.wav   |  Bin 0 -> 6754 bytes
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/go-board.el b/go-board.el
index 2bec034..448e0c1 100644
--- a/go-board.el
+++ b/go-board.el
@@ -45,6 +45,12 @@
 (defvar *go-board-overlays* nil
   "List of overlays carrying GO board painting information.")
 
+(defvar go-board-use-move-sound nil)
+(defvar go-board-move-sound
+  `(sound :file ,(expand-file-name "stone.wav"
+                                   (file-name-directory
+                                    (or load-file-name (buffer-file-name))))))
+
 
 ;;; Board manipulation functions
 (defun make-board (size) (make-vector (* size size) nil))
@@ -69,6 +75,7 @@
 (defun apply-turn-to-board (moves)
   (let ((board (pieces-to-board (car *history*) *size*)))
     (clear-labels board)
+    (when go-board-use-move-sound (play-sound go-board-move-sound))
     (dolist (move moves) (apply-move board move))
     (push (board-to-pieces board) *history*)
     (update-display (current-buffer))))
diff --git a/stone.wav b/stone.wav
new file mode 100644
index 0000000..253078f
Binary files /dev/null and b/stone.wav differ



reply via email to

[Prev in Thread] Current Thread [Next in Thread]