diff options
author | Chris Robinson <[email protected]> | 2013-05-21 04:18:02 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-21 04:18:02 -0700 |
commit | 5516d8df0b21722c96189b946a8a10e9cbb0c001 (patch) | |
tree | c35fb0bf09965f0d528d40e984e529f3b8f3bac8 /Alc/alcChorus.c | |
parent | fba9ac6db1d1d1bff066befe48f75c64aead3587 (diff) |
Use macros to help define vtables for effect states
Diffstat (limited to 'Alc/alcChorus.c')
-rw-r--r-- | Alc/alcChorus.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Alc/alcChorus.c b/Alc/alcChorus.c index f02544c4..c34396eb 100644 --- a/Alc/alcChorus.c +++ b/Alc/alcChorus.c @@ -50,7 +50,7 @@ typedef struct ALchorusState { ALfloat feedback; } ALchorusState; -static ALvoid ChorusDestroy(ALeffectState *effect) +static ALvoid ALchorusState_Destroy(ALeffectState *effect) { ALchorusState *state = STATIC_UPCAST(ALchorusState, ALeffectState, effect); @@ -63,7 +63,7 @@ static ALvoid ChorusDestroy(ALeffectState *effect) free(state); } -static ALboolean ChorusDeviceUpdate(ALeffectState *effect, ALCdevice *Device) +static ALboolean ALchorusState_DeviceUpdate(ALeffectState *effect, ALCdevice *Device) { ALchorusState *state = STATIC_UPCAST(ALchorusState, ALeffectState, effect); ALuint maxlen; @@ -96,7 +96,7 @@ static ALboolean ChorusDeviceUpdate(ALeffectState *effect, ALCdevice *Device) return AL_TRUE; } -static ALvoid ChorusUpdate(ALeffectState *effect, ALCdevice *Device, const ALeffectslot *Slot) +static ALvoid ALchorusState_Update(ALeffectState *effect, ALCdevice *Device, const ALeffectslot *Slot) { ALchorusState *state = STATIC_UPCAST(ALchorusState, ALeffectState, effect); ALfloat frequency = Device->Frequency; @@ -234,7 +234,7 @@ DECL_TEMPLATE(Sinusoid) #undef DECL_TEMPLATE -static ALvoid ChorusProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) +static ALvoid ALchorusState_Process(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) { ALchorusState *state = STATIC_UPCAST(ALchorusState, ALeffectState, effect); @@ -244,18 +244,15 @@ static ALvoid ChorusProcess(ALeffectState *effect, ALuint SamplesToDo, const ALf ProcessSinusoid(state, SamplesToDo, SamplesIn, SamplesOut); } +DEFINE_ALEFFECTSTATE_VTABLE(ALchorusState); + ALeffectState *ChorusCreate(void) { ALchorusState *state; state = malloc(sizeof(*state)); - if(!state) - return NULL; - - STATIC_CAST(ALeffectState, state)->Destroy = ChorusDestroy; - STATIC_CAST(ALeffectState, state)->DeviceUpdate = ChorusDeviceUpdate; - STATIC_CAST(ALeffectState, state)->Update = ChorusUpdate; - STATIC_CAST(ALeffectState, state)->Process = ChorusProcess; + if(!state) return NULL; + SET_VTABLE2(ALchorusState, ALeffectState, state); state->BufferLength = 0; state->SampleBufferLeft = NULL; |