[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Grid thumbnail arrangement of a playlist
From: |
Yuchen Pei |
Subject: |
Re: Grid thumbnail arrangement of a playlist |
Date: |
Fri, 26 Nov 2021 11:52:07 +1100 |
User-agent: |
mu4e 1.4.13; emacs 27.2 |
I'd like to report what I've done regarding this, which also
serves as a "bookmark", in case I shelf it for a while.
Yoni Rabkin <yoni@rabkins.net> writes:
Yuchen Pei <ycp@gnu.org> writes:
With this one can listen to radio or watch TV with emms with a
nicer
interface.
That's a subjective statement. For me, the purely textual
interface of
Emms' playlist is an advantage and my preference.
So kind of like image-dired thumbnail mode.
Never used it, but I can readily imagine what it probably looks
like.
emms can already play url streams, so that's not a problem.
I imagine the change could be as simple as
1. representing a track by an image, or a default image if none
is
specified
I have more or less implemented a way to do this (sans the default
image part), by adding a display text property in (defun
emms-playlist-mode-insert-track (track &optional no-newline):
modified emms-playlist-mode.el
@@ -470,9 +470,15 @@ This preserves the current EMMS buffer."
When NO-NEWLINE is non-nil, do not insert a newline after the
track."
(emms-playlist-ensure-playlist-buffer)
(emms-with-inhibit-read-only-t
- (insert (emms-propertize (emms-track-force-description track)
- 'emms-track track
- 'face 'emms-playlist-track-face))
+ (if (emms-track-get track 'thumbnail)
+ (insert (emms-propertize
+ (emms-track-force-description track)
+ 'emms-track track
+ 'face 'emms-playlist-track-face
+ 'display (create-image (emms-track-get track
'thumbnail))))
+ (insert (emms-propertize (emms-track-force-description
track)
+ 'emms-track track
+ 'face 'emms-playlist-track-face)))
(when (emms-playlist-selected-track-at-p)
(emms-playlist-mode-overlay-selected))
(if no-newline
You can try it out by adding a thumbnail text property a string of
path to the image file.
2. instead of a list of things representing tracks, display
them in a
grid, and the selection can move horizontally as well as
vertically
This one is harder to do. To get a horizontal play list of
tracks, one could insert a space after the track when inserting a
track to a playlist, i.e. in (defun
emms-playlist-mode-insert-track (track &optional no-newline):
modified emms-playlist-mode.el
@@ -475,7 +475,8 @@ When NO-NEWLINE is non-nil, do not insert a
newline after the track."
'face 'emms-playlist-track-face))
(when (emms-playlist-selected-track-at-p)
(emms-playlist-mode-overlay-selected))
- (unless no-newline
+ (if no-newline
+ (insert " ")
(insert "\n"))))
(defun emms-playlist-mode-update-track-function ()
What remains is to turn it into a grid i.e. adding tracks
horizontally *and* vertically.
I would be interested in implementing it.
What do you think?
I see no reason why not. It could be called
emms-browser-tiled.el or
similar, since it is conceptually a type of browser and would
probably
lean on browser code. Please feel free to add a branch on the
Savannah
repo for it.
Thanks. So far it looks to me like one should reuse the existing
playlist code, which is why I haven't created a new
emms-browser-tiled.el. It is still WIP so I'm not sure if I
should push it to a branch.
--
Best,
Yuchen
PGP Key: 47F9 D050 1E11 8879 9040 4941 2126 7E93 EF86 DFD0
<https://ypei.me/assets/ypei-pubkey.txt>
signature.asc
Description: PGP signature