From 19524caf26e674c7d24180edf5b2d45515148f1a Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 27 Nov 2012 11:12:33 +0100 Subject: [PATCH] .emacs.d/site-lisp/metalexpress.el --- .emacs.d/site-lisp/metalexpress.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.emacs.d/site-lisp/metalexpress.el b/.emacs.d/site-lisp/metalexpress.el index 9d57c19..ef67d83 100644 --- a/.emacs.d/site-lisp/metalexpress.el +++ b/.emacs.d/site-lisp/metalexpress.el @@ -32,13 +32,18 @@ "http://usa7-vn.mixstream.net/listen/8248.m3u" "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 (defun metal-express-radio-start () "Start listening to Metal Express Radio." (interactive) - (async-shell-command - (concat "mplayer " metal-express-radio-playlist-url) - "*Metal Express Radio*")) + (let ((proc (start-process "metalexpress" "*Metal Express Radio*" + "mplayer" metal-express-radio-playlist-url))) + (set-process-filter proc #'mer-proc-filter))) (defun metal-express-radio-stop () "Stop listening to Metal Express Radio."