:type 'float
:group 'media)
+(defcustom media/mplayer/capture-dir nil
+ "States where to save the dumped streams."
+ :type 'string
+ :group 'media)
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; It is impossible to tell mplayer to send information every time dt
(setq media/current-song-in-stream
(let ((s (match-string 1 param)))
- (concat (if (string= s "") "<no title>" s)
+ (concat (if (string= s "")
+ "<no title>"
+ ;; (encode-coding-string s 'latin-1)
+ s
+ )
" | "
(format-time-string "%a %b %d %H:%M:%S")
)
;; ----------------------------------------
("Starting"
- (media/mplayer/write "get_time_length\n"))
+ (media/mplayer/write "get_time_length\n")
+ (if media/mplayer/capture-dir (media/mplayer/write "capturing\n"))
+ )
;; ----------------------------------------
(append
'("mplayer" nil "mplayer" "-slave" "-quiet")
media/mplayer/args
- (if (string-match "\\(asx\\|m3u\\|pls\\|ram\\)$" media/mplayer/url)
+ (when (string-match "\\(asx\\|m3u\\|pls\\|ram\\)$" media/mplayer/url)
+ (if media/mplayer/capture-dir (list "-dumpfile"
+ (concat media/mplayer/capture-dir
+ "/"
+ (replace-regexp-in-string "[^a-zA-Z0-9\.]" "_" media/mplayer/url)
+ (format-time-string "-%Y-%m-%d-%H:%M:%S"))
+ "-capture"
+ "-playlist"
+ )
(list "-playlist"))
- (list (replace-regexp-in-string "^file://" "" media/mplayer/url))))
+ )
+ (list (replace-regexp-in-string "^file://" "" media/mplayer/url)))
+ )
media/mplayer/exit-type 'unknown
media/mplayer/paused nil
media/song-duration nil
(process-kill-without-query media/mplayer/process)
(media/mplayer/start-timing-requests)
(media/mplayer/write "get_time_pos\n")
-
)
(defun media/api/stop () (interactive)