[Music] Move customizable variables into db-music.el
This commit is contained in:
parent
402bfc7643
commit
c309cf7917
14
init.el
14
init.el
|
@ -2145,23 +2145,11 @@ search commands like `db/helm-shortcuts’."
|
|||
(require 'helm-adaptive)))
|
||||
|
||||
(use-package db-music
|
||||
:init (setq db/playlist-play-function #'db/play-playlist-from-git-annex-find)
|
||||
:commands (db/play-playlist-from-cache
|
||||
db/play-playlist-from-git-annex-find
|
||||
db/update-playlist-from-directory))
|
||||
|
||||
(defcustom db/playlist-play-function #'db/play-playlist-from-cache
|
||||
"Function to use to automatically generate playlists"
|
||||
:group 'personal-settings
|
||||
:type 'function)
|
||||
|
||||
(defcustom db/playlist nil
|
||||
"List of songs to include in a random playlist."
|
||||
:group 'personal-settings
|
||||
:type '(alist :value-type (choice (const :tag "Undecided" :undecided)
|
||||
(const :tag "Include" :include)
|
||||
(const :tag "Exclude" :exclude))
|
||||
:key-type file))
|
||||
|
||||
|
||||
;; * Shells and such
|
||||
|
||||
|
|
|
@ -130,7 +130,10 @@ _RET_: ?RET? _M_: ?M?
|
|||
("-" emms-volume-lower "lower volume")
|
||||
("+" emms-volume-raise "raise volume")
|
||||
("M" emms "show playlist")
|
||||
("P" (funcall db/playlist-play-function)
|
||||
("P" (lambda ()
|
||||
(interactive)
|
||||
(require 'db-music)
|
||||
(call-interactively db/playlist-play-function))
|
||||
"Play automatically generated playlist"))
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,25 @@
|
|||
(require 'dash)
|
||||
(require 'emms)
|
||||
|
||||
(defgroup db-music nil
|
||||
"General configurations for music-related functionality."
|
||||
:prefix "db-music"
|
||||
:group 'convenience
|
||||
:tag "db-music")
|
||||
|
||||
(defcustom db/playlist-play-function #'db/play-playlist-from-cache
|
||||
"Function to use to automatically generate playlists"
|
||||
:group 'db-music
|
||||
:type 'function)
|
||||
|
||||
(defcustom db/playlist nil
|
||||
"List of songs to include in a random playlist."
|
||||
:group 'db-music
|
||||
:type '(alist :value-type (choice (const :tag "Undecided" :undecided)
|
||||
(const :tag "Include" :include)
|
||||
(const :tag "Exclude" :exclude))
|
||||
:key-type file))
|
||||
|
||||
(defun db/-emms-playlist-from-files (files)
|
||||
"Generate EMMS playlist from FILES.
|
||||
|
||||
|
|
Loading…
Reference in New Issue