When mpd is paused or stopped, kill the streaming process

This commit is contained in:
Renaud Casenave-Péré 2013-06-14 15:36:42 +09:00
parent 4005c3fc2c
commit 076ea9d295

View file

@ -443,7 +443,8 @@ According to what is in the diff, several actions can be performed:
(setq notify '(lambda () (when (empc-playlist-songs empc-object) (setq notify '(lambda () (when (empc-playlist-songs empc-object)
(empc-echo-song))))) (empc-echo-song)))))
(empc-stream-start)) (empc-stream-start))
(setq notify '(lambda () (empc-echo-notify (symbol-name (plist-get status-diff :state))))))) (setq notify '(lambda () (empc-echo-notify (symbol-name (plist-get status-diff :state)))))
(empc-stream-stop)))
(when (or (plist-member status-diff :repeat) (plist-member status-diff :random) (when (or (plist-member status-diff :repeat) (plist-member status-diff :random)
(plist-member status-diff :single) (plist-member status-diff :consume) (plist-member status-diff :single) (plist-member status-diff :consume)
(plist-member status-diff :xfade)) (plist-member status-diff :xfade))
@ -806,6 +807,12 @@ If the stream process is killed for whatever the reason, pause mpd if possible."
(set-process-sentinel stream-process 'empc-stream-process-sentinel) (set-process-sentinel stream-process 'empc-stream-process-sentinel)
(setq empc-stream-process stream-process)))) (setq empc-stream-process stream-process))))
(defun empc-stream-stop()
"Stop the stream process."
(let ((stream-process (empc-stream empc-object)))
(when stream-process
(delete-process stream-process))))
(defun empc-playlist-mode () (defun empc-playlist-mode ()
"empc playlist mode." "empc playlist mode."
(use-local-map empc-playlist-map) (use-local-map empc-playlist-map)