Merge pull request #7 from teeann/tick-audio

add option to disable ticking sound
This commit is contained in:
Pavel Korytov 2022-03-15 23:38:55 +03:00 committed by GitHub
commit 2a2673bdc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -161,6 +161,11 @@ a particular event."
:group 'pomm
:type 'boolean)
(defcustom pomm-audio-tick-enabled nil
"Whether to play ticking sound."
:group 'pomm
:type 'boolean)
(defun pomm--get-sound-file-path (name)
"Get path to the sound resource NAME.
@ -327,7 +332,8 @@ which can be played by `pomm-audio-player-executable'."
(unless pomm-audio-player-executable
(error "No audio player executable! Set 'pomm-audio-player-executable'")
(setq pomm-audio-enabled nil))
(when-let (sound (alist-get kind pomm-audio-files))
(when-let ((play-sound (or (not (eq 'tick kind)) pomm-audio-tick-enabled))
(sound (alist-get kind pomm-audio-files)))
(start-process
"pomm-audio-player"
nil