From 22557070ec4852d64ad153f5cac907f84119702c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 14 Aug 2008 05:43:52 -0700 Subject: Ramp channel gains to remove pops and clicks from abrupt changes Thanks to Christopher Fitzgerald for helping me work on it --- OpenAL32/Include/alSource.h | 7 +++++++ OpenAL32/Include/alu.h | 13 +++++++++++++ 2 files changed, 20 insertions(+) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index 73b02609..42a1b915 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -7,6 +7,7 @@ #define MAX_SENDS 1 #include "alFilter.h" +#include "alu.h" #include "AL/al.h" #define AL_DIRECT_FILTER 0x20005 @@ -94,6 +95,12 @@ typedef struct ALsource // Source Type (Static, Streaming, or Undetermined) ALint lSourceType; + // Current gains, which are ramped while mixed + ALfloat DryGains[OUTPUTCHANNELS]; + ALfloat WetGains[OUTPUTCHANNELS]; + ALfloat DryGainHF; + ALfloat WetGainHF; + struct ALsource *next; } ALsource; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 6fab1fae..b14180b2 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -8,6 +8,19 @@ extern "C" { #endif +enum { + FRONT_LEFT = 0, + FRONT_RIGHT, + SIDE_LEFT, + SIDE_RIGHT, + BACK_LEFT, + BACK_RIGHT, + CENTER, + LFE, + + OUTPUTCHANNELS +}; + extern ALboolean DuplicateStereo; __inline ALuint aluBytesFromFormat(ALenum format); -- cgit v1.2.3