Files
ss/include/nw4r/snd/snd_Lfo.h
T
Elijah Thomas 26af4db82d update from dtk-template - clangd :) (#66)
* update from dtk-template and start work towards using clangd

* include <a> -> "a"

* Update build.yml

* remove/add non-trivial class in union warning
2024-10-16 15:36:02 -04:00

56 lines
901 B
C++

#ifndef NW4R_SND_LFO_H
#define NW4R_SND_LFO_H
#include "nw4r/types_nw4r.h"
namespace nw4r {
namespace snd {
namespace detail {
struct LfoParam {
LfoParam() {
Init();
}
void Init();
f32 depth; // at 0x0
f32 speed; // at 0x4
u32 delay; // at 0x8
u8 range; // at 0xC
u8 padding[3]; // at 0xD
};
class Lfo {
public:
Lfo() : mDelayCounter(0), mCounter(0.0f) {}
LfoParam &GetParam() {
return mParam;
}
void SetParam(const LfoParam &rParam) {
mParam = rParam;
}
void Reset();
void Update(int msec);
f32 GetValue() const;
private:
static const int TABLE_SIZE = 32;
private:
static s8 GetSinIdx(int i);
private:
LfoParam mParam; // at 0x0
u32 mDelayCounter; // at 0x10
f32 mCounter; // at 0x14
};
} // namespace detail
} // namespace snd
} // namespace nw4r
#endif