Commit Diff


commit - 0dc18afae75751699ea6460b60a2be4a84ca69b1
commit + 79a57f7c59c84c74ca829e308e87e30b8b65ea1c
blob - c5f948b39a04ce870c0c4bfe3197eaa07bf0d4ef
blob + d7c23b3d10cd3512b7d5c394a0e3f0cdf62e3aca
--- audiowidget.c
+++ audiowidget.c
@@ -21,15 +21,44 @@
 
 extern struct app_state s;
 
+struct info *nextpar(struct info *);
+
+/*
+ * find the next parameter with the same group, name, func
+ */
+struct info *
+nextpar(struct info *i)
+{
+	char *str, *group, *func;
+	int unit;
+
+	group = i->desc.group;
+	func = i->desc.func;
+	str = i->desc.node0.name;
+	unit = i->desc.node0.unit;
+	for (i = i->next; i != NULL; i = i->next) {
+		if (strcmp(i->desc.group, group) != 0 ||
+		    strcmp(i->desc.node0.name, str) != 0 ||
+		    strcmp(i->desc.func, func) != 0)
+			break;
+		/* XXX: need to check for -1 ? */
+		if (i->desc.node0.unit != unit)
+			return i;
+	}
+	return NULL;
+}
+
 static gboolean
 _on_debounce_timeout(gpointer user_data)
 {
 	struct info *i = user_data;
 	double value = gtk_range_get_value(audiowidget_get_gtkrange(i->widget));
 	unsigned int uvalue = (unsigned int)(value + 0.5);
-	sioctl_setval(s.hdl, i->ctladdr, uvalue);
 
-	i->timeout = 0;
+	for (; i != NULL; i = nextpar(i)) {
+		sioctl_setval(s.hdl, i->ctladdr, uvalue);
+		i->timeout = 0;
+	}
 	return G_SOURCE_REMOVE; // one-shot
 }
 
blob - a8fade3eafeb8186f8a45953ff4d689de8e8e8b1
blob + 42429877be1598461e50f1d6738cbfa3944c519c
--- siomixer.c
+++ siomixer.c
@@ -45,10 +45,8 @@ static GSourceFuncs sioctl_source_funcs = {
 
 int cmpdesc(struct sioctl_desc *, struct sioctl_desc *);
 int isdiag(struct info *);
-int ismono(struct info *);
 struct info *vecent(struct info *, char *, int);
 struct info *nextfunc(struct info *);
-struct info *nextpar(struct info *);
 struct info *firstent(struct info *, char *);
 struct info *nextent(struct info *, int);
 void ondesc(void *, struct sioctl_desc *, int);
@@ -211,33 +209,7 @@ nextfunc(struct info *i)
 	return NULL;
 }
 
-
 /*
- * find the next parameter with the same group, name, func
- */
-struct info *
-nextpar(struct info *i)
-{
-	char *str, *group, *func;
-	int unit;
-
-	group = i->desc.group;
-	func = i->desc.func;
-	str = i->desc.node0.name;
-	unit = i->desc.node0.unit;
-	for (i = i->next; i != NULL; i = i->next) {
-		if (strcmp(i->desc.group, group) != 0 ||
-		    strcmp(i->desc.node0.name, str) != 0 ||
-		    strcmp(i->desc.func, func) != 0)
-			break;
-		/* XXX: need to check for -1 ? */
-		if (i->desc.node0.unit != unit)
-			return i;
-	}
-	return NULL;
-}
-
-/*
  * return the first vector entry with the given name
  */
 struct info *
@@ -290,52 +262,6 @@ nextent(struct info *i, int mono)
 	return NULL;
 }
 
-/*
- * return true if the given group can be represented as a signle mono
- * parameter
- */
-int
-ismono(struct info *g)
-{
-	struct info *p1, *p2;
-	struct info *e1, *e2;
-
-	p1 = g;
-	switch (g->desc.type) {
-	case SIOCTL_NUM:
-	case SIOCTL_SW:
-		for (p2 = g; p2 != NULL; p2 = nextpar(p2)) {
-			if (p2->curval != p1->curval)
-				return 0;
-		}
-		break;
-	case SIOCTL_SEL:
-	case SIOCTL_VEC:
-	case SIOCTL_LIST:
-		for (p2 = g; p2 != NULL; p2 = nextpar(p2)) {
-			for (e2 = p2; e2 != NULL; e2 = nextent(e2, 0)) {
-				if (!isdiag(e2)) {
-					if (e2->curval != 0)
-						return 0;
-				} else {
-					e1 = vecent(p1,
-					    e2->desc.node1.name,
-					    p1->desc.node0.unit);
-					if (e1 == NULL)
-						continue;
-					if (e1->curval != e2->curval)
-						return 0;
-					if (strcmp(e1->desc.display,
-						e2->desc.display) != 0)
-						return 0;
-				}
-			}
-		}
-		break;
-	}
-	return 1;
-}
-
 static void
 activate (GtkApplication *app, gpointer user_data)
 {