diff options
author | Chris Robinson <[email protected]> | 2011-06-25 00:08:05 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-06-25 00:13:56 -0700 |
commit | 1fc44d57889ecde9bd3693dbaaceb0e9039bdfb0 (patch) | |
tree | 66f17970bcdb3675404df09fa9f49c4c41f94e7d /OpenAL32/Include | |
parent | 913c70557d562695cd7cd96fce49ab7a2818713a (diff) |
Select the mixer during a source update
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alSource.h | 21 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 26 |
2 files changed, 24 insertions, 23 deletions
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index e9c50f14..9cbd7f54 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -15,15 +15,6 @@ extern "C" { #define SRC_HISTORY_LENGTH (1<<SRC_HISTORY_BITS) #define SRC_HISTORY_MASK (SRC_HISTORY_LENGTH-1) -typedef enum { - POINT_RESAMPLER = 0, - LINEAR_RESAMPLER, - CUBIC_RESAMPLER, - - RESAMPLER_MAX, - RESAMPLER_MIN = -1, - RESAMPLER_DEFAULT = LINEAR_RESAMPLER -} resampler_t; extern resampler_t DefaultResampler; extern const ALsizei ResamplerPadding[RESAMPLER_MAX]; @@ -100,6 +91,8 @@ typedef struct ALsource /* Current target parameters used for mixing */ struct { + MixerFunc DoMix; + ALint Step; ALfloat HrtfCoeffs[MAXCHANNELS][HRIR_LENGTH][2]; @@ -122,21 +115,11 @@ typedef struct ALsource ALboolean NeedsUpdate; ALvoid (*Update)(struct ALsource *self, const ALCcontext *context); - ALvoid (*DoMix)(struct ALsource *self, ALCdevice *Device, - const ALvoid *RESTRICT data, - ALuint *DataPosInt, ALuint *DataPosFrac, - ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize); - ALvoid (*DoHrtfMix)(struct ALsource *self, ALCdevice *Device, - const ALvoid *RESTRICT data, - ALuint *DataPosInt, ALuint *DataPosFrac, - ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize); // Index to itself ALuint source; } ALsource; #define ALsource_Update(s,a) ((s)->Update(s,a)) -#define ALsource_DoMix(s,a,b,c,d,e,f,g) ((s)->DoMix(s,a,b,c,d,e,f,g)) -#define ALsource_DoHrtfMix(s,a,b,c,d,e,f,g) ((s)->DoHrtfMix(s,a,b,c,d,e,f,g)) ALvoid ReleaseALSources(ALCcontext *Context); diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 41ad5f6b..4e794f26 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -61,6 +61,25 @@ extern "C" { #endif +struct ALsource; +struct ALbuffer; + +typedef ALvoid (*MixerFunc)(struct ALsource *self, ALCdevice *Device, + const ALvoid *RESTRICT data, + ALuint *DataPosInt, ALuint *DataPosFrac, + ALuint OutPos, ALuint SamplesToDo, + ALuint BufferSize); + +typedef enum { + POINT_RESAMPLER = 0, + LINEAR_RESAMPLER, + CUBIC_RESAMPLER, + + RESAMPLER_MAX, + RESAMPLER_MIN = -1, + RESAMPLER_DEFAULT = LINEAR_RESAMPLER +} resampler_t; + typedef enum { FRONT_LEFT = 0, FRONT_RIGHT, @@ -110,16 +129,15 @@ static __inline ALdouble cubic(ALdouble val0, ALdouble val1, ALdouble val2, ALdo return a0*mu*mu2 + a1*mu2 + a2*mu + a3; } -struct ALsource; -struct ALbuffer; - ALvoid aluInitPanning(ALCdevice *Device); ALint aluCart2LUTpos(ALfloat re, ALfloat im); ALvoid CalcSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext); ALvoid CalcNonAttnSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext); -ALvoid SelectMixer(struct ALsource *Source, struct ALbuffer *Buffer); +MixerFunc SelectMixer(struct ALbuffer *Buffer, resampler_t Resampler); +MixerFunc SelectHrtfMixer(struct ALbuffer *Buffer, resampler_t Resampler); + ALvoid MixSource(struct ALsource *Source, ALCdevice *Device, ALuint SamplesToDo); ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size); |