4 Commits

8 changed files with 64 additions and 46 deletions
Split View
  1. +1
    -1
      Makefile
  2. +23
    -19
      README.org
  3. +19
    -20
      mpdel-browser.el
  4. +1
    -1
      mpdel-core.el
  5. +1
    -1
      mpdel-playlist.el
  6. +1
    -1
      mpdel-song.el
  7. +1
    -1
      mpdel-tablist.el
  8. +17
    -2
      mpdel.el

+ 1
- 1
Makefile View File

@ -14,7 +14,7 @@ makel.mk:
curl \
--fail --silent --show-error --insecure --location \
--retry 9 --retry-delay 9 \
-O https://gitlab.petton.fr/DamienCassou/makel/raw/v0.5.3/makel.mk; \
-O https://gitea.petton.fr/DamienCassou/makel/raw/v0.5.3/makel.mk; \
fi
# Include emake.mk if present


+ 23
- 19
README.org View File

@ -10,8 +10,8 @@
<img alt="MELPA" src="https://melpa.org/packages/mpdel-badge.svg"/>
</a>
<a href="https://gitlab.petton.fr/mpdel/mpdel/commits/master">
<img alt="pipeline status" src="https://gitlab.petton.fr/mpdel/mpdel/badges/master/pipeline.svg" />
<a href="https://gitea.petton.fr/mpdel/mpdel/commits/master">
<img alt="pipeline status" src="https://gitea.petton.fr/mpdel/mpdel/badges/master/pipeline.svg" />
</a>
</p>
#+END_HTML
@ -35,7 +35,7 @@ other song:
[[file:media/mpdel-song.png]]
With the additional package [[https://gitlab.petton.fr/mpdel/ivy-mpdel.git][ivy-mpdel]], you can navigate your music
With the additional package [[https://gitea.petton.fr/mpdel/ivy-mpdel.git][ivy-mpdel]], you can navigate your music
database and add songs to playlists with completion:
[[file:media/ivy-mpdel.png]]
@ -43,7 +43,7 @@ database and add songs to playlists with completion:
** Installing
Get mpdel from [[https://melpa.org/#/mpdel][melpa]] or [[https://stable.melpa.org/#/mpdel][melpa stable]]. You also need to install
[[https://gitlab.petton.fr/mpdel/libmpdel][libmpdel]].
[[https://gitea.petton.fr/mpdel/libmpdel][libmpdel]].
You need to install and (quickly) configure an [[https://www.musicpd.org/][MPD server]] if you don't
have any yet. Don't worry, that's simple and you won't regret it.
@ -69,19 +69,19 @@ The following MPDel keybindings are available globally if ~mpdel-mode~
is active:
| *Binding* | *Action* |
|-----------+---------------------------------------------------------|
| ~C-x Z SPC~ | toggle between play and pause |
| ~C-x Z M-n~ | play next song |
| ~C-x Z M-p~ | play previous song |
| ~C-x Z P~ | restart playing current song |
| ~C-x Z l~ | open the current playlist |
| ~C-x Z L~ | show stored playlists |
| ~C-x Z N~ | navigate your database from artists |
| ~C-x Z :~ | navigate your database from the browser |
| ~C-x Z v~ | view current song |
| ~C-x Z s r~ | search songs by artist name |
| ~C-x Z s l~ | search songs by album name |
| ~C-x Z s s~ | search songs by song title |
|-------------+-----------------------------------------------------------|
| ~C-x Z SPC~ | toggle between play and pause |
| ~C-x Z M-n~ | play next song |
| ~C-x Z M-p~ | play previous song |
| ~C-x Z P~ | restart playing current song |
| ~C-x Z l~ | open the current playlist |
| ~C-x Z L~ | show stored playlists |
| ~C-x Z N~ | navigate your database from artists |
| ~C-x Z :~ | navigate your database from the browser |
| ~C-x Z v~ | view current song |
| ~C-x Z s r~ | search songs by artist name |
| ~C-x Z s l~ | search songs by album name |
| ~C-x Z s s~ | search songs by song title |
| ~C-x Z f~ | go forward current song by ~mpdel-song-normal-increment~ |
| ~C-x Z F~ | go forward current song by ~mpdel-song-small-increment~ |
| ~C-x Z M-f~ | go forward current song by ~mpdel-song-large-increment~ |
@ -135,8 +135,8 @@ buffer lists songs and can be edited.
Here is a list of keybindings available for the current playlist
buffer:
| *Binding* | *Action* |
|---------+------------------------------------------|
| *Binding* | *Action* |
|-----------+------------------------------------------|
| ~C-x C-s~ | save current playlist in a new one |
| ~m~ | mark the song at point |
| ~k~ | remove marked song(s) from the playlist |
@ -186,6 +186,10 @@ or rearrange how children buffers show their contents with
~mpdel-browser-list-clean-up-function~. Please see the customization
group ~mpdel-browser~ for more details.
If you would like to use MPDel in single-buffer mode when traversing
your music collection entries, add the call
~(mpdel-enable-single-buffer)~ to your init file.
*** Communication with MPD
If you have only one MPD server, you can tell libmpdel how to


+ 19
- 20
mpdel-browser.el View File

@ -4,7 +4,7 @@
;; Author: Jose A Ortega Ruiz <jao@gnu.org>
;; Keywords: multimedia
;; Url: https://gitlab.petton.fr/mpdel/mpdel
;; Url: https://gitea.petton.fr/mpdel/mpdel
;; Package-requires: ((emacs "25.1"))
;; Version: 1.0.0
@ -132,7 +132,7 @@ orderings."
(defun mpdel-browser--buffer-name (entity)
"Return the name of a browser buffer displaying ENTITY."
(format "* %s *"
(format (if (navigel-single-buffer-app-p 'mpdel) "%s" "* %s *")
(cond ((stringp entity) entity)
((libmpdel-directory-p entity)
(file-name-nondirectory (or (libmpdel--directory-path entity) "")))
@ -200,7 +200,10 @@ This listing is constructed using `mpdel-browser-top-level-entries'."
'browser)
(navigel-method mpdel navigel-buffer-name ((_e (eql browser)))
(format "* MPDel - %s:%d *" libmpdel-hostname libmpdel-port))
(format (if (navigel-single-buffer-app-p 'mpdel)
"%s:%d"
"* MPDel - %s:%d *")
libmpdel-hostname libmpdel-port))
(navigel-method mpdel navigel-entity-buffer ((_e (eql browser)))
(navigel-buffer-name 'browser))
@ -241,33 +244,29 @@ This listing is constructed using `mpdel-browser-top-level-entries'."
(navigel-method mpdel navigel-entity-tablist-mode ((_e (eql browser)))
(mpdel-browser-mode))
(navigel-method mpdel navigel-entity-tablist-mode ((_e (eql albums)))
(mpdel-browser-mode))
(navigel-method mpdel navigel-entity-tablist-mode ((_e (eql directories)))
(mpdel-browser-mode))
(navigel-method mpdel navigel-entity-tablist-mode ((_e libmpdel-directory))
(mpdel-browser-mode))
(navigel-method mpdel navigel-entity-id ((dir libmpdel-directory))
(libmpdel--directory-path dir))
(navigel-method mpdel navigel-entity-tablist-mode ((_e (eql stored-playlists)))
(mpdel-browser-mode))
(defun mpdel-browser--entry-is-parent-directory-p (entity)
"Check whether the given ENTITY is a parent directory."
(let ((name (when (libmpdel-directory-p entity)
(libmpdel-entity-name entity))))
;; Browser buffers showing children of 'directories or the point
;; to their parent via a tablist entry called "Music directory",
;; while real directory children use the conventional "..".
(or (eql 'directories entity)
(eql 'browser entity)
(string= ".." name)
(string= "Music directory" name))))
(cl-defmethod navigel-parent-to-open (entity &context (major-mode mpdel-browser-mode))
(cl-defmethod navigel-parent-to-open (_e &context (major-mode mpdel-browser-mode))
"Find parent of ENTITY when in a buffer with MAJOR-MODE `mpdel-browser-mode'."
(cons (car (cl-find-if #'mpdel-browser--entry-is-parent-directory-p
tabulated-list-entries
:key #'car-safe))
entity))
(list (or (navigel-parent navigel-entity) 'browser)))
(cl-defmethod navigel-parent-to-open
(_e &context (major-mode mpdel-playlist-current-playlist-mode))
"Find parent of ENTITY when in a buffer with MAJOR-MODE `mpdel-playlist-current-playlist-mode'."
'(browser . current-playlist))
(define-key mpdel-core-map (kbd ":") #'mpdel-browser-open)


+ 1
- 1
mpdel-core.el View File

@ -4,7 +4,7 @@
;; Author: Damien Cassou <damien@cassou.me>
;; Keywords: multimedia
;; Url: https://gitlab.petton.fr/mpdel/mpdel
;; Url: https://gitea.petton.fr/mpdel/mpdel
;; Package-requires: ((emacs "25.1"))
;; Version: 1.0.0


+ 1
- 1
mpdel-playlist.el View File

@ -4,7 +4,7 @@
;; Author: Damien Cassou <damien@cassou.me>
;; Keywords: multimedia
;; Url: https://gitlab.petton.fr/mpdel/mpdel
;; Url: https://gitea.petton.fr/mpdel/mpdel
;; Package-requires: ((emacs "25.1"))
;; Version: 1.0.0


+ 1
- 1
mpdel-song.el View File

@ -4,7 +4,7 @@
;; Author: Damien Cassou <damien@cassou.me>
;; Keywords: multimedia
;; Url: https://gitlab.petton.fr/mpdel/mpdel
;; Url: https://gitea.petton.fr/mpdel/mpdel
;; Package-requires: ((emacs "25.1"))
;; Version: 1.0.0


+ 1
- 1
mpdel-tablist.el View File

@ -4,7 +4,7 @@
;; Author: Damien Cassou <damien@cassou.me>
;; Keywords: multimedia
;; Url: https://gitlab.petton.fr/mpdel/mpdel
;; Url: https://gitea.petton.fr/mpdel/mpdel
;; Package-requires: ((emacs "25.1"))
;; Version: 1.0.0


+ 17
- 2
mpdel.el View File

@ -1,10 +1,10 @@
;;; mpdel.el --- Play and control your MPD music -*- lexical-binding: t; -*-
;; Copyright (C) 2018-2019 Damien Cassou
;; Copyright (C) 2018-2020 Damien Cassou
;; Author: Damien Cassou <damien@cassou.me>
;; Keywords: multimedia
;; Url: https://gitlab.petton.fr/mpdel/mpdel
;; Url: https://gitea.petton.fr/mpdel/mpdel
;; Package-requires: ((emacs "25.1") (libmpdel "1.2.0") (navigel "0.7.0"))
;; Version: 1.0.0
@ -31,6 +31,7 @@
;;; Code:
(require 'navigel)
(require 'mpdel-song)
(require 'mpdel-playlist)
(require 'mpdel-tablist)
@ -64,6 +65,20 @@
:require 'mpdel
:lighter " MPDel")
;;;###autoload
(defun mpdel-enable-single-buffer ()
"Configure mpdel to reuse a single buffer when navigating or browsing."
(navigel-register-single-buffer-app 'mpdel))
;;;###autoload
(defun mpdel-pop-to-browser ()
"Pop to the MPDel buffer, reusing it if in single-buffer mode."
(interactive)
(let ((buffer (navigel-app-buffer 'mpdel)))
(if (buffer-live-p buffer)
(pop-to-buffer buffer)
(mpdel-browser-open))))
(provide 'mpdel)
;;; mpdel.el ends here


Loading…
Cancel
Save