Reshaped the display of the ICY information.
[elisp.git] / media-mplayer.el
index a6cd0e9..fbcd87a 100644 (file)
@@ -80,9 +80,14 @@ 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))
-                (message "ICY Info \"%s\"" param)))
+              (progn
+                (if (string-match "StreamTitle='\\([^;]*\\)';" param)
+                    (setq media/current-song-in-stream (concat (match-string 1 param) " | " (current-time-string)))
+                  (setq media/current-song-in-stream nil)
+                  (message "ICY Info \"%s\"" param))
+                (if (and media/current-song-in-stream media/current-information)
+                    (media/show-current-information)))
+              )
 
              ;; ----------------------------------------
 
@@ -179,7 +184,8 @@ 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))))
+      )
     (setq media/mplayer/buffer (substring media/mplayer/buffer start)))
   )