aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-07-20 22:26:16 -0700
committerChris Robinson <[email protected]>2011-07-20 22:26:16 -0700
commit1e8a379a03b80dbfc621855fd819f73487bcc7de (patch)
tree2198063858999a79b476039f852da42916239249
parentb889823b2164c652560485dc66dd913b85e0c297 (diff)
Add a config option to boost reverb output
-rw-r--r--Alc/ALc.c3
-rw-r--r--Alc/alcReverb.c10
-rw-r--r--OpenAL32/Include/alEffect.h2
-rw-r--r--alsoftrc.sample12
4 files changed, 26 insertions, 1 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 8d1792c3..d416e413 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -564,6 +564,9 @@ static void alc_initconfig(void)
if(DefaultResampler >= RESAMPLER_MAX || DefaultResampler <= RESAMPLER_MIN)
DefaultResampler = RESAMPLER_DEFAULT;
+ ReverbBoost *= aluPow(10.0f, GetConfigValueFloat("reverb", "boost", 0.0f) /
+ 20.0f);
+
devs = GetConfigValue(NULL, "drivers", "");
if(devs[0])
{
diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c
index 38586357..4b7aa1c4 100644
--- a/Alc/alcReverb.c
+++ b/Alc/alcReverb.c
@@ -135,6 +135,11 @@ typedef struct ALverbState {
ALfloat *Gain;
} ALverbState;
+/* This is a user config option for modifying the overall output of the reverb
+ * effect.
+ */
+ALfloat ReverbBoost = 1.0f;
+
/* This coefficient is used to define the maximum frequency range controlled
* by the modulation depth. The current value of 0.1 will allow it to swing
* from 0.9x to 1.1x. This value must be below 1. At 1 it will cause the
@@ -602,6 +607,8 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection
ALuint index;
ALint pos;
+ Gain *= ReverbBoost;
+
// Attenuate non-directional reverb according to the number of channels
ambientGain = aluSqrt(2.0f/Device->NumChan);
@@ -1106,7 +1113,8 @@ static ALvoid VerbUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff
// Update channel gains
gain = Slot->Gain;
- gain *= aluSqrt(2.0/Device->NumChan);
+ gain *= aluSqrt(2.0f/Device->NumChan);
+ gain *= ReverbBoost;
for(index = 0;index < MAXCHANNELS;index++)
State->Gain[index] = 0.0f;
for(index = 0;index < Device->NumChan;index++)
diff --git a/OpenAL32/Include/alEffect.h b/OpenAL32/Include/alEffect.h
index 7ff9fff3..252490a9 100644
--- a/OpenAL32/Include/alEffect.h
+++ b/OpenAL32/Include/alEffect.h
@@ -18,6 +18,8 @@ enum {
};
extern ALboolean DisabledEffects[MAX_EFFECTS];
+extern ALfloat ReverbBoost;
+
typedef struct ALeffect
{
// Effect type (AL_EFFECT_NULL, ...)
diff --git a/alsoftrc.sample b/alsoftrc.sample
index de389591..0b97b357 100644
--- a/alsoftrc.sample
+++ b/alsoftrc.sample
@@ -151,6 +151,18 @@
#layout_71CHN = fl=-30, fr=30, fc=0, sl=-90, sr=90, bl=-150, br=150
##
+## Reverb effect stuff (includes EAX reverb)
+##
+[reverb]
+
+## boost:
+# A global amplification for reverb output, expressed in decibels. The value
+# is logarithmic, so +6 will be a scale of (approximately) 2x, +12 will be a
+# scale of 4x, etc. Similarly, -6 will be about half, and -12 about 1/4th. A
+# value of 0 means no change.
+#boost = 0
+
+##
## ALSA backend stuff
##
[alsa]