chiark / gitweb /
update control buttons directly from state bits
[disorder] / disobedience / log.c
index e170c2ac18a946be8d92a3ef7d52b61f75ac1b0f..943c5e3d97447dd22cdabc64a8274aed3845e52f 100644 (file)
@@ -142,14 +142,15 @@ static void log_scratched(void attribute((unused)) *v,
 static void log_state(void attribute((unused)) *v,
                       unsigned long state) {
   const struct monitor *m;
+  const unsigned long changes = state ^ last_state;
 
+  info("log_state %s", disorder_eclient_interpret_state(state));
+  last_state = state;
   /* Tell anything that cares about the state change */
   for(m = monitors; m; m = m->next) {
-    if((state ^ last_state) & m->mask)
-      m->callback(m->u, state);
+    if(changes & m->mask)
+      m->callback(m->u);
   }
-  last_state = state;
-  control_update();
   /* If the track is paused or resume then the currently playing track is
    * refetched so that we can continue to correctly calculate the played so-far
    * field */