diff options
author | jao <jao@gnu.org> | 2022-07-31 03:58:06 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-07-31 03:58:06 +0100 |
commit | f8e9b2e6099dd569e971b32c3a733ea8e5e0952d (patch) | |
tree | f518365fcf006b875d75e49be637e18c15498431 /lib | |
parent | f11b804dbd11c6288b7847dd3ef0551323392747 (diff) | |
download | elibs-f8e9b2e6099dd569e971b32c3a733ea8e5e0952d.tar.gz elibs-f8e9b2e6099dd569e971b32c3a733ea8e5e0952d.tar.bz2 |
jao-mpc: playing http radio streams
Diffstat (limited to 'lib')
-rw-r--r-- | lib/media/jao-mpc.el | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el index a86795b..5633648 100644 --- a/lib/media/jao-mpc.el +++ b/lib/media/jao-mpc.el @@ -95,8 +95,8 @@ (format "%s%s %s%s%s%s" ;; (jao--put-face (if (zerop no) "" (format "%02d/%s " no len)) 'jao-themes-f02) - (jao--put-face title 'jao-themes-f00) - (jao--put-face artist 'jao-themes-f01) + (jao--put-face (or title "") 'jao-themes-f00) + (jao--put-face (or artist "") 'jao-themes-f01) (jao--put-face (if composer (format " [%s]" composer) "") 'jao-themes-f01) (jao--put-face (if album (format " (%s)" album) "") 'jao-themes-f11) @@ -236,6 +236,31 @@ (jao-mpc--cmd (format "add %s" url))) ;;;###autoload +(defun jao-mpc-add-or-play-url (url &optional play) + "Add the given URL to mpc's playing list, or just play it." + (let ((p (or play (yes-or-no-p (format "Play %s right now?" url))))) + (when p (jao-mpc-clear)) + (jao-mpc-add-url url) + (if p (jao-mpc-play) (message "%s added to mpc queue" url)))) + +(defvar jao-mpc-stream-urls + '(("classic fm" . "http://media-ice.musicradio.com:80/ClassicFMMP3") + ("wcpe" . "http://audio-mp3.ibiblio.org:8000/wcpe.mp3") + ("cinemix" . "http://94.23.51.96:8000") + ("bbc gold" . "http://media-ice.musicradio.com:80/GoldMP3") + ("irish gold" . "http://icecast2.rte.ie/gold"))) + +;; other cinemix: +;; http://209.9.238.4:6022 http://209.9.238.4:6046 + +;;;###autoload +(defun jao-mpc-play-stream () + "Select a predefined stream URL and add or play it in mpc." + (interactive) + (let ((s (completing-read "Stream: " jao-mpc-stream-urls))) + (jao-mpc-add-or-play-url (cdr (assoc s jao-mpc-stream-urls)) t))) + +;;;###autoload (defun jao-mpc-show-albums (&optional port) "Show album list." (interactive) |