all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#28465] [PATCH] emacs-emms: Fix metadata retrieval for MP3 and FLAC files
@ 2017-09-14 20:14 Maxim Cournoyer
  2017-09-15 14:49 ` bug#28465: " Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Maxim Cournoyer @ 2017-09-14 20:14 UTC (permalink / raw)
  To: 28465

[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

Hi,

This enhances our emacs-emms package so that it can retrieve the
metadata from FLAC and MP3 files. It also references GNU find
explicitly.

Here's how I tested it:

1. Backup (rename) any existing ~/.emacs.d/emms directory to get rid of
any cached playlist.
2. Make sure you have a collections of a few FLAC, Ogg and MP3 files
under ~/Music.
3. Add the following config to your .emacs file:
--8<---------------cut here---------------start------------->8---
;;; EMMS
(require 'emms-info-metaflac)
(require 'emms-setup)
(emms-all)
(emms-default-players)
(add-to-list 'emms-info-functions #'emms-info-metaflac)
(setq emms-source-file-directory-tree-function
      #'emms-source-file-directory-tree-find)
(setq emms-source-file-default-directory "~/Music/")
--8<---------------cut here---------------end--------------->8---
4. With the patch applied, run:
--8<---------------cut here---------------start------------->8---
./pre-inst-env guix environment --pure --ad-hoc emacs emacs-emms
emacs
--8<---------------cut here---------------end--------------->8---
5. Create the playlist from your default music directory:
M-x emms-add-directory-tree RET ~/Music RET
6. Finally, lauch EMMS with M-x emms and observe that the playlist was
correctly generated based on the files' metadata.

Thank you,

Maxim

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-emacs-emms-Fix-metadata-retrieval-for-MP3-and-FL.patch --]
[-- Type: text/x-patch, Size: 2752 bytes --]

From fcda96d1469864678ab1f24ec7ba8ee3fa8d28b7 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Wed, 13 Sep 2017 17:13:19 -0400
Subject: [PATCH] gnu: emacs-emms: Fix metadata retrieval for MP3 and FLAC
 files.

* gnu/packages/emacs.scm (emacs-emms): Reference find, mpg321 and metaflac by
their complete file path.
[inputs]: Add flac.
---
 gnu/packages/emacs.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 5d9fd728a..784d8798b 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -840,6 +840,7 @@ provides an optional IDE-like error list.")
          (replace 'configure
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out     (assoc-ref outputs "out"))
+                   (flac    (assoc-ref inputs "flac"))
                    (vorbis  (assoc-ref inputs "vorbis-tools"))
                    (alsa    (assoc-ref inputs "alsa-utils"))
                    (mpg321  (assoc-ref inputs "mpg321"))
@@ -862,6 +863,9 @@ provides an optional IDE-like error list.")
                  (substitute* "emms-player-simple.el"
                    (("\"ogg123\"")
                     (string-append "\"" vorbis "/bin/ogg123\"")))
+                 (substitute* "emms-player-simple.el"
+                   (("\"mpg321\"")
+                    (string-append "\"" mpg321 "/bin/mpg321\"")))
                  (emacs-substitute-variables "emms-info-ogginfo.el"
                    ("emms-info-ogginfo-program-name"
                     (string-append vorbis "/bin/ogginfo")))
@@ -871,6 +875,11 @@ provides an optional IDE-like error list.")
                  (emacs-substitute-variables "emms-info-mp3info.el"
                    ("emms-info-mp3info-program-name"
                     (string-append mp3info "/bin/mp3info")))
+                 (emacs-substitute-variables "emms-info-metaflac.el"
+                   ("emms-info-metaflac-program-name"
+                    (string-append flac "/bin/metaflac")))
+                 (emacs-substitute-variables "emms-source-file.el"
+                   ("emms-source-file-gnu-find" (which "find")))
                  (substitute* "emms-volume-amixer.el"
                    (("\"amixer\"")
                     (string-append "\"" alsa "/bin/amixer\"")))
@@ -896,6 +905,7 @@ provides an optional IDE-like error list.")
     (native-inputs `(("emacs" ,emacs-minimal)    ;for (guix build emacs-utils)
                      ("texinfo" ,texinfo)))
     (inputs `(("alsa-utils" ,alsa-utils)
+              ("flac" ,flac)            ;for metaflac
               ("vorbis-tools" ,vorbis-tools)
               ("mpg321" ,mpg321)
               ("taglib" ,taglib)
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#28465: [PATCH] emacs-emms: Fix metadata retrieval for MP3 and FLAC files
  2017-09-14 20:14 [bug#28465] [PATCH] emacs-emms: Fix metadata retrieval for MP3 and FLAC files Maxim Cournoyer
@ 2017-09-15 14:49 ` Ludovic Courtès
  2017-09-15 22:20   ` [bug#28465] " Maxim Cournoyer
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2017-09-15 14:49 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 28465-done

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

> This enhances our emacs-emms package so that it can retrieve the
> metadata from FLAC and MP3 files. It also references GNU find
> explicitly.

Nice!

> Here's how I tested it:

I didn’t go through this procedure, but I trust you (and I’ll quickly
notice if something goes wrong ;-)).

> From fcda96d1469864678ab1f24ec7ba8ee3fa8d28b7 Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
> Date: Wed, 13 Sep 2017 17:13:19 -0400
> Subject: [PATCH] gnu: emacs-emms: Fix metadata retrieval for MP3 and FLAC
>  files.
>
> * gnu/packages/emacs.scm (emacs-emms): Reference find, mpg321 and metaflac by
> their complete file path.
> [inputs]: Add flac.

Applied, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#28465] [PATCH] emacs-emms: Fix metadata retrieval for MP3 and FLAC files
  2017-09-15 14:49 ` bug#28465: " Ludovic Courtès
@ 2017-09-15 22:20   ` Maxim Cournoyer
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2017-09-15 22:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28465-done

ludo@gnu.org (Ludovic Courtès) writes:

>> * gnu/packages/emacs.scm (emacs-emms): Reference find, mpg321 and metaflac by
>> their complete file path.
>> [inputs]: Add flac.
>
> Applied, thanks!
>
> Ludo’.

Thanks Ludovic, that was quick!

Maxim

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-15 22:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-14 20:14 [bug#28465] [PATCH] emacs-emms: Fix metadata retrieval for MP3 and FLAC files Maxim Cournoyer
2017-09-15 14:49 ` bug#28465: " Ludovic Courtès
2017-09-15 22:20   ` [bug#28465] " Maxim Cournoyer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.