Implement a crossfeed config option

This commit is contained in:
Chris Robinson
2008-01-03 06:02:06 -08:00
parent 8fe39042da
commit 4d5885e27b
2 changed files with 25 additions and 0 deletions
+14
View File
@@ -32,6 +32,7 @@
#include "alThunk.h"
#include "alSource.h"
#include "alExtension.h"
#include "bs2b.h"
///////////////////////////////////////////////////////
// DEBUG INFORMATION
@@ -329,6 +330,8 @@ ALCvoid ProcessContext(ALCcontext *pContext)
*/
static ALvoid InitContext(ALCcontext *pContext)
{
int level;
//Initialise listener
pContext->Listener.Gain = 1.0f;
pContext->Listener.Position[0] = 0.0f;
@@ -361,6 +364,14 @@ static ALvoid InitContext(ALCcontext *pContext)
pContext->lNumMonoSources = pContext->Device->MaxNoOfSources - pContext->lNumStereoSources;
strcpy(pContext->ExtensionList, "AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_OFFSET");
level = GetConfigValueInt(NULL, "cf_level", 0);
if(level > 0 && level <= 6)
{
pContext->bs2b = calloc(1, sizeof(*pContext->bs2b));
bs2b_set_srate(pContext->bs2b, pContext->Frequency);
bs2b_set_level(pContext->bs2b, level);
}
}
@@ -394,6 +405,9 @@ static ALCvoid ExitContext(ALCcontext *pContext)
//Invalidate context
pContext->LastError = AL_NO_ERROR;
pContext->InUse = AL_FALSE;
free(pContext->bs2b);
pContext->bs2b = NULL;
}
///////////////////////////////////////////////////////
+11
View File
@@ -23,6 +23,17 @@ format = AL_FORMAT_STEREO16 # Sets the output format. Can be one of:
# AL_FORMAT_71CHN16 (16-bit 7.1 output)
# Default is AL_FORMAT_STEREO16
cf_level = 0 # Sets the crossfeed level for stereo output. Valid values are:
# 0 - No crossfeed
# 1 - Low crossfeed
# 2 - Middle crossfeed
# 3 - High crossfeed (virtual speakers are closer to itself)
# 4 - Low easy crossfeed
# 5 - Middle easy crossfeed
# 6 - High easy crossfeed
# Default is 0. Users of headphones may want to try various
# settings. Has no effect on non-stereo modes.
frequency = 44100 # Sets the output frequency. Default is 44100
refresh = 0 # Sets the number of frames-per-update. Default is calculated as