Add a command to toggle pause by requesting first the server status.
This commit is contained in:
parent
e7e51bf5d3
commit
dd9c4decfb
1 changed files with 10 additions and 0 deletions
10
empc.el
10
empc.el
|
|
@ -185,12 +185,22 @@ Return nil if the line should be ignored."
|
|||
(progn
|
||||
(setq empc-default-crossfade status)
|
||||
"0"))))))))))
|
||||
(defun empc-send-pause (&optional state)
|
||||
"Send pause to the server."
|
||||
(interactive)
|
||||
(if state
|
||||
(empc-send (concat "pause " state))
|
||||
(empc-update-status '(lambda (plist)
|
||||
(if (eq (plist-get plist 'state) 'play)
|
||||
(empc-send "pause 1")
|
||||
(empc-send "pause 0"))))))
|
||||
|
||||
(define-simple-command "play")
|
||||
(define-simple-command "stop")
|
||||
(define-simple-command "next")
|
||||
(define-simple-command "previous")
|
||||
|
||||
|
||||
(define-toggle-command "consume")
|
||||
(define-toggle-command "random")
|
||||
(define-toggle-command "repeat")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue