emms-help
[Top][All Lists]
Advanced

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

Re: Recovering playback state of multiple playlists and over multiple se


From: Yoni Rabkin
Subject: Re: Recovering playback state of multiple playlists and over multiple sessions
Date: Wed, 20 Oct 2021 08:40:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Yuchen Pei <hi@ypei.me> writes:

> Yoni Rabkin <yoni@rabkins.net> writes:
>
>> Yuchen Pei <hi@ypei.me> writes:
>>
>>> Yoni Rabkin <yoni@rabkins.net> writes:
>>>
>>>> Yuchen Pei <hi@ypei.me> writes:
>>>>
>>>>> Yoni Rabkin <yoni@rabkins.net> writes:
>>>>>
>>>>>> Yuchen Pei <hi@ypei.me> writes:
>>>>>>
>>>>>>> I don't really save or restore emacs sessions.  This is because
>>>>>>> I
>>>>>>> have
>>>>>>> an emacsclient on all the time until an untimely death because
>>>>>>> something goes terribly wrong, and if I make it revive from
>>>>>>> that
>>>>>>> state
>>>>>>> I fear it could go into a death loop.  This is why I would
>>>>>>> rather
>>>>>>> have
>>>>>>> an emms-specific feature for this.
>>>>>>
>>>>>> We may be speaking past each other. If you don't restart emacs,
>>>>>> why
>>>>>> do
>>>>>> you need a function to save the playlist position?
>>>>>
>>>>> As I said, things can go wrong, and emacs crashes.  Sometimes
>>>>> this
>>>>> happens more often than other times.  But especially after long
>>>>> sessions of emacs is it hard to recover the position from (my)
>>>>> memory.
>>>>
>>>> This is a slightly different situation that what we've
>>>> discussed. Previously, I understood it to be merely saving
>>>> playlist
>>>> positions so that they can be restored later. But now this is
>>>> described
>>>> as a case of hardening Emms against an Emacs crash.
>>>>
>>>> Therefore, what you are describing sounds more similar to Emacs'
>>>> auto-save feature.
>>>>
>>>> What that be a good way of describing it?
>>>
>>> Thanks for clarifying.  I suppose that covers most of my usecase,
>>> though I think there's not much difference between saving and
>>> auto-saving, as the latter could be simply implemented as a
>>> run-at-times with the former if one can tolerate a bit of loss. 
>>> "Saving" is a more universal feature and probably needed by more
>>> people other than me, and I'll be content to have a "saving" which 
>>> I can use run-at-times to risk losing the bit in the time interval.
>>
>> In that case, why not solve half of your problem quickly by adding a
>> function to `emms-player-started-hook' that iterates over your
>> playlists
>> and saves them? That hook is certainly well used in Emms.
>
> Sounds good, but how do you save a playlist which also saves the track
> being played?  As an experiment, I have a playlist with some track in
> the middle currently paused.  I saved the playlist into a native
> playlist, opened a new Emacs instance and loaded the playlist from the
> saved native playlist.  It marks the first track as the current track,
> rather than the one being paused and highlighted when I saved it.

That information (and more) is already present in any `last-played'
data. It should be straightforward to compare `last-played' timestamps
and jump to the track which was played most recently.


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



reply via email to

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