[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emms-help] Restore playback position

From: Yoni Rabkin
Subject: Re: [emms-help] Restore playback position
Date: Thu, 26 Oct 2017 18:26:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Pierre Neidhardt <address@hidden> writes:

> Yoni Rabkin <address@hidden> writes:
>>> I think an optional `seek-to` added to `emms-start` would solve this.
>>> Let me know.
>> I can't think of a clean way of doing that, and in any case `emms-start'
>> is just an `interactive' wrapper and would the wrong place to start
>> thinking of this.
>> ...
>> Right now I'm thinking about a function registered with
>> `emms-player-started-hook' to call seek-to.
>> If it critical that the player actually start at that time, as opposed
>> to start and then seek, it may be necessary to make a
>> `define-emms-simple-player' with the right command line stuff at process
>> call.
> I meant `emms-start' and the whole hierarchy of callees.  Which boils
> down to extending `define-emms-simple-player as you said.  That would be
> quite easy I believe.  I don't know if that would break existing
> players, but there are not that many and a global update would not be
> too demanding I guess.
> A hook would not work: when does the hook get run?  There is no way to
> know when the player is ready to seek.

How does any GUI know when the player is ready to seek? They normally

As an experiment, I added a bookmark using emms-bookmarks.el in a movie
(Backpacking the Lake District with Chris Townsend) and then:

(add-hook 'emms-player-started-hook 'emms-bookmarks-next)

Then I started the movie over and over again (mplayer as the player in
this case) and it worked every time.

I agree that emms-bookmarks is skeletal at best, but that is easy to

>> Can you describe the use case? I'm assuming this is for podcasts or
>> spoken word stuff (pop songs don't need this, and one normally doesn't
>> start in the middle of a classical movement (shudder)) I'm not doubting
>> the validity of the need for this; it's just that I would have an easier
>> time thinking about it if I knew the specific use.
> - Podcasts, audiobooks, anything in which people talk.
> - Why not classical movement?  When it's 1 hour long and you suffer an
> interuption in the middle of it, you might not want start all over
> again.
> - If a pop song gets interupted near the end, restarting from the
> beginning feels repetitive.
> - So... anything, basically.
> The point is to recover the playback gracefully (i.e. not lose the
> progress) after crashes / sudden shutdowns / restarts, e.g.  if the user
> wants to restart Emacs for whatever reason (update, messed up the global
> state, etc.).

How do you propose to remember when each track was stopped?

If it's a crash you don't have an opportunity, by definition, to know
when you stopped and that implies keeping track of the most advanced
playing time for every track played.

If it isn't a crash then we need to hash every track played and when it
was stopped. Probably removing the track from the hash when it reaches

Is that what you had in mind?

   "Cut your own wood and it will warm you twice"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]