diff --git a/empc.el b/empc.el index 0f9dadb..5011931 100644 --- a/empc.el +++ b/empc.el @@ -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) (empc-echo-song))))) (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) (plist-member status-diff :single) (plist-member status-diff :consume) (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) (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 () "empc playlist mode." (use-local-map empc-playlist-map)