X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=media-mplayer.el;h=77f15169f047bc6316a43fc4e463a976d6cce424;hb=1ecbbd03909c6f7dda43117d8e8054a39427cb61;hp=da6d8df1eb2e80f3367767adc9c3312c444694d3;hpb=3771096a125c7cff7216ca61ce51b2cda5a7aca1;p=elisp.git diff --git a/media-mplayer.el b/media-mplayer.el index da6d8df..77f1516 100644 --- a/media-mplayer.el +++ b/media-mplayer.el @@ -18,8 +18,8 @@ ;; Contact for comments & bug reports ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Is it me, or the slave mode of mplayer is ugly to parse ? Did I -;; miss something ? +;; Is it me, or the slave mode of mplayer is ugly to parse? Did I miss +;; something? (defcustom media/mplayer/args nil "List of arguments for mplayer." @@ -68,9 +68,9 @@ load Emacs less. Nil means no timing." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun media/mplayer/filter-subfunctions (cmd param) - ;; (unless (string= cmd "A:") - ;; (message "cmd=%s param=%s" cmd param) - ;; ) + ;; (unless (string= cmd "A:") + ;; (message "cmd=%s param=%s" cmd param) + ;; ) (eval (cdr (assoc cmd @@ -79,6 +79,25 @@ load Emacs less. Nil means no timing." ;; ---------------------------------------- + ("ICY Info:" . + (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 "") "" 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))) + ) + + ;; ---------------------------------------- + ("ANS_LENGTH" . (setq media/song-duration @@ -171,8 +190,9 @@ load Emacs less. Nil means no timing." (string-match "\\(.*\\)[\n ]+" media/mplayer/buffer start)) (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:\\) *\\(.*\\)$" line) - (media/mplayer/filter-subfunctions (match-string 1 line) (match-string 2 line))))) + (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)))) + ) (setq media/mplayer/buffer (substring media/mplayer/buffer start))) )