aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-11-25 22:20:00 -0800
committerChris Robinson <[email protected]>2014-11-25 22:20:00 -0800
commitbdbf6613ef4d57f15f5e7e3cbc31211a0c57e575 (patch)
tree298b76ea7a08d4625deca17ec41db90635dae956 /Alc/panning.c
parentbe476b372993647376de5d6133bd37e7fa77df17 (diff)
Support B-Format output with the wave file writer
Diffstat (limited to 'Alc/panning.c')
-rw-r--r--Alc/panning.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/Alc/panning.c b/Alc/panning.c
index 474b704c..a9d0f5cb 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -75,7 +75,7 @@ void ComputeDirectionalGains(const ALCdevice *device, const ALfloat dir[3], ALfl
{
for(j = 0;j < MAX_AMBI_COEFFS;j++)
gains[i] += device->Channel[i].HOACoeff[j]*coeffs[j];
- gains[i] = maxf(gains[i], 0.0f) * ingain;
+ gains[i] *= ingain;
}
}
@@ -134,6 +134,11 @@ DECL_CONST static inline const char *GetLabelFromChannel(enum Channel channel)
case BottomBackLeft: return "bottom-back-left";
case BottomBackRight: return "bottom-back-right";
+ case Aux0: return "aux-0";
+ case Aux1: return "aux-1";
+ case Aux2: return "aux-2";
+ case Aux3: return "aux-3";
+
case InvalidChannel: break;
}
return "(unknown)";
@@ -241,6 +246,8 @@ static bool LoadChannelSetup(ALCdevice *device)
channels = surround71_chans;
count = COUNTOF(surround71_chans);
break;
+ case DevFmtBFormat3D:
+ break;
}
if(!layout)
@@ -341,6 +348,11 @@ ALvoid aluInitPanning(ALCdevice *device)
{ BottomFrontRight, { { 0.176777f, 0.125000f, -0.125000f, -0.125000f }, { 0.176777f, 0.125000f, -0.125000f, -0.125000f } } },
{ BottomBackLeft, { { 0.176777f, -0.125000f, 0.125000f, -0.125000f }, { 0.176777f, -0.125000f, 0.125000f, -0.125000f } } },
{ BottomBackRight, { { 0.176777f, -0.125000f, -0.125000f, -0.125000f }, { 0.176777f, -0.125000f, -0.125000f, -0.125000f } } },
+ }, BFormat3D[4] = {
+ { Aux0, { { 1.0f, 0.0f, 0.0f, 0.0f }, { 1.0f, 0.0f, 0.0f, 0.0f } } },
+ { Aux1, { { 0.0f, 1.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f, 0.0f } } },
+ { Aux2, { { 0.0f, 0.0f, 1.0f, 0.0f }, { 0.0f, 0.0f, 1.0f, 0.0f } } },
+ { Aux3, { { 0.0f, 0.0f, 0.0f, 1.0f }, { 0.0f, 0.0f, 0.0f, 1.0f } } },
};
const ChannelMap *chanmap = NULL;
size_t count = 0;
@@ -420,6 +432,11 @@ ALvoid aluInitPanning(ALCdevice *device)
count = COUNTOF(X71Cfg);
chanmap = X71Cfg;
break;
+
+ case DevFmtBFormat3D:
+ count = COUNTOF(BFormat3D);
+ chanmap = BFormat3D;
+ break;
}
SetChannelMap(device, chanmap, count);