diff options
author | Chris Robinson <[email protected]> | 2014-10-02 21:19:34 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-10-02 21:19:34 -0700 |
commit | 70b23ab77f99c6e4baeca3cb74355a027cf6769d (patch) | |
tree | badc3fce317db7928dc2ddf06b870cf96c32413b /Alc/ALu.c | |
parent | 79fb86d8f79459b0144e4de750e9b6f07c4de473 (diff) |
Add a helper to search for a channel index by name
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -409,15 +409,8 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A for(j = 0;j < MaxChannels;j++) gains[j].Target = 0.0f; - for(i = 0;i < (ALint)Device->NumSpeakers;i++) - { - enum Channel chan = Device->Speaker[i].ChanName; - if(chan == chans[c].channel) - { - gains[chan].Target = DryGain; - break; - } - } + if(GetChannelIdxByName(Device, chans[c].channel) != -1) + gains[chans[c].channel].Target = DryGain; } UpdateDryStepping(&voice->Direct, num_channels); @@ -467,7 +460,8 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A { for(i = 0;i < MaxChannels;i++) Target[i] = 0.0f; - Target[chans[c].channel] = DryGain; + if(GetChannelIdxByName(Device, chans[c].channel) != -1) + Target[chans[c].channel] = DryGain; ok = true; } else for(i = 0;i < (ALint)Device->NumSpeakers;i++) |