A few misc changes
[syinit] / 09-sounds-sy.el
1 ;; 09-sounds-sy.el --- Sound set up   -*- Emacs-Lisp -*-
2
3 ;; Copyright (C) 2007 - 2012 Steve Youngs
4
5 ;;     Author: Steve Youngs <steve@sxemacs.org>
6 ;; Maintainer: Steve Youngs <steve@sxemacs.org>
7 ;;    Created: <2007-12-02>
8 ;; Time-stamp: <Saturday Jan 26, 2013 21:45:54 steve>
9 ;;   Download: <http://bastard.steveyoungs.com/~steve/SXEmacs/inits/>
10 ;;   HTMLised: <http://bastard.steveyoungs.com/~steve/SXEmacs/htmlinits/09-sounds-sy.html>
11 ;;   Git Repo: git clone http://git.sxemacs.org/syinit
12 ;;   Keywords: init, compile
13
14 ;; This file is part of SYinit
15
16 ;; Redistribution and use in source and binary forms, with or without
17 ;; modification, are permitted provided that the following conditions
18 ;; are met:
19 ;;
20 ;; 1. Redistributions of source code must retain the above copyright
21 ;;    notice, this list of conditions and the following disclaimer.
22 ;;
23 ;; 2. Redistributions in binary form must reproduce the above copyright
24 ;;    notice, this list of conditions and the following disclaimer in the
25 ;;    documentation and/or other materials provided with the distribution.
26 ;;
27 ;; 3. Neither the name of the author nor the names of any contributors
28 ;;    may be used to endorse or promote products derived from this
29 ;;    software without specific prior written permission.
30 ;;
31 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
32 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
33 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 ;; DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
35 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
38 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
39 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
40 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
41 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
43 ;;; Commentary:
44 ;;
45 ;;   Just sets up sound stuff.
46 ;;
47
48 ;;; Credits:
49 ;;
50 ;;   The HTML version of this file was created with Hrvoje Niksic's
51 ;;   htmlize.el which is part of the XEmacs "text-modes" package.
52 ;;
53
54 ;;; Todo:
55 ;;
56 ;;     
57
58 ;;; Code:
59 ;:*=======================
60 ;:* Set default sound device
61 (when (getenv "DISPLAY")                ; skip the lot if not in X11
62   (setq default-audio-device (make-audio-device 'pulse))
63   ;(setq default-audio-device (make-audio-device 'alsa))
64   (init-workers 6)
65   (setq synchronous-sounds nil)
66   (load "sound")
67   (setq bell-volume 100)
68   (when (device-sound-enabled-p)
69     (load-sound-file "low-smash" 'auto-save-error)
70     (load-sound-file "bark" 'command-error)
71     (load-sound-file "slap" 'undefined-key)
72     (load-sound-file "slap" 'undefined-click)
73     (load-sound-file "clink" 'no-completion)
74     (load-sound-file "bong" 'y-or-n-p)
75     (load-sound-file "explosion" 'yes-or-no-p)
76     (load-sound-file "drip" 'buffer-bound)
77     (load-sound-file "whip" 'read-only)
78     (load-sound-file "bass-snap" 'default)
79     (load-sound-file "yeep" 'quit)
80     (load-sound-file "drum-beep" 'isearch-failed)
81     (load-sound-file "bass-snap" 'isearch-quit)
82     (load-sound-file "slap" 'ready)
83     (load-sound-file "return" 'warp)
84     (load-sound-file "cuckoo" 'alarm))
85   )
86 ;:*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
87 (if default-audio-device
88     (message "sounds loaded")
89   (message "sounds NOT loaded (OK if this is a TTY)"))