Replace empc-send-pause' with empc-toggle-pause'.
uses the new macro `empc-with-updated-status' and starts the streaming process upon success.
This commit is contained in:
parent
0fae4b3bba
commit
4ff4ce020c
1 changed files with 7 additions and 7 deletions
14
empc.el
14
empc.el
|
|
@ -192,15 +192,15 @@ Return nil if the line is not of the form \"key: value\"."
|
|||
(setq empc-default-crossfade status)
|
||||
"0"))))))))))
|
||||
|
||||
(defun empc-send-pause (&optional state)
|
||||
"Send pause to the server."
|
||||
(defun empc-toggle-pause (&optional state)
|
||||
"Toggle pause."
|
||||
(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"))))))
|
||||
(empc-send (concat "pause " (int-to-string state)))
|
||||
(empc-with-updated-status status
|
||||
(if (eq (plist-get status 'state) 'play)
|
||||
(empc-send "pause 1")
|
||||
(empc-send "pause 0" 'empc-stream-start)))))
|
||||
|
||||
(define-simple-command "play")
|
||||
(define-simple-command "stop")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue