Cosmetics.
[elisp.git] / media-mplayer.el
index 4a6209f..77f1516 100644 (file)
@@ -80,9 +80,21 @@ load Emacs less. Nil means no timing."
              ;; ----------------------------------------
 
              ("ICY Info:" .
-              (if (string-match "StreamTitle='\\([^']*\\)';" param)
-                  (message "Now in stream \"%s\"" (match-string 1 param))
-                (message "ICY Info \"%s\"" param)))
+              (progn
+                ;; (message "ICY Info \"%s\"" param)
+                (if (string-match "StreamTitle='\\([^;]*\\)';" param)
+                    (setq media/current-song-in-stream
+                          (let ((s (match-string 1 param)))
+                            (concat (if (string= s "") "<no title>" s)
+                                    " | "
+                                    ;; (current-time-string)
+                                    (format-time-string "%a %b %d %H:%M:%S")
+                                    )))
+                  (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 +191,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)))
   )