]> git.alsa-project.org Git - alsa-tools.git/commit
hdspmixer: Lower nesting depth in label assignment
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>
Tue, 1 Mar 2011 09:42:26 +0000 (10:42 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 1 Mar 2011 12:47:21 +0000 (13:47 +0100)
commit05d6bc9728071b0b805fe551603ebeb4d7e7bd28
treef6d7c5d6455b1303712ac859d96925b78f899042
parent042363a42925990eeeff3dd07a5919f5e66f8d14
hdspmixer: Lower nesting depth in label assignment

This fix is mostly cosmetic, the long if-then-else-if-chain was rather
confusing. To improve code readability, use simple if-then statements
and leave the function as soon as a match is found.

Clear code would probably use a two-dimensional map, but it seems rather
overengineered.

Last but not least, the non-matching case was augmented by assigning a
generic "1", "2", "3" .. channel naming schema to prevent hdspmixer from
crashing.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
hdspmixer/src/HDSPMixerOutput.cxx