diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-12-07 00:12:16 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-12-07 00:12:16 +0100 |
commit | 29aa4996828e9052b4682e98e6cabc8986548a79 (patch) | |
tree | ecd23585e40413550f7882453ff572a0f57bdb98 /sys/src/9/pc/audiohda.c | |
parent | 5a138029db4a59025fe25a06f2a688d62d73aec3 (diff) |
audiohda: handle default amp settings
widgets that do not have Wampovrcap have ther default
amplifier parameters stored in the aydio function group.
only if the amp override bit is *not* set, then the widget
stores its own amplifier parameters and we have to query
its node id, otherwise the audio function group node id.
Diffstat (limited to 'sys/src/9/pc/audiohda.c')
-rw-r--r-- | sys/src/9/pc/audiohda.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/src/9/pc/audiohda.c b/sys/src/9/pc/audiohda.c index a9e8a9eb2..96970db15 100644 --- a/sys/src/9/pc/audiohda.c +++ b/sys/src/9/pc/audiohda.c @@ -534,8 +534,10 @@ setoutamp(Widget *w, int mute, int *vol) if((w->cap & Woutampcap) == 0) return; - - r = cmd(w->id, Getparm, Outampcap); + if((w->cap & Wampovrcap) == 0) + r = cmd(w->fg->id, Getparm, Outampcap); + else + r = cmd(w->id, Getparm, Outampcap); zerodb = r & 0x7f; for(i=0; i<2; i++){ @@ -559,8 +561,10 @@ setinamp(Widget *w, Widget *in, int mute, int *vol) if((w->cap & Winampcap) == 0) return; - - r = cmd(w->id, Getparm, Inampcap); + if((w->cap & Wampovrcap) == 0) + r = cmd(w->fg->id, Getparm, Inampcap); + else + r = cmd(w->id, Getparm, Inampcap); zerodb = r & 0x7f; for(i=0; i<2; i++){ @@ -849,7 +853,7 @@ connectpin(Ctlr *ctlr, uint pin, uint cad) return -1; dst = findpath(src); - if(!dst) + if(dst == nil) return -1; /* mute all widgets, clear stream */ @@ -1300,6 +1304,17 @@ hdastatus(Audio *adev, void *a, long n, vlong) } } } + + k += snprint(s+k, n-k, "path "); + for(w=ctlr->amp; w != nil; w = w->from){ + k += snprint(s+k, n-k, "%3d %s %lux %lux %lux", w->id.nid, widtype[w->type&7], + (ulong)w->cap, (ulong)w->pin, (ulong)w->pincap); + if(w == ctlr->src) + break; + k += snprint(s+k, n-k, " -> "); + } + k += snprint(s+k, n-k, "\n"); + return k; } |