From 3c26763dc6b20d01596fdf7ed9a608b126603ff8 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 4 Jun 2021 18:40:25 +0100 Subject: mpc nits --- init.org | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'init.org') diff --git a/init.org b/init.org index dfb1c35..a993e58 100644 --- a/init.org +++ b/init.org @@ -2937,22 +2937,24 @@ (defvar jao-mopidy-port 6669) (jao-mpc-setup jao-mopidy-port) + (defun jao-mpc-pport () + (when (jao-mpc--playing-p jao-mopidy-port) jao-mopidy-port)) + (defmacro jao-defun-play (name &optional mpc-name) `(defun ,(intern (format "jao-player-%s" name)) () (interactive) - (,(intern (format "jao-mpc-%s" (or mpc-name name))) - (when (jao-mpc--playing-p jao-mopidy-port) - jao-mopidy-port)))) + (,(intern (format "jao-mpc-%s" (or mpc-name name))) (jao-mpc-pport)))) (jao-defun-play toggle) (jao-defun-play next) (jao-defun-play previous) (jao-defun-play stop) - (jao-defun-play seek) (jao-defun-play echo echo-current) (jao-defun-play list show-playlist) (jao-defun-play info lyrics-track-data) + (defun jao-player-seek (delta) (jao-mpc-seek delta (jao-mpc-pport))) + (defalias 'jao-player-browse 'jao-mpc-show-albums) (defalias 'jao-player-connect 'jao-mpc-connect) (defalias 'jao-player-play 'jao-mpc-play) @@ -3005,10 +3007,11 @@ (global-map "s-m" :color blue :quit-key "q") ("Play" (("m" jao-player-toggle "toggle") - ("s" (espotify-play-pause) "spotify") ("n" jao-player-next "next") ("p" jao-player-previous "previous") - ("f" (jao-player-seek 10) "seek fwd" :color red) + ("s" (espotify-play-pause) "toggle spotify")) + "Seek" + (("f" (jao-player-seek 10) "seek fwd" :color red) ("F" (jao-player-seek -10) "seek bwd" :color red)) "Browse" (("b" jao-player-browse "browse") -- cgit v1.2.3