| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | |
| 5 | namespace al { |
| 6 | class IUseAudioKeeper; |
| 7 | |
| 8 | class BgmBeatCounter { |
| 9 | public: |
| 10 | BgmBeatCounter(IUseAudioKeeper* audioKeeper, f32 triggerBeatOffset); |
| 11 | void update(); |
| 12 | bool isTriggerBeat(s32 interval, s32 delayTime) const; |
| 13 | |
| 14 | bool isOnBeat() const { return mIsOnBeat; } |
| 15 | |
| 16 | private: |
| 17 | IUseAudioKeeper* mAudioKeeper = nullptr; |
| 18 | f32 mTriggerBeatOffset = 0.0f; |
| 19 | f32 mCurBeatWithOffset = 0.0f; |
| 20 | f32 mPrevBeat = 0.0f; |
| 21 | bool mIsOnBeat = false; |
| 22 | }; |
| 23 | |
| 24 | } // namespace al |
| 25 |