[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emms-help] a workaround for pause, seek, etc.
From: |
William Xu |
Subject: |
Re: [emms-help] a workaround for pause, seek, etc. |
Date: |
Fri, 15 Jul 2005 13:17:14 +0800 |
On 7/15/05, Jorgen Schaefer <address@hidden> wrote:
> William Xu <address@hidden> writes:
>
> > I'd love emms someday would support pause, seek, repeat, etc, especially
> > pause, which I think is quite useful. Currently i found mplayer has a
> > '-slave' mode, with which to implement pause becomes quite easy. Hope
> > it'll be useful for some.
>
> Thanks!
>
> Emms contains code to be able to plug in code as you have written.
>
> Defining a new simple command player is easy:
>
> (define-emms-simple-player pausing-mplayer '(file url)
> (regexp-opt '(".ogg" ".mp3" ".wav" ".mpg" ".mpeg" ".wmv" ".wma"
> ".mov" ".avi" ".divx" ".ogm" ".asf" ".mkv" "http://"))
> "mplayer" "-slave")
>
> You can then add functionality to that player:
>
> (emms-player-set emms-player-pausing-mplayer
> 'pause
> 'emms-player-pausing-mplayer-pause)
> ; ^ I want a prize for that function name!
>
> Which can be used easily:
>
> (defun emms-pause ()
> "Pause the current player."
> (when emms-player-playing-p
> (funcall (emms-player-get emms-player-playing-p 'pause))))
>
> etc.
>
> The rest of the player then has to be made aware of the "paused"
> state, but emms does not care otherwise. :-)
Change as suggested(see attachment). Hmm, the design of emms is
nice and clean. btw, not only can it pause, but seek too. :-)
> > And, do you plan to add more user-level control functions? like repeat
> > current track, repeat all tracks ? These implementations would be quite
> > straightforward. I've written some myself.
>
> I haven't found the "repeat this track" one too useful. If you
> have working code, please submit it, we will add it to CVS
> (probably in a new file). :-)
Sometimes i love one song so much that i'd love to listen again and
again. :-) Codes are in the attachment.
-----
William
emms-patch.el
Description: Binary data