9 #include "core/bufferline.h"
10 #include "intrusive_ptr.h"
19 struct NullState final
: public EffectState
{
21 ~NullState() override
;
23 void deviceUpdate(const DeviceBase
*device
, const Buffer
&buffer
) override
;
24 void update(const ContextBase
*context
, const EffectSlot
*slot
, const EffectProps
*props
,
25 const EffectTarget target
) override
;
26 void process(const size_t samplesToDo
, const al::span
<const FloatBufferLine
> samplesIn
,
27 const al::span
<FloatBufferLine
> samplesOut
) override
;
32 /* This constructs the effect state. It's called when the object is first
35 NullState::NullState() = default;
37 /* This destructs the effect state. It's called only when the effect instance
40 NullState::~NullState() = default;
42 /* This updates the device-dependant effect state. This is called on state
43 * initialization and any time the device parameters (e.g. playback frequency,
44 * format) have been changed. Will always be followed by a call to the update
45 * method, if successful.
47 void NullState::deviceUpdate(const DeviceBase
* /*device*/, const Buffer
& /*buffer*/)
51 /* This updates the effect state with new properties. This is called any time
52 * the effect is (re)loaded into a slot.
54 void NullState::update(const ContextBase
* /*context*/, const EffectSlot
* /*slot*/,
55 const EffectProps
* /*props*/, const EffectTarget
/*target*/)
59 /* This processes the effect state, for the given number of samples from the
60 * input to the output buffer. The result should be added to the output buffer,
63 void NullState::process(const size_t/*samplesToDo*/,
64 const al::span
<const FloatBufferLine
> /*samplesIn*/,
65 const al::span
<FloatBufferLine
> /*samplesOut*/)
70 struct NullStateFactory final
: public EffectStateFactory
{
71 al::intrusive_ptr
<EffectState
> create() override
;
74 /* Creates EffectState objects of the appropriate type. */
75 al::intrusive_ptr
<EffectState
> NullStateFactory::create()
76 { return al::intrusive_ptr
<EffectState
>{new NullState
{}}; }
80 EffectStateFactory
*NullStateFactory_getFactory()
82 static NullStateFactory NullFactory
{};