diff options
author | Chris Robinson <[email protected]> | 2016-09-24 18:46:41 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-09-24 18:46:41 -0700 |
commit | f5e4a3ed85993f479c6cc1a967d5252378eb5211 (patch) | |
tree | ac45d22c3f4ea5e4df0ffef5720b09ee840c1ac4 /OpenAL32 | |
parent | 24f9a0f2aed5b0770af1633ab4a2e2832462294e (diff) |
Add a volume-adjust config option to adjust the source output volume
Designed for apps that either don't change the listener's AL_GAIN, or don't
allow the listener's AL_GAIN to go above 1. This allows the volume to still be
increased further than such apps may allow, if users find it too quiet.
Be aware that increasing this can easily cause clipping. The gain limit
reported by AL_GAIN_LIMIT_SOFT is also affected by this.
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 2 | ||||
-rw-r--r-- | OpenAL32/alState.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 356a749a..6320bc98 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -749,6 +749,8 @@ struct ALCcontext_struct { RefCount UpdateCount; ATOMIC(ALenum) HoldUpdates; + ALfloat GainBoost; + struct ALvoice *Voices; ALsizei VoiceCount; ALsizei MaxVoices; diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index c25aa63e..3d8e6c40 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -155,7 +155,7 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname) break; case AL_GAIN_LIMIT_SOFT: - if(GAIN_MIX_MAX != 0.0f) + if(GAIN_MIX_MAX/context->GainBoost != 0.0f) value = AL_TRUE; break; @@ -201,7 +201,7 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname) break; case AL_GAIN_LIMIT_SOFT: - value = (ALdouble)GAIN_MIX_MAX; + value = (ALdouble)GAIN_MIX_MAX/context->GainBoost; break; default: @@ -246,7 +246,7 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname) break; case AL_GAIN_LIMIT_SOFT: - value = GAIN_MIX_MAX; + value = GAIN_MIX_MAX/context->GainBoost; break; default: @@ -291,7 +291,7 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname) break; case AL_GAIN_LIMIT_SOFT: - value = (ALint)GAIN_MIX_MAX; + value = (ALint)(GAIN_MIX_MAX/context->GainBoost); break; default: @@ -336,7 +336,7 @@ AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname) break; case AL_GAIN_LIMIT_SOFT: - value = (ALint64SOFT)GAIN_MIX_MAX; + value = (ALint64SOFT)(GAIN_MIX_MAX/context->GainBoost); break; default: |