Reshaped the display of the ICY information.
[elisp.git] / media-mplayer.el
index cdff4a0..fbcd87a 100644 (file)
@@ -80,9 +80,14 @@ load Emacs less. Nil means no timing."
              ;; ----------------------------------------
 
              ("ICY Info:" .
-              (if (string-match "StreamTitle='\\([^;]*\\)';" param)
-                  (setq media/mplayer/current-stream-song (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)))
+              )
 
              ;; ----------------------------------------
 
@@ -180,11 +185,6 @@ load Emacs less. Nil means no timing."
       (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))))
-
-      (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)))
   )
@@ -225,7 +225,6 @@ 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
         ))