[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to show the metadata when listening to audio streams?
From: |
Mike Kazantsev |
Subject: |
Re: How to show the metadata when listening to audio streams? |
Date: |
Sat, 7 Aug 2021 05:10:03 +0500 |
On Fri, 06 Aug 2021 18:20:57 -0500
Rodrigo Morales <rodrigo.morales@utec.edu.pe> wrote:
> #+BEGIN_EXAMPLE
> (*track*
> (type . streamlist)
> (name . "http://www.somafm.com/beatblender.pls")
> (metadata "SomaFM: Beatblender" "http://www.somafm.com/beatblender.pls" 1
> streamlist))
> #+END_EXAMPLE
>
> =(emms-playlist-track-at (point))= is able to get the name of the stream
> because the file =~/.config/emacs/emms/streams.emms= (which is created by
> the function =emms-streams-install=) contains this metadata.
>
> * The question
>
> As I shown before in the #+BEGIN_EXAMPLE block, the URL is shown for
> each stream in the "Emms Streams" buffer. I am now wondering how I can
> show the name (which is stored in the metadata) for each stream in the
> playlist buffer.
>
> I would like to do this because I usually listen to audio streams
> using EMMS and having a custom name for each stream would make the
> playlist buffer more readable than having the URL.
I think something like this might do it:
(defun my-emms-track-desc (track)
(or
(let ((meta (emms-track-get track metadata))) (when meta (car meta)))
(emms-track-simple-description track)))
(setq emms-track-description-function 'my-emms-track-desc)
Idea there is to use first string from the "metadata" attribute that
you have attached to the track, if it's there, and otherwise just
fallback to default emms-track-simple-description generator.
--
Mike Kazantsev // fraggod.net