aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-11-06 12:21:46 -0700
committerChris Robinson <[email protected]>2010-11-06 12:21:46 -0700
commit289c74788e33db600a4f9797fc40b9d5afb50bbe (patch)
tree401fad9e3a3c2d517d1b10b230a8df17bbeee101
parent65a8d9278d600e108c39cecda6f54a38fc656efa (diff)
Use a switch to select the appropriate channel-count mixer
-rw-r--r--Alc/mixer.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c
index e5b48337..4c7fff32 100644
--- a/Alc/mixer.c
+++ b/Alc/mixer.c
@@ -472,11 +472,11 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac)
Source->Send[out].Slot->effect.type == AL_EFFECT_NULL) \
continue; \
\
- WetSend = Source->Params.WetGains[out]; \
WetBuffer = Source->Send[out].Slot->WetBuffer; \
WetClickRemoval = Source->Send[out].Slot->ClickRemoval; \
WetPendingClicks = Source->Send[out].Slot->PendingClicks; \
WetFilter = &Source->Params.Send[out].iirFilter; \
+ WetSend = Source->Params.WetGains[out]; \
\
pos = DataPosInt; \
frac = DataPosFrac; \
@@ -568,27 +568,36 @@ static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac)
#define MIX(sampler) do { \
- if(Channels == 1) /* Mono */ \
+ switch(Channels) \
+ { \
+ case 1: /* Mono */ \
MIX_MONO(sampler); \
- else if(Channels == 2) /* Stereo */ \
+ break; \
+ case 2: /* Stereo */ \
MIX_STEREO(sampler); \
- else if(Channels == 4) /* Quad */ \
+ break; \
+ case 4: /* Quad */ \
MIX_MC(sampler, FRONT_LEFT, FRONT_RIGHT, \
BACK_LEFT, BACK_RIGHT); \
- else if(Channels == 6) /* 5.1 */ \
+ break; \
+ case 6: /* 5.1 */ \
MIX_MC(sampler, FRONT_LEFT, FRONT_RIGHT, \
FRONT_CENTER, LFE, \
BACK_LEFT, BACK_RIGHT); \
- else if(Channels == 7) /* 6.1 */ \
+ break; \
+ case 7: /* 6.1 */ \
MIX_MC(sampler, FRONT_LEFT, FRONT_RIGHT, \
FRONT_CENTER, LFE, \
BACK_CENTER, \
SIDE_LEFT, SIDE_RIGHT); \
- else if(Channels == 8) /* 7.1 */ \
+ break; \
+ case 8: /* 7.1 */ \
MIX_MC(sampler, FRONT_LEFT, FRONT_RIGHT, \
FRONT_CENTER, LFE, \
BACK_LEFT, BACK_RIGHT, \
SIDE_LEFT, SIDE_RIGHT); \
+ break; \
+ } \
} while(0)