8 #include "core/bufferline.h"
9 #include "core/effects/base.h"
10 #include "intrusive_ptr.h"
20 struct NullState final
: public EffectState
{
22 ~NullState() override
;
24 void deviceUpdate(const DeviceBase
*device
, const BufferStorage
*buffer
) override
;
25 void update(const ContextBase
*context
, const EffectSlot
*slot
, const EffectProps
*props
,
26 const EffectTarget target
) override
;
27 void process(const size_t samplesToDo
, const al::span
<const FloatBufferLine
> samplesIn
,
28 const al::span
<FloatBufferLine
> samplesOut
) override
;
31 /* This constructs the effect state. It's called when the object is first
34 NullState::NullState() = default;
36 /* This destructs the effect state. It's called only when the effect instance
39 NullState::~NullState() = default;
41 /* This updates the device-dependant effect state. This is called on state
42 * initialization and any time the device parameters (e.g. playback frequency,
43 * format) have been changed. Will always be followed by a call to the update
44 * method, if successful.
46 void NullState::deviceUpdate(const DeviceBase
* /*device*/, const BufferStorage
* /*buffer*/)
50 /* This updates the effect state with new properties. This is called any time
51 * the effect is (re)loaded into a slot.
53 void NullState::update(const ContextBase
* /*context*/, const EffectSlot
* /*slot*/,
54 const EffectProps
* /*props*/, const EffectTarget
/*target*/)
58 /* This processes the effect state, for the given number of samples from the
59 * input to the output buffer. The result should be added to the output buffer,
62 void NullState::process(const size_t/*samplesToDo*/,
63 const al::span
<const FloatBufferLine
> /*samplesIn*/,
64 const al::span
<FloatBufferLine
> /*samplesOut*/)
69 struct NullStateFactory final
: public EffectStateFactory
{
70 al::intrusive_ptr
<EffectState
> create() override
;
73 /* Creates EffectState objects of the appropriate type. */
74 al::intrusive_ptr
<EffectState
> NullStateFactory::create()
75 { return al::intrusive_ptr
<EffectState
>{new NullState
{}}; }
79 EffectStateFactory
*NullStateFactory_getFactory()
81 static NullStateFactory NullFactory
{};