alsa: rework mixer logic

Completely rework mixer logic. This now allows controlling a full set of
elements from a single sink's volume slider/mute button.

This also introduces sink and source "ports" that can be used to choose
different input or output ports with the UI. (i.e. "mic"/"line-in" or
"speaker"/"headphones".

The mixer paths and device maps are now configered in external
configuration files and can be tweaked as necessary.
This commit is contained in:
Lennart Poettering 2009-06-17 03:45:14 +02:00
parent e9c70ac41b
commit 31575f7766
54 changed files with 7029 additions and 1694 deletions

View file

@ -139,11 +139,10 @@ char *pa_card_list_to_string(pa_core *c) {
if (card->profiles) {
pa_card_profile *p;
void *state = NULL;
void *state;
pa_strbuf_puts(s, "\tprofiles:\n");
while ((p = pa_hashmap_iterate(card->profiles, &state, NULL)))
PA_HASHMAP_FOREACH(p, card->profiles, state)
pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", p->name, p->description, p->priority);
}
@ -307,6 +306,22 @@ char *pa_sink_list_to_string(pa_core *c) {
t = pa_proplist_to_string_sep(sink->proplist, "\n\t\t");
pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
if (sink->ports) {
pa_device_port *p;
void *state;
pa_strbuf_puts(s, "\tports:\n");
PA_HASHMAP_FOREACH(p, sink->ports, state)
pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", p->name, p->description, p->priority);
}
if (sink->active_port)
pa_strbuf_printf(
s,
"\tactive port: <%s>\n",
sink->active_port->name);
}
return pa_strbuf_tostring_free(s);
@ -412,6 +427,21 @@ char *pa_source_list_to_string(pa_core *c) {
t = pa_proplist_to_string_sep(source->proplist, "\n\t\t");
pa_strbuf_printf(s, "\tproperties:\n\t\t%s\n", t);
pa_xfree(t);
if (source->ports) {
pa_device_port *p;
void *state;
pa_strbuf_puts(s, "\tports:\n");
PA_HASHMAP_FOREACH(p, source->ports, state)
pa_strbuf_printf(s, "\t\t%s: %s (priority %u)\n", p->name, p->description, p->priority);
}
if (source->active_port)
pa_strbuf_printf(
s,
"\tactive port: <%s>\n",
source->active_port->name);
}
return pa_strbuf_tostring_free(s);