]> rhodes.io Git - squeeze-el.git/commitdiff
Christophe Weblog Wiki Code Publications Music
clean up squeze-control-refresh
authorChristophe Rhodes <csr21@cantab.net>
Sat, 19 Apr 2014 18:22:51 +0000 (19:22 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Sat, 19 Apr 2014 18:22:51 +0000 (19:22 +0100)
handle accepting process output in a separate function

squeeze.el

index e79a581cec29cc04524c7ed835e18d92f7c0ad4b..406ffac5adaf74040a1da74c9248bb0ba6183111 100644 (file)
 (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