From: Tim Vaughan Date: Mon, 9 Dec 2019 11:04:58 +0000 (+0100) Subject: Added track scrubbing. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=f8388195340719e1f8dcdc4988b196c48235bffa;p=emus.git Added track scrubbing. --- diff --git a/emus.el b/emus.el index 04a8e73..898b403 100644 --- a/emus.el +++ b/emus.el @@ -343,6 +343,21 @@ (interactive) (emus--play-adjacent-album t)) +(defun emus-jump (seconds) + "Jump forward in current track by SECONDS seconds." + (emus--with-library + (emus-send-cmd "jump" (format "%+ds" seconds)))) + +(defun emus-jump-10s-forward () + "Jump 10 seconds forward in current track." + (interactive) + (emus-jump 10)) + +(defun emus-jump-10s-backward () + "Jump 10 seconds backward in current track." + (interactive) + (emus-jump -10)) + (defun emus-display-status () (interactive) (emus--with-library @@ -473,6 +488,8 @@ (defun emus-play-prev-status () (interactive) (emus-play-prev) (emus-display-status)) (defun emus-play-next-album-status () (interactive) (emus-play-next-album) (emus-display-status)) (defun emus-play-prev-album-status () (interactive) (emus-play-prev-album) (emus-display-status)) +(defun emus-jump-10s-forward-status () (interactive) (emus-jump-10s-forward) (emus-display-status)) +(defun emus-jump-10s-backward-status () (interactive) (emus-jump-10s-backward) (emus-display-status)) (defun emus-centre-current-status () (interactive) (emus-centre-current) (emus-display-status)) (defvar emus-browser-mode-map @@ -487,6 +504,8 @@ (define-key map (kbd "p") 'emus-play-prev-status) (define-key map (kbd "N") 'emus-play-next-album-status) (define-key map (kbd "P") 'emus-play-prev-album-status) + (define-key map (kbd ",") 'emus-jump-10s-backward-status) + (define-key map (kbd ".") 'emus-jump-10s-forward-status) (define-key map (kbd "c") 'emus-centre-current-status) (when (fboundp 'evil-define-key*) (evil-define-key* 'motion map @@ -500,6 +519,8 @@ (kbd "p") 'emus-play-prev-status (kbd "N") 'emus-play-next-album-status (kbd "P") 'emus-play-prev-album-status + (kbd ",") 'emus-jump-10s-backward-status + (kbd ".") 'emus-jump-10s-forward-status (kbd "c") 'emus-centre-current-status)) map) "Keymap for emus.")