.emacs.d/site-lisp/metalexpress.el

This commit is contained in:
Tom Willemsen 2012-11-27 11:12:33 +01:00
parent 7dc3ebbcc1
commit 19524caf26

View file

@ -32,13 +32,18 @@
"http://usa7-vn.mixstream.net/listen/8248.m3u" "http://usa7-vn.mixstream.net/listen/8248.m3u"
"The URL of the Metal Express Radio stream.") "The URL of the Metal Express Radio stream.")
(defun mer-proc-filter (proc string)
(when (string-match "^ICY Info: StreamTitle='\\(.*\\)';StreamUrl='';"
string)
(message (match-string 1 string))))
;;;###autoload ;;;###autoload
(defun metal-express-radio-start () (defun metal-express-radio-start ()
"Start listening to Metal Express Radio." "Start listening to Metal Express Radio."
(interactive) (interactive)
(async-shell-command (let ((proc (start-process "metalexpress" "*Metal Express Radio*"
(concat "mplayer " metal-express-radio-playlist-url) "mplayer" metal-express-radio-playlist-url)))
"*Metal Express Radio*")) (set-process-filter proc #'mer-proc-filter)))
(defun metal-express-radio-stop () (defun metal-express-radio-stop ()
"Stop listening to Metal Express Radio." "Stop listening to Metal Express Radio."