+static void update_port_from_button(int on, const char *sink_name, const char *port1, const char *port2)
+{
+ if (!on)
+ return;
+
+ struct pulse_sink *s = pulse_sink_by_name(sink_name);
+ if (!s)
+ return;
+
+ const char *port = port1;
+ if (!strcmp(s->active_port, port1))
+ port = port2;
+
+ DBG("## Setting port of sink %s to %s", s->name, port);
+ pulse_sink_set_port(s->idx, port);
+}
+