From: Christophe Rhodes Date: Mon, 24 Mar 2014 21:29:46 +0000 (+0000) Subject: we might not always get a squeeze-playerid property X-Git-Url: http://christophe.rhodes.io/gitweb/?a=commitdiff_plain;h=ac46829f42f950bc74751e458646c708b3616d6c;p=squeeze-el.git we might not always get a squeeze-playerid property Don't send a player request with nil as the mac address --- diff --git a/squeeze.el b/squeeze.el index 0b637ad..95bfdf1 100644 --- a/squeeze.el +++ b/squeeze.el @@ -169,27 +169,31 @@ (interactive) (unless id (setq id (get-text-property (point) 'squeeze-playerid))) - (comint-send-string (get-buffer-process "*squeeze*") (format "%s power ?\n" id))) + (when id + (comint-send-string (get-buffer-process "*squeeze*") (format "%s power ?\n" id)))) (defun squeeze-control-volume-up (&optional id inc) (interactive) (unless inc (setq inc 5)) (unless id (setq id (get-text-property (point) 'squeeze-playerid))) - (comint-send-string (get-buffer-process "*squeeze*") (format "%s mixer volume %+d\n" id inc))) + (when id + (comint-send-string (get-buffer-process "*squeeze*") (format "%s mixer volume %+d\n" id inc)))) (defun squeeze-control-volume-down (&optional id inc) (interactive) (unless inc (setq inc 5)) (unless id (setq id (get-text-property (point) 'squeeze-playerid))) - (comint-send-string (get-buffer-process "*squeeze*") (format "%s mixer volume %+d\n" id (- inc)))) + (when id + (comint-send-string (get-buffer-process "*squeeze*") (format "%s mixer volume %+d\n" id (- inc))))) (defun squeeze-control-query-mixer-volume (&optional id) (interactive) (unless id (setq id (get-text-property (point) 'squeeze-playerid))) - (comint-send-string (get-buffer-process "*squeeze*") (format "%s mixer volume ?\n" id))) + (when id + (comint-send-string (get-buffer-process "*squeeze*") (format "%s mixer volume ?\n" id)))) (defun squeeze-control-player-face (player) (let ((power (squeeze-player-power player)))