8 #include "alAuxEffectSlot.h"
12 typedef struct ALnullState
{
13 DERIVE_FROM_TYPE(ALeffectState
);
17 /* This destructs (not free!) the effect state. It's called only when the
18 * effect slot is no longer used.
20 static ALvoid
ALnullState_Destruct(ALnullState
* UNUSED(state
))
24 /* This updates the device-dependant effect state. This is called on
25 * initialization and any time the device parameters (eg. playback frequency,
26 * format) have been changed.
28 static ALboolean
ALnullState_deviceUpdate(ALnullState
* UNUSED(state
), ALCdevice
* UNUSED(device
))
33 /* This updates the effect state. This is called any time the effect is
34 * (re)loaded into a slot.
36 static ALvoid
ALnullState_update(ALnullState
* UNUSED(state
), const ALCdevice
* UNUSED(device
), const ALeffectslot
* UNUSED(slot
))
40 /* This processes the effect state, for the given number of samples from the
41 * input to the output buffer. The result should be added to the output buffer,
44 static ALvoid
ALnullState_process(ALnullState
* UNUSED(state
), ALuint
UNUSED(samplesToDo
), const ALfloatBUFFERSIZE
*restrict
UNUSED(samplesIn
), ALfloatBUFFERSIZE
*restrict
UNUSED(samplesOut
), ALuint
UNUSED(NumChannels
))
48 /* This allocates memory to store the object, before it gets constructed.
49 * DECLARE_DEFAULT_ALLOCATORS can be used to declate a default method.
51 static void *ALnullState_New(size_t size
)
56 /* This frees the memory used by the object, after it has been destructed.
57 * DECLARE_DEFAULT_ALLOCATORS can be used to declate a default method.
59 static void ALnullState_Delete(void *ptr
)
64 /* Define the forwards and the ALeffectState vtable for this type. */
65 DEFINE_ALEFFECTSTATE_VTABLE(ALnullState
);
68 typedef struct ALnullStateFactory
{
69 DERIVE_FROM_TYPE(ALeffectStateFactory
);
72 /* Creates ALeffectState objects of the appropriate type. */
73 ALeffectState
*ALnullStateFactory_create(ALnullStateFactory
*UNUSED(factory
))
77 state
= ALnullState_New(sizeof(*state
));
78 if(!state
) return NULL
;
79 /* Set vtables for inherited types. */
80 SET_VTABLE2(ALnullState
, ALeffectState
, state
);
82 return STATIC_CAST(ALeffectState
, state
);
85 /* Define the ALeffectStateFactory vtable for this type. */
86 DEFINE_ALEFFECTSTATEFACTORY_VTABLE(ALnullStateFactory
);
88 ALeffectStateFactory
*ALnullStateFactory_getFactory(void)
90 static ALnullStateFactory NullFactory
= { { GET_VTABLE2(ALnullStateFactory
, ALeffectStateFactory
) } };
92 return STATIC_CAST(ALeffectStateFactory
, &NullFactory
);
96 void ALnull_setParami(ALeffect
* UNUSED(effect
), ALCcontext
*context
, ALenum param
, ALint
UNUSED(val
))
101 SET_ERROR_AND_RETURN(context
, AL_INVALID_ENUM
);
104 void ALnull_setParamiv(ALeffect
* UNUSED(effect
), ALCcontext
*context
, ALenum param
, const ALint
* UNUSED(vals
))
109 SET_ERROR_AND_RETURN(context
, AL_INVALID_ENUM
);
112 void ALnull_setParamf(ALeffect
* UNUSED(effect
), ALCcontext
*context
, ALenum param
, ALfloat
UNUSED(val
))
117 SET_ERROR_AND_RETURN(context
, AL_INVALID_ENUM
);
120 void ALnull_setParamfv(ALeffect
* UNUSED(effect
), ALCcontext
*context
, ALenum param
, const ALfloat
* UNUSED(vals
))
125 SET_ERROR_AND_RETURN(context
, AL_INVALID_ENUM
);
129 void ALnull_getParami(const ALeffect
* UNUSED(effect
), ALCcontext
*context
, ALenum param
, ALint
* UNUSED(val
))
134 SET_ERROR_AND_RETURN(context
, AL_INVALID_ENUM
);
137 void ALnull_getParamiv(const ALeffect
* UNUSED(effect
), ALCcontext
*context
, ALenum param
, ALint
* UNUSED(vals
))
142 SET_ERROR_AND_RETURN(context
, AL_INVALID_ENUM
);
145 void ALnull_getParamf(const ALeffect
* UNUSED(effect
), ALCcontext
*context
, ALenum param
, ALfloat
* UNUSED(val
))
150 SET_ERROR_AND_RETURN(context
, AL_INVALID_ENUM
);
153 void ALnull_getParamfv(const ALeffect
* UNUSED(effect
), ALCcontext
*context
, ALenum param
, ALfloat
* UNUSED(vals
))
158 SET_ERROR_AND_RETURN(context
, AL_INVALID_ENUM
);
162 DEFINE_ALEFFECT_VTABLE(ALnull
);