}
p++;
}
+
+ /* Special case - handle "Input Source" as a capture route.
+ * Note that it's *NO* capture source. A capture source is split over
+ * sub-elements, and multiple capture-sources will result in an error.
+ * That's why some drivers use "Input Source" as a workaround.
+ * Hence, this is a workaround for a workaround to get the things
+ * straight back again. Sigh.
+ */
+ if (!strcmp(name, "Input Source")) {
+ *type = CTL_CAPTURE_ROUTE;
+ return strlen(name);
+ }
+
return 0;
}
{
unsigned int n;
if (ctype == SND_CTL_ELEM_TYPE_ENUMERATED) {
- type = CTL_GLOBAL_ENUM;
+ if (type == CTL_PLAYBACK_ROUTE)
+ type = CTL_PLAYBACK_ENUM;
+ else if (type == CTL_CAPTURE_ROUTE)
+ type = CTL_CAPTURE_ENUM;
+ else
+ type = CTL_GLOBAL_ENUM;
break;
}
if (ctype != SND_CTL_ELEM_TYPE_BOOLEAN)
case CTL_PLAYBACK_SWITCH:
case CTL_CAPTURE_SWITCH:
if (ctype == SND_CTL_ELEM_TYPE_ENUMERATED) {
- type = CTL_GLOBAL_ENUM;
+ if (type == CTL_PLAYBACK_SWITCH)
+ type = CTL_PLAYBACK_ENUM;
+ else if (type == CTL_CAPTURE_SWITCH)
+ type = CTL_CAPTURE_ENUM;
+ else
+ type = CTL_GLOBAL_ENUM;
break;
}
if (ctype != SND_CTL_ELEM_TYPE_BOOLEAN)
case CTL_PLAYBACK_VOLUME:
case CTL_CAPTURE_VOLUME:
if (ctype == SND_CTL_ELEM_TYPE_ENUMERATED) {
- type = CTL_GLOBAL_ENUM;
+ if (type == CTL_PLAYBACK_VOLUME)
+ type = CTL_PLAYBACK_ENUM;
+ else if (type == CTL_CAPTURE_VOLUME)
+ type = CTL_CAPTURE_ENUM;
+ else
+ type = CTL_GLOBAL_ENUM;
break;
}
if (ctype != SND_CTL_ELEM_TYPE_INTEGER)