]> git.alsa-project.org Git - alsa-tools.git/commitdiff
hdspmixer: [cosmetics] Break code into logic blocks
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>
Mon, 7 Mar 2011 18:03:08 +0000 (19:03 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 8 Mar 2011 12:04:36 +0000 (13:04 +0100)
Convert the if-then-else-if chain into standalone if-then blocks to
improve readability. A switch-case statement would also do the trick,
but it's less readable.

No (intended) semantic change.

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

index bf7009fcefc26a49058088cc653251c5f05762ba..b754b208478f00dc8a03fc15a734e52e559edfb1 100644 (file)
@@ -229,7 +229,9 @@ void HDSPMixerCard::adjustSettings() {
             /* should never happen */
             break;
         }
-    } else if (type == Digiface) {
+    }
+    
+    if (type == Digiface) {
         switch (speed_mode) {
         case 0:
             channels_input = channels_playback = 26;
@@ -249,7 +251,9 @@ void HDSPMixerCard::adjustSettings() {
             /* should never happen */
             break;
         }
-    } else if (type == H9652) {
+    }
+
+    if (type == H9652) {
         switch (speed_mode) {
         case 0:
             channels_input = channels_playback = 26;
@@ -269,7 +273,9 @@ void HDSPMixerCard::adjustSettings() {
             /* should never happen */
             break;
         }
-    } else if (type == H9632) {
+    }
+
+    if (type == H9632) {
         switch (speed_mode) {
         case 0:
             channels_input = channels_playback = 12 + ((h9632_aeb.aebi || h9632_aeb.aebo) ? 4 : 0);
@@ -293,7 +299,9 @@ void HDSPMixerCard::adjustSettings() {
             meter_map_input = meter_map_playback = channel_map_h9632_qs;
             break;
         }
-    } else if (HDSPeMADI == type) {
+    }
+
+    if (HDSPeMADI == type) {
         playbacks_offset = 64;
 
         switch (speed_mode) {
@@ -320,7 +328,9 @@ void HDSPMixerCard::adjustSettings() {
             break;
         }
 
-    } else if (HDSPeAIO == type) {
+    }
+
+    if (HDSPeAIO == type) {
         playbacks_offset = 64;
 
         switch (speed_mode) {
@@ -356,7 +366,9 @@ void HDSPMixerCard::adjustSettings() {
             break;
         }
 
-    } else if (HDSP_AES == type) {
+    }
+
+    if (HDSP_AES == type) {
         playbacks_offset = 64; /* not sure about this one? */
 
         /* 16 channels for all modes */
@@ -369,7 +381,9 @@ void HDSPMixerCard::adjustSettings() {
         meter_map_input = channel_map_aes32;
         meter_map_playback = channel_map_aes32;
 
-    } else if (HDSPeRayDAT == type) {
+    }
+
+    if (HDSPeRayDAT == type) {
         playbacks_offset = 64;
 
         switch (speed_mode) {