[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emms-help] Re: re-write of emms-stream-info.el
From: |
Andy Stewart |
Subject: |
[emms-help] Re: re-write of emms-stream-info.el |
Date: |
Thu, 25 Dec 2008 08:52:52 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
Hi yrk,
Yoni Rabkin <address@hidden> writes:
> Hello,
>
> I've just pushed a complete re-write of emms-stream-info.el. The new
> version uses either VLC or mplayer as a backend process to read the
> stream information instead of trying to do everything inside Emacs. As a
> result reading stream information is faster (especially the mplayer
> backend), more reliable, the file shrunk from 740+ lines to 110+ lines
> and when it fails it isn't my fault anymore.
>
> There are still some rough edges, so please comment if this breaks
> anything for you.
Yep, i have similar emms code mplayer stream use mplayer.
Below is my code:
,----
| (defun emms-stream-play ()
| "Play stream"
| (interactive)
| (let* ((line (or (get-text-property (point) 'emms-stream)
| (progn
| (goto-char (or (previous-single-property-change
| (point) 'emms-stream)
| (point-min)))
| (goto-char (or (previous-single-property-change
| (point) 'emms-stream)
| (point-min)))
| (get-text-property (point) 'emms-stream))
| (error "No stream found at point")))
| (url (emms-stream-url line)))
| (when url
| (emms-stop)
| (shell-command-execute "killall mplayer")
| (sit-for 1)
| (shell-command-execute "mplayer -playlist" url)
| (message "Loading stream from %s ..." url)
| )))
|
| (defun shell-command-execute (cmd &rest arg-list)
| "Exectue shell command asynchronously.
| Argument CMD the main command.
| Optional argument ARG-LIST command arguments."
| (interactive)
| (let* (arg-element arg)
| (dolist (arg-element arg-list)
| (setq arg (concat arg " " arg-element)))
| (shell-command-asynchronously (concat cmd arg))))
|
| (defun shell-command-asynchronously (cmd)
| "Exectute shell command asynchronously.
| Argument CMD the main command."
| (start-process-shell-command cmd nil cmd))
|
`----
Enjoy!
-- Andy