summaryrefslogtreecommitdiff
path: root/include/nw4r/snd/snd_FxDelay.h
blob: 54379a8cf39d389eebecb0b0e722a500db25c323 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef NW4R_SND_FX_DELAY_H
#define NW4R_SND_FX_DELAY_H
#include "nw4r/snd/snd_AxfxImpl.h"
#include "nw4r/snd/snd_FxBase.h"
#include "nw4r/types_nw4r.h"
#include "rvl/AXFX.h" // IWYU pragma: export

namespace nw4r {
namespace snd {

class FxDelay : public FxBase {
public:
    struct DelayParam {
        f32 delay;    // at 0x0
        f32 feedback; // at 0x4
        f32 outGain;  // at 0x8
    };

public:
    FxDelay();

    virtual ~FxDelay() {
        Shutdown();
        ReleaseWorkBuffer();
    } // at 0x8

    virtual bool StartUp();  // at 0xC
    virtual void Shutdown(); // at 0x10

    virtual void UpdateBuffer(
        int channels, void **ppBuffer, u32 size, SampleFormat format, f32 sampleRate,
        OutputMode mode
    ); // at 0x14

    virtual bool AssignWorkBuffer(void *pBuffer, u32 size); // at 0x18
    virtual void ReleaseWorkBuffer();                       // at 0x1C

    u32 GetRequiredMemSize();
    bool SetParam(const DelayParam &rParam);

private:
    detail::AxfxImpl mImpl; // at 0xC
    DelayParam mParam;      // at 0x18
    AXFX_DELAY mAxfxParam;  // at 0x24
};

} // namespace snd
} // namespace nw4r

#endif