summary refs log tree commit diff stats
path: root/lisp/+bongo.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/+bongo.el')
-rw-r--r--lisp/+bongo.el60
1 files changed, 0 insertions, 60 deletions
diff --git a/lisp/+bongo.el b/lisp/+bongo.el deleted file mode 100644 index da68024..0000000 --- a/lisp/+bongo.el +++ /dev/null
@@ -1,60 +0,0 @@
1;;; +bongo.el --- customizations in bongo -*- lexical-binding: t; -*-
2
3;;; Commentary:
4
5;;; Code:
6
7(defgroup +bongo nil
8 "Extra customization for `bongo'."
9 :group 'bongo)
10
11(defun +bongo-notify ()
12 (notifications-notify
13 :title "Now Playing"
14 :body (let ((bongo-field-separator "
15"))
16 (substring-no-properties (bongo-formatted-infoset)))
17 :urgency 'low
18 :transient t))
19
20(defun +bongo-stop-all ()
21 "Ensure only one bongo playlist is playing at a time.
22This is intended to be :before advice to `bongo-play'."
23 (mapc (lambda (b)
24 (with-current-buffer b
25 (when-let* ((modep (derived-mode-p
26 'bongo-playlist-mode))
27 (bongo-playlist-buffer b)
28 (playingp (bongo-playing-p)))
29 (bongo-stop))))
30 (buffer-list)))
31
32
33;;; Bongo Radio
34
35(defcustom +bongo-radio-stations nil
36 "Stations to play using `+bongo-radio'.")
37
38(defcustom +bongo-radio-buffer-name "*Bongo Radio*"
39 "Name of the buffer that holds all bongo radio stations."
40 :type 'string)
41
42(defun +bongo-radio ()
43 (interactive)
44 (switch-to-buffer (or (get-buffer +bongo-radio-buffer-name)
45 (+bongo-radio-init))))
46
47(defun +bongo-radio-init ()
48 (interactive)
49 (let ((bongo-playlist-buffer (get-buffer-create +bongo-radio-buffer-name))
50 (bongo-confirm-flush-playlist nil))
51 (with-bongo-playlist-buffer
52 (bongo-playlist-mode)
53 (bongo-flush-playlist :delete-all)
54 (cl-loop for (name . url) in +bongo-radio-stations
55 do (bongo-insert-uri url name)))
56 (prog1 (switch-to-buffer bongo-playlist-buffer)
57 (goto-char (point-min)))))
58
59(provide '+bongo)
60;;; +bongo.el ends here