thirdparty/openal-soft-1.10.622/Alc/alcReverb.c
ALeffectState *VerbCreate(void)
{
    ALverbState *State = NULL;
    ALuint index;

    State = malloc(sizeof(ALverbState));
    if(!State)
    {
        alSetError(AL_OUT_OF_MEMORY);
        return NULL;
    }

    State->state.Destroy = VerbDestroy;
    State->state.DeviceUpdate = VerbDeviceUpdate;
    State->state.Update = VerbUpdate;
    State->state.Process = VerbProcess;

    State->TotalLength = 0;
    State->SampleBuffer = NULL;

    State->LpFilter.coeff = 0.0f;
    State->LpFilter.history[0] = 0.0f;
    State->LpFilter.history[1] = 0.0f;
    State->Delay.Mask = 0;
    State->Delay.Line = NULL;

    State->Tap[0] = 0;
    State->Tap[1] = 0;
    State->Tap[2] = 0;
    State->Tap[3] = 0;
    State->Tap[4] = 0;

    State->Early.Gain = 0.0f;
    for(index = 0;index < 4;index++)
    {
        State->Early.Coeff[index] = 0.0f;
        State->Early.Delay[index].Mask = 0;
        State->Early.Delay[index].Line = NULL;
        State->Early.Offset[index] = 0;
    }

    State->Late.Gain = 0.0f;
    State->Late.DensityGain = 0.0f;
    State->Late.ApFeedCoeff = 0.0f;
    State->Late.MixCoeff = 0.0f;

    for(index = 0;index < 4;index++)
    {
        State->Late.ApCoeff[index] = 0.0f;
        State->Late.ApDelay[index].Mask = 0;
        State->Late.ApDelay[index].Line = NULL;
        State->Late.ApOffset[index] = 0;

        State->Late.Coeff[index] = 0.0f;
        State->Late.Delay[index].Mask = 0;
        State->Late.Delay[index].Line = NULL;
        State->Late.Offset[index] = 0;

        State->Late.LpCoeff[index] = 0.0f;
        State->Late.LpSample[index] = 0.0f;
    }

    // Panning is applied as an independent gain for each output channel.
    for(index = 0;index < OUTPUTCHANNELS;index++)
    {
        State->Early.PanGain[index] = 0.0f;
        State->Late.PanGain[index] = 0.0f;
    }

    State->Offset = 0;
    return &State->state;
}
// This creates the reverb state.  It should be called only when the reverb
// effect is loaded into a slot that doesn't already have a reverb effect.
This creates the reverb state.  It should be called only when the reverb
effect is loaded into a slot that doesn't already have a reverb effect.
This creates the reverb state . It should be called only when the reverb effect is loaded into a slot that doesn ' t already have a reverb effect .
ALeffectState *VerbCreate(void)
{
    ALverbState *State = NULL;
    ALuint index;
    State = malloc(sizeof(ALverbState));
    if(!State)
    {
        alSetError(AL_OUT_OF_MEMORY);
        return NULL;
    }
    State->state.Destroy = VerbDestroy;
    State->state.DeviceUpdate = VerbDeviceUpdate;
    State->state.Update = VerbUpdate;
    State->state.Process = VerbProcess;
    State->TotalLength = 0;
    State->SampleBuffer = NULL;
    State->LpFilter.coeff = 0.0f;
    State->LpFilter.history[0] = 0.0f;
    State->LpFilter.history[1] = 0.0f;
    State->Delay.Mask = 0;
    State->Delay.Line = NULL;
    State->Tap[0] = 0;
    State->Tap[1] = 0;
    State->Tap[2] = 0;
    State->Tap[3] = 0;
    State->Tap[4] = 0;
    State->Early.Gain = 0.0f;
    for(index = 0;index < 4;index++)
    {
        State->Early.Coeff[index] = 0.0f;
        State->Early.Delay[index].Mask = 0;
        State->Early.Delay[index].Line = NULL;
        State->Early.Offset[index] = 0;
    }
    State->Late.Gain = 0.0f;
    State->Late.DensityGain = 0.0f;
    State->Late.ApFeedCoeff = 0.0f;
    State->Late.MixCoeff = 0.0f;
    for(index = 0;index < 4;index++)
    {
        State->Late.ApCoeff[index] = 0.0f;
        State->Late.ApDelay[index].Mask = 0;
        State->Late.ApDelay[index].Line = NULL;
        State->Late.ApOffset[index] = 0;
        State->Late.Coeff[index] = 0.0f;
        State->Late.Delay[index].Mask = 0;
        State->Late.Delay[index].Line = NULL;
        State->Late.Offset[index] = 0;
        State->Late.LpCoeff[index] = 0.0f;
        State->Late.LpSample[index] = 0.0f;
    }
    for(index = 0;index < OUTPUTCHANNELS;index++)
    {
        State->Early.PanGain[index] = 0.0f;
        State->Late.PanGain[index] = 0.0f;
    }
    State->Offset = 0;
    return &State->state;
}
ALeffectState * VerbCreate ( void ) { ALverbState * State = NULL ; ALuint index ; State = malloc ( sizeof ( ALverbState ) ) ; if ( ! State ) { alSetError ( AL_OUT_OF_MEMORY ) ; return NULL ; } State -> state . Destroy = VerbDestroy ; State -> state . DeviceUpdate = VerbDeviceUpdate ; State -> state . Update = VerbUpdate ; State -> state . Process = VerbProcess ; State -> TotalLength = 0 ; State -> SampleBuffer = NULL ; State -> LpFilter . coeff = 0.0f ; State -> LpFilter . history [ 0 ] = 0.0f ; State -> LpFilter . history [ 1 ] = 0.0f ; State -> Delay . Mask = 0 ; State -> Delay . Line = NULL ; State -> Tap [ 0 ] = 0 ; State -> Tap [ 1 ] = 0 ; State -> Tap [ 2 ] = 0 ; State -> Tap [ 3 ] = 0 ; State -> Tap [ 4 ] = 0 ; State -> Early . Gain = 0.0f ; for ( index = 0 ; index < 4 ; index ++ ) { State -> Early . Coeff [ index ] = 0.0f ; State -> Early . Delay [ index ] . Mask = 0 ; State -> Early . Delay [ index ] . Line = NULL ; State -> Early . Offset [ index ] = 0 ; } State -> Late . Gain = 0.0f ; State -> Late . DensityGain = 0.0f ; State -> Late . ApFeedCoeff = 0.0f ; State -> Late . MixCoeff = 0.0f ; for ( index = 0 ; index < 4 ; index ++ ) { State -> Late . ApCoeff [ index ] = 0.0f ; State -> Late . ApDelay [ index ] . Mask = 0 ; State -> Late . ApDelay [ index ] . Line = NULL ; State -> Late . ApOffset [ index ] = 0 ; State -> Late . Coeff [ index ] = 0.0f ; State -> Late . Delay [ index ] . Mask = 0 ; State -> Late . Delay [ index ] . Line = NULL ; State -> Late . Offset [ index ] = 0 ; State -> Late . LpCoeff [ index ] = 0.0f ; State -> Late . LpSample [ index ] = 0.0f ; } for ( index = 0 ; index < OUTPUTCHANNELS ; index ++ ) { State -> Early . PanGain [ index ] = 0.0f ; State -> Late . PanGain [ index ] = 0.0f ; } State -> Offset = 0 ; return & State -> state ; }
This creates the reverb state.
This creates the reverb state .
// Panning is applied as an independent gain for each output channel.