diff options
author | Chris Robinson <[email protected]> | 2010-04-20 03:57:40 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-04-20 03:57:40 -0700 |
commit | a04dac670ed89aabe05cdfd45649bb4c85b90bda (patch) | |
tree | 8c10998cbda049b4e87fc23350edbaf95c2a766c /Alc | |
parent | 81dd71dd71aa1b11d3304265acd0728659465ab1 (diff) |
Make stereo duplication a property of the device
Further, don't use it with mono/stereo output
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 2 | ||||
-rw-r--r-- | Alc/ALu.c | 10 |
2 files changed, 8 insertions, 4 deletions
@@ -337,8 +337,6 @@ static void alc_init(void) for(i = 0;BackendList[i].Init;i++) BackendList[i].Init(&BackendList[i].Funcs); - DuplicateStereo = GetConfigValueBool(NULL, "stereodup", 0); - str = GetConfigValue(NULL, "excludefx", ""); if(str[0]) { @@ -45,8 +45,6 @@ * adequately reduce clicks and pops from harsh gain changes. */ #define MIN_RAMP_LENGTH 16 -ALboolean DuplicateStereo = AL_FALSE; - static __inline ALfloat aluF2F(ALfloat Value) { @@ -250,6 +248,7 @@ ALvoid aluInitPanning(ALCdevice *Device) case AL_FORMAT_MONO8: case AL_FORMAT_MONO16: case AL_FORMAT_MONO_FLOAT32: + Device->DuplicateStereo = AL_FALSE; Device->ChannelMatrix[FRONT_LEFT][FRONT_CENTER] = aluSqrt(0.5); Device->ChannelMatrix[FRONT_RIGHT][FRONT_CENTER] = aluSqrt(0.5); Device->ChannelMatrix[SIDE_LEFT][FRONT_CENTER] = aluSqrt(0.5); @@ -265,6 +264,7 @@ ALvoid aluInitPanning(ALCdevice *Device) case AL_FORMAT_STEREO8: case AL_FORMAT_STEREO16: case AL_FORMAT_STEREO_FLOAT32: + Device->DuplicateStereo = AL_FALSE; Device->ChannelMatrix[FRONT_CENTER][FRONT_LEFT] = aluSqrt(0.5); Device->ChannelMatrix[FRONT_CENTER][FRONT_RIGHT] = aluSqrt(0.5); Device->ChannelMatrix[SIDE_LEFT][FRONT_LEFT] = 1.0f; @@ -284,6 +284,7 @@ ALvoid aluInitPanning(ALCdevice *Device) case AL_FORMAT_QUAD8: case AL_FORMAT_QUAD16: case AL_FORMAT_QUAD32: + Device->DuplicateStereo = GetConfigValueBool(NULL, "stereodup", 0); Device->ChannelMatrix[FRONT_CENTER][FRONT_LEFT] = aluSqrt(0.5); Device->ChannelMatrix[FRONT_CENTER][FRONT_RIGHT] = aluSqrt(0.5); Device->ChannelMatrix[SIDE_LEFT][FRONT_LEFT] = aluSqrt(0.5); @@ -307,6 +308,7 @@ ALvoid aluInitPanning(ALCdevice *Device) case AL_FORMAT_51CHN8: case AL_FORMAT_51CHN16: case AL_FORMAT_51CHN32: + Device->DuplicateStereo = GetConfigValueBool(NULL, "stereodup", 0); Device->ChannelMatrix[SIDE_LEFT][FRONT_LEFT] = aluSqrt(0.5); Device->ChannelMatrix[SIDE_LEFT][BACK_LEFT] = aluSqrt(0.5); Device->ChannelMatrix[SIDE_RIGHT][FRONT_RIGHT] = aluSqrt(0.5); @@ -330,6 +332,7 @@ ALvoid aluInitPanning(ALCdevice *Device) case AL_FORMAT_61CHN8: case AL_FORMAT_61CHN16: case AL_FORMAT_61CHN32: + Device->DuplicateStereo = GetConfigValueBool(NULL, "stereodup", 0); Device->ChannelMatrix[BACK_LEFT][BACK_CENTER] = aluSqrt(0.5); Device->ChannelMatrix[BACK_LEFT][SIDE_LEFT] = aluSqrt(0.5); Device->ChannelMatrix[BACK_RIGHT][BACK_CENTER] = aluSqrt(0.5); @@ -353,6 +356,7 @@ ALvoid aluInitPanning(ALCdevice *Device) case AL_FORMAT_71CHN8: case AL_FORMAT_71CHN16: case AL_FORMAT_71CHN32: + Device->DuplicateStereo = GetConfigValueBool(NULL, "stereodup", 0); Device->ChannelMatrix[BACK_CENTER][BACK_LEFT] = aluSqrt(0.5); Device->ChannelMatrix[BACK_CENTER][BACK_RIGHT] = aluSqrt(0.5); Device->NumChan = 7; @@ -923,6 +927,7 @@ static void MixSomeSources(ALCcontext *ALContext, float (*DryBuffer)[OUTPUTCHANN FILTER *DryFilter, *WetFilter[MAX_SENDS]; ALfloat WetSend[MAX_SENDS]; ALuint rampLength; + ALboolean DuplicateStereo; ALuint DeviceFreq; ALint increment; ALuint DataPosInt, DataPosFrac; @@ -936,6 +941,7 @@ static void MixSomeSources(ALCcontext *ALContext, float (*DryBuffer)[OUTPUTCHANN if(!(ALSource=ALContext->SourceList)) return; + DuplicateStereo = ALContext->Device->DuplicateStereo; DeviceFreq = ALContext->Device->Frequency; rampLength = DeviceFreq * MIN_RAMP_LENGTH / 1000; |