Rename main music hydra and move it to `db-music'
The `db-music' package is supposed to be an abstract interface to music functionality, and should thus define the main hydra for this. Moreover, the hydra should not contain „emms“ in it's name, although it's using only EMMS functions. It's not clear whether EMMS will every be replaced by some other backend, but it's nicer to have a (more or less) clear separation between user frontend and implementation backend.
This commit is contained in:
parent
fa1344bf4e
commit
dd27018420
8
init.el
8
init.el
|
@ -191,7 +191,7 @@
|
|||
(bind-key "C-c i" #'ispell-change-dictionary)
|
||||
(bind-key "C-c j" #'avy-goto-char-timer)
|
||||
(bind-key "C-c l" #'org-store-link)
|
||||
(bind-key "C-c m" #'emms-control/body)
|
||||
(bind-key "C-c m" #'music-control/body)
|
||||
(bind-key "C-c o" #'hydra-org-clock/body)
|
||||
(bind-key "C-c s" #'synonyms)
|
||||
(bind-key "C-h C-f" #'find-function)
|
||||
|
@ -2094,8 +2094,7 @@ With given ARG, display files in `db/important-document-path’."
|
|||
(use-package db-emms
|
||||
:commands (db/emms-source-file-directory-tree-find
|
||||
db/emms-track-description
|
||||
db/emms-playlist-mode-insert-track
|
||||
emms-control/body))
|
||||
db/emms-playlist-mode-insert-track))
|
||||
|
||||
(use-package helm-emms
|
||||
:pin "melpa-stable"
|
||||
|
@ -2114,7 +2113,8 @@ With given ARG, display files in `db/important-document-path’."
|
|||
"--metadata db-playlist=include")))
|
||||
:commands (db/play-auto-playlist
|
||||
db/playlist-files-from-git-annex-find
|
||||
db/play-auto-playlist-from-git-annex-find))
|
||||
db/play-auto-playlist-from-git-annex-find
|
||||
music-control/body))
|
||||
|
||||
|
||||
;; * Shells and such
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
(require 'emms-source-file)
|
||||
(require 'emms-playlist-mode)
|
||||
(require 'emms-volume)
|
||||
(require 'hydra)
|
||||
|
||||
|
||||
;; Custom file finder
|
||||
|
@ -84,9 +83,6 @@ When NO-NEWLINE is non-nil, do not insert a newline after the track."
|
|||
(unless no-newline
|
||||
(insert "\n"))))
|
||||
|
||||
|
||||
;; Hydra
|
||||
|
||||
(defun db/emms-track-status ()
|
||||
"Return string displaying status of currently played track."
|
||||
(require 'emms)
|
||||
|
@ -95,26 +91,6 @@ When NO-NEWLINE is non-nil, do not insert a newline after the track."
|
|||
(emms-playlist-current-selected-track)))
|
||||
"«nothing»"))
|
||||
|
||||
(defhydra emms-control (:color red :hint none)
|
||||
"
|
||||
Playing: %s(db/emms-track-status)
|
||||
|
||||
_n_: ?n? _p_: ?p?
|
||||
_RET_: ?RET? _M_: ?M?
|
||||
_-_: lower volume _+_: ?+?
|
||||
_P_: ?P?
|
||||
|
||||
"
|
||||
("n" emms-next "next")
|
||||
("p" emms-previous "previous")
|
||||
("RET" emms-pause "play/pause")
|
||||
("s" emms-show "show title")
|
||||
("-" emms-volume-lower "lower volume")
|
||||
("+" emms-volume-raise "raise volume")
|
||||
("M" emms "show playlist")
|
||||
("P" (db/play-auto-playlist)
|
||||
"Play automatically generated playlist"))
|
||||
|
||||
|
||||
;; End
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
(require 'seq)
|
||||
(require 'emms)
|
||||
(require 'emms-source-file)
|
||||
(require 'hydra)
|
||||
(require 'db-emms)
|
||||
|
||||
(defgroup db-music nil
|
||||
"General configurations for music-related functionality."
|
||||
|
@ -91,6 +93,26 @@ See `db/playlist-files-from-git-annex-find’ for more details."
|
|||
(db/-emms-playlist-from-files
|
||||
(call-interactively #'db/playlist-files-from-git-annex-find)))
|
||||
|
||||
(defhydra music-control (:color red :hint none)
|
||||
"
|
||||
Playing: %s(db/emms-track-status)
|
||||
|
||||
_n_: ?n? _p_: ?p?
|
||||
_RET_: ?RET? _M_: ?M?
|
||||
_-_: lower volume _+_: ?+?
|
||||
_P_: ?P?
|
||||
|
||||
"
|
||||
("n" emms-next "next")
|
||||
("p" emms-previous "previous")
|
||||
("RET" emms-pause "play/pause")
|
||||
("s" emms-show "show title")
|
||||
("-" emms-volume-lower "lower volume")
|
||||
("+" emms-volume-raise "raise volume")
|
||||
("M" emms "show playlist")
|
||||
("P" (db/play-auto-playlist)
|
||||
"Play automatically generated playlist"))
|
||||
|
||||
(provide 'db-music)
|
||||
|
||||
;;; db-music ends here
|
||||
|
|
Loading…
Reference in New Issue