Hi,
Drivers for oss_hdaudio and perhaps other soundcards may contain empty
groups in their mixer definitions.
This results in empty gtk v/hboxes being displayed in ossxmix which
serve no purpose and take up screen space unnecessarily.
The attached patch for ossxmix prevents these empty boxes from being
displayed.
I cannot envisage a mixer definition in which the final record would be
a mixer group so have not taken any action to prevent i+1 exceeding n.
Kind regards,
Clive
--- cmd/ossxmix/ossxmix_c.bak 2008-05-17 01:14:18.000000000 +0100
+++ cmd/ossxmix/ossxmix.c 2008-05-17 01:14:42.000000000 +0100
@@ -835,7 +835,7 @@
int ngroups = 0;
int parent;
int change_color;
- oss_mixext *thisrec;
+ oss_mixext *thisrec, *nextrec;
oss_mixerinfo mi;
GdkColor color;
GtkWidget *wid, *wid2, *gang, *rootwid = NULL, *pw, *frame, *box;
@@ -932,6 +932,24 @@
case MIXT_GROUP:
if (!show_all)
break;
+ nextrec = &extrec[dev][i+1];
+ nextrec->dev = dev;
+ nextrec->ctrl = i+1;
+
+ if (ioctl (mixer_fd, SNDCTL_MIX_EXTINFO, nextrec) == -1)
+ {
+ if (errno == EINVAL)
+ printf ("Incompatible OSS version\n");
+ else
+ perror ("SNDCTL_MIX_EXTINFO");
+ exit (-1);
+ }
+ /*
+ * Ignore group if next record is also a group with the same parent
+ */
+ if (nextrec->type == MIXT_GROUP
+ && (thisrec->parent == nextrec->parent))
+ break;
parent = thisrec->parent;
name = cut_name (thisrec->id);
if (*extnames[parent] == '\0')
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel