summaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-01-03 06:02:06 -0800
committerChris Robinson <[email protected]>2008-01-03 06:02:06 -0800
commit4d5885e27bef05004ab16be8da4e93b458b736a9 (patch)
tree92fb15186cc1f018c019216e5c4fff174a8ab91a /Alc/ALc.c
parent8fe39042da3369acb4aa8e5a8837709c4338d0f0 (diff)
Implement a crossfeed config option
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 9bd4086d..1a66dc2a 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -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;
}
///////////////////////////////////////////////////////