[Top][All Lists]

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

Re: Adding lisp functions to the playlist

From: Yoni Rabkin
Subject: Re: Adding lisp functions to the playlist
Date: Tue, 07 Jun 2022 10:43:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Alex Griffin <a@ajgrf.com> writes:

> “Yoni Rabkin” <yoni@rabkins.net> writes:
>> However, it should come with appropriate warnings and
>> protections. Otherwise, if someone has an “action” track which reboots
>> the machine, and they hit emms-shuffle and play… emms-actions.el will
>> have to provide ample protection from surprising the user.
>> Also, you’d need to make sure that the cache and similar functionality
>> isn’t broken by coming across an action track.
> Maybe users should be prompted to just remove all actions from the
> playlist when they shuffle, since the whole point here is to schedule
> actions to run based on upcoming songs, which you can’t do once it’s
> randomized.

I'm calling these "track actions" for now.

The more I think about it, the less sense it makes to have track actions
as independent tracks in the playlist. This is because we would be
recreating a kludgy, line-by-line version of the lisp interpreter.

Instead, I think that track actions should be functions which are part
of a particular track's data structure.

>> Another idea is to add a property such as `before-action’ and
>> `after-action’ to any track, which store a function, and have
>> emms-action.el funcall that. This is already pretty close to hooks, but
>> track-specific.
>> What do you think?
> That would work too, but I’d want some visual indicator that a track
> has actions associated with it. I don’t like the idea of invisible
> actions in my playlist.

We'd simply add a %-sequence to the `emms-track-description-function'
control string to format track actions.

>> Sounds like an interesting idea. Perhaps call it emms-actions.el? It
>> would entail adding a new track type. It might look something like this:
>> […]
> Thanks, that’s really helpful! I’m not sure when I’ll find time to
> write this (especially since I’m preoccupied with Emacs bankruptcy at
> the moment), but I’m definitely motivated to find an easy way to queue
> actions based on my emms playlist. I’ll be back with more questions
> and/or updates.

Excellent. I'll have a go as well when I get time, just in order to get
my head around what this would look like.

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

reply via email to

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