From: Francois Fleuret Date: Tue, 10 Mar 2015 11:23:09 +0000 (+0100) Subject: Displays the song's name after the stream actually starts playing. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=5c380b2ce1a11b3ac2289eddc5e907372a7c0a97;p=elisp.git Displays the song's name after the stream actually starts playing. --- diff --git a/media-mplayer.el b/media-mplayer.el index a6cd0e9..dd953be 100644 --- a/media-mplayer.el +++ b/media-mplayer.el @@ -81,7 +81,7 @@ load Emacs less. Nil means no timing." ("ICY Info:" . (if (string-match "StreamTitle='\\([^']*\\)';" param) - (message "Now in stream (%s) \"%s\"" (current-time-string) (match-string 1 param)) + (setq media/mplayer/current-stream-song (match-string 1 param)) (message "ICY Info \"%s\"" param))) ;; ---------------------------------------- @@ -179,7 +179,13 @@ load Emacs less. Nil means no timing." (setq start (1+ (match-end 1))) (let ((line (match-string 1 media/mplayer/buffer))) (when (string-match "^\\(AUDIO:\\|Exiting...\\|Starting\\|ANS_LENGTH\\|ANS_TIME_POSITION\\|Cache fill:\\|ICY Info:\\) *\\(.*\\)$" line) - (media/mplayer/filter-subfunctions (match-string 1 line) (match-string 2 line))))) + (media/mplayer/filter-subfunctions (match-string 1 line) (match-string 2 line)))) + + (when (and media/mplayer/current-stream-song media/current-information) + (message "Now in stream (%s) \"%s\"" + (current-time-string) media/mplayer/current-stream-song) + (setq media/mplayer/current-stream-song nil)) + ) (setq media/mplayer/buffer (substring media/mplayer/buffer start))) ) @@ -219,6 +225,7 @@ load Emacs less. Nil means no timing." media/mplayer/paused nil media/song-duration nil media/song-current-time nil + media/mplayer/current-stream-song nil media/mplayer/cumulated-duration 0 media/mplayer/last-current-time nil ))