How do I get the track info?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I get the track info?

edgar
Hello,

I would like to know how to show "Tilte - Artist" in my modeline,
please. Right now, I can only get the file name

I am using
     GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
of 2020-05-19
     EMMS 5.42 (from MELPA)

Thanks


I am using

#+begin_example
   GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) of
2020-05-19
   EMMS 5.42 (from MELPA)
#+end_example

#+begin_src emacs-lisp
   (use-package emms
     :config
     ;; https://pastebin.com/2hFXPJ56
     (use-package emms-setup)
     (use-package emms-player-simple)
     (use-package emms-source-file)
     (use-package emms-source-playlist)
     (emms-all)
     (setq emms-seek-seconds 5
           emms-player-list '(emms-player-mpv)
           emms-show-format "♪ %s"
           emms-source-file-default-directory "~/Music/"
           emms-info-asynchronously t))
#+end_src

-------------------------------------------------
This free account was provided by VFEmail.net - report spam to [hidden email]
 
ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

Reply | Threaded
Open this post in threaded view
|

Re: How do I get the track info?

Yoni Rabkin-2
[hidden email] writes:

> Hello,
>
> I would like to know how to show "Tilte - Artist" in my modeline,
> please. Right now, I can only get the file name
>
> I am using
>      GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
> of 2020-05-19
>      EMMS 5.42 (from MELPA)

You need to configure an info source; a backend that Emms can use to get
track info
(https://www.gnu.org/software/emms/manual/#Track-Information).

If MELPA doesn't provide emms-print-metadata, you can get a copy of it
and install it with:

git clone https://git.savannah.gnu.org/git/emms.git
cd emms
make emms-print-metadata
sudo cp src/emms-print-metadata /usr/local/bin/
cd ..
rm -R emms

(thank you to Peter Prevos for the above)

You can also the tinytag module shipped with Emms 5.42. First install
tinytag with something like:

$ pip install tinytag

...then in emacs:

(setq emms-info-functions '(emms-info-tinytag))

Hope this helps.

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

Reply | Threaded
Open this post in threaded view
|

Re: How do I get the track info?

Yoni Rabkin-2
In reply to this post by edgar
Edgar Lux <[hidden email]> writes:

> FYI, this is what I have in my configuration file to test
>
> (require 'package)
> (setq package-archives nil)
> (package-initialize)
>
> (add-to-list 'load-path "path-to-emms/")
> (require 'emms)
> ;; from (emms-setup) and (emms-minimalistic)
> ;; see also https://pastebin.com/2hFXPJ56
> (require 'emms-source-file)
> (require 'emms-source-playlist)
> (require 'emms-player-simple)
> (require 'emms-player-mpv)
> (require 'emms-mark)
> (require 'emms-playing-time)
> (require 'emms-mode-line)
>
> (require 'emms-info-libtag)
> (setq emms-info-libtag-program-name
>       "path-to-emms/emms-print-metadata"
>       emms-info-functions '(emms-info-libtag))
>
> (setq emms-seek-seconds 5
>       emms-player-list '(emms-player-mpv)
>       emms-source-file-default-directory "~/Music/"
>       emms-info-asynchronously t)
>
> (setq emms-playlist-default-major-mode 'emms-playlist-mode)
> (emms-mode-line 1)
> (emms-mode-line-blank)
> (emms-playing-time 1)

I paired your config down to the shortest config that will make Emms
display info in the playlist buffer and the mode-line while loading the
bits you've chosen. I started Emacs with -q and then loaded this:

(package-initialize)
(require 'emms-player-mpv)
(require 'emms-playing-time)
(require 'emms-mode-line)
(require 'emms-info-libtag)
(emms-all)
(setq emms-info-libtag-program-name "/home/yrk/devel/emms/src/emms-print-metadata"
      emms-info-functions '(emms-info-libtag)
      emms-player-list '(emms-player-mpv)
      emms-source-file-default-directory "~/Music/")

That should work fine. The line where we set
`emms-info-libtag-program-name' can also be done away with if you've
installed emms-print-metadata into your path.


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

Reply | Threaded
Open this post in threaded view
|

Re: How do I get the track info?

Edgar Lux
Yay! it works. I made it even shorter (emms-all loads really everything). Thanks!

#+begin_src emacs-lisp
  (package-initialize)
  (emms-all)
  (setq emms-info-libtag-program-name "/home/yrk/devel/emms/src/emms-print-metadata"
        emms-info-functions '(emms-info-libtag)
        emms-player-list '(emms-player-mpv)
        emms-source-file-default-directory "~/Music/")
#+end_src

> ----------------------------------------
> From: Yoni Rabkin <[hidden email]>
> Sent: Tue Sep 01 14:36:42 CEST 2020
> To: Edgar Lux <[hidden email]>
> Cc: <[hidden email]>
> Subject: Re: How do I get the track info?
>
>
> Edgar Lux <[hidden email]> writes:
>
> > FYI, this is what I have in my configuration file to test
> >
> > (require 'package)
> > (setq package-archives nil)
> > (package-initialize)
> >
> > (add-to-list 'load-path "path-to-emms/")
> > (require 'emms)
> > ;; from (emms-setup) and (emms-minimalistic)
> > ;; see also https://pastebin.com/2hFXPJ56
> > (require 'emms-source-file)
> > (require 'emms-source-playlist)
> > (require 'emms-player-simple)
> > (require 'emms-player-mpv)
> > (require 'emms-mark)
> > (require 'emms-playing-time)
> > (require 'emms-mode-line)
> >
> > (require 'emms-info-libtag)
> > (setq emms-info-libtag-program-name
> >       "path-to-emms/emms-print-metadata"
> >       emms-info-functions '(emms-info-libtag))
> >
> > (setq emms-seek-seconds 5
> >       emms-player-list '(emms-player-mpv)
> >       emms-source-file-default-directory "~/Music/"
> >       emms-info-asynchronously t)
> >
> > (setq emms-playlist-default-major-mode 'emms-playlist-mode)
> > (emms-mode-line 1)
> > (emms-mode-line-blank)
> > (emms-playing-time 1)
>
> I paired your config down to the shortest config that will make Emms
> display info in the playlist buffer and the mode-line while loading the
> bits you've chosen. I started Emacs with -q and then loaded this:
>
> (package-initialize)
> (require 'emms-player-mpv)
> (require 'emms-playing-time)
> (require 'emms-mode-line)
> (require 'emms-info-libtag)
> (emms-all)
> (setq emms-info-libtag-program-name "/home/yrk/devel/emms/src/emms-print-metadata"
>       emms-info-functions '(emms-info-libtag)
>       emms-player-list '(emms-player-mpv)
>       emms-source-file-default-directory "~/Music/")
>
> That should work fine. The line where we set
> `emms-info-libtag-program-name' can also be done away with if you've
> installed emms-print-metadata into your path.
>
>
> --
>    "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: How do I get the track info?

Edgar Lux
In reply to this post by Yoni Rabkin-2
It seems that what was missing earlier (before we added emms-all) was
(add-to-list 'emms-track-initialize-functions 'emms-info-initialize-track)
(setq emms-track-description-function 'emms-info-track-description)

I have a shorter version now (more lines, but less code than emms-all). Anyone who is interested, can see it here: https://paste.ee/p/2Xklh https://web.archive.org/web/20200901181249/https://paste.ee/p/2Xklh

> ----------------------------------------
> From: Yoni Rabkin <[hidden email]>
> Sent: Tue Sep 01 14:36:42 CEST 2020
> To: Edgar Lux <[hidden email]>
> Cc: <[hidden email]>
> Subject: Re: How do I get the track info?
>
>
> Edgar Lux <[hidden email]> writes:
>
> > FYI, this is what I have in my configuration file to test
> >
> > (require 'package)
> > (setq package-archives nil)
> > (package-initialize)
> >
> > (add-to-list 'load-path "path-to-emms/")
> > (require 'emms)
> > ;; from (emms-setup) and (emms-minimalistic)
> > ;; see also https://pastebin.com/2hFXPJ56
> > (require 'emms-source-file)
> > (require 'emms-source-playlist)
> > (require 'emms-player-simple)
> > (require 'emms-player-mpv)
> > (require 'emms-mark)
> > (require 'emms-playing-time)
> > (require 'emms-mode-line)
> >
> > (require 'emms-info-libtag)
> > (setq emms-info-libtag-program-name
> >       "path-to-emms/emms-print-metadata"
> >       emms-info-functions '(emms-info-libtag))
> >
> > (setq emms-seek-seconds 5
> >       emms-player-list '(emms-player-mpv)
> >       emms-source-file-default-directory "~/Music/"
> >       emms-info-asynchronously t)
> >
> > (setq emms-playlist-default-major-mode 'emms-playlist-mode)
> > (emms-mode-line 1)
> > (emms-mode-line-blank)
> > (emms-playing-time 1)
>
> I paired your config down to the shortest config that will make Emms
> display info in the playlist buffer and the mode-line while loading the
> bits you've chosen. I started Emacs with -q and then loaded this:
>
> (package-initialize)
> (require 'emms-player-mpv)
> (require 'emms-playing-time)
> (require 'emms-mode-line)
> (require 'emms-info-libtag)
> (emms-all)
> (setq emms-info-libtag-program-name "/home/yrk/devel/emms/src/emms-print-metadata"
>       emms-info-functions '(emms-info-libtag)
>       emms-player-list '(emms-player-mpv)
>       emms-source-file-default-directory "~/Music/")
>
> That should work fine. The line where we set
> `emms-info-libtag-program-name' can also be done away with if you've
> installed emms-print-metadata into your path.
>
>
> --
>    "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: How do I get the track info?

Edgar Lux
Hi, I created a bare-bones org-link for emms (ol-emms.el). I hope that you find it useful. It allows me to
1. store an Org link from a playlist buffer and
2. tell Org that a link should be opened with EMMS

It is most perfectible

ol-emms.el.gz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How do I get the track info?

Edgar Lux


> ----------------------------------------
> From: Edgar Lux <[hidden email]>
> Sent: Sun Sep 13 02:03:01 CEST 2020
> To: Edgar Lux <[hidden email]>, Yoni Rabkin <[hidden email]>
> Cc: <[hidden email]>
> Subject: Re: How do I get the track info?
>
>
> Hi, I created a bare-bones org-link for emms (ol-emms.el). I hope that you find it useful. It allows me to
> 1. store an Org link from a playlist buffer and
> 2. tell Org that a link should be opened with EMMS
>
> It is most perfectible

ol-emms.el.gz (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How do I get the track info?

Yoni Rabkin-2
In reply to this post by Edgar Lux
Edgar Lux <[hidden email]> writes:

> Hi, I created a bare-bones org-link for emms (ol-emms.el). I hope that you find it useful. It allows me to
> 1. store an Org link from a playlist buffer and
> 2. tell Org that a link should be opened with EMMS

Can someone who uses Org test this and provide feedback?

It isn't that installing Org and trying it myself would be hard. It is
instead that I don't use Org, am not familiar with it, and therefore I
am in a poor position to judge.

Do we need to provide integration with Org mode?

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

Reply | Threaded
Open this post in threaded view
|

Re: How do I get the track info?

Edgar Lux
Org comes pre-installed with Emacs. You can load it if you evaluate (require 'org) or run M-x org-mode (while on the *scratch* buffer). I don't know if you have the latest version of what I have, so I created a little repository. I won't be modifying this very much, but I will leave it there in case that the decision is made that EMMS should not provide links for Org.

> ----------------------------------------
> From: Yoni Rabkin <[hidden email]>
> Sent: Thu Sep 17 17:47:36 CEST 2020
> To: Edgar Lux <[hidden email]>
> Cc: <[hidden email]>
> Subject: Re: How do I get the track info?
>
>
> Edgar Lux <[hidden email]> writes:
>
> > Hi, I created a bare-bones org-link for emms (ol-emms.el). I hope that you find it useful. It allows me to
> > 1. store an Org link from a playlist buffer and
> > 2. tell Org that a link should be opened with EMMS
>
> Can someone who uses Org test this and provide feedback?
>
> It isn't that installing Org and trying it myself would be hard. It is
> instead that I don't use Org, am not familiar with it, and therefore I
> am in a poor position to judge.
>
> Do we need to provide integration with Org mode?
>
> --
>    "Cut your own wood and it will warm you twice"