From 585626987767fee95b4666da3a44128fec0d3105 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Sat, 19 Apr 2014 19:22:51 +0100 Subject: [PATCH] clean up squeze-control-refresh handle accepting process output in a separate function --- squeeze.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/squeeze.el b/squeeze.el index e79a581..406ffac 100644 --- a/squeeze.el +++ b/squeeze.el @@ -239,18 +239,19 @@ (defun squeeze-control-listen () (squeeze-send-string "listen 1")) +(defun squeeze-accept-process-output () + (while (accept-process-output (get-buffer-process "*squeeze*") 0.1 nil t))) + (defun squeeze-control-refresh () (interactive) (let ((squeeze-control-inhibit-display t)) (squeeze-control-query-players) - (accept-process-output (get-buffer-process "*squeeze*")) + (squeeze-accept-process-output) (squeeze-control-query-syncgroups) - (accept-process-output (get-buffer-process "*squeeze*")) (dolist (player squeeze-players) (squeeze-control-query-power (squeeze-player-playerid player)) - (accept-process-output (get-buffer-process "*squeeze*")) - (squeeze-control-query-mixer-volume (squeeze-player-playerid player)) - (accept-process-output (get-buffer-process "*squeeze*")))) + (squeeze-control-query-mixer-volume (squeeze-player-playerid player)))) + (squeeze-accept-process-output) (squeeze-control-display-players)) (defvar squeeze-control-mixer-map -- 2.39.5