blob: ee376ac9ca6c612b8657c5b84356911db131178c (
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
|
#include "d/snd/d_snd_bgm_sound_harp_mgr.h"
#include "common.h"
dSndBgmSoundHarpMgr_c::dSndBgmSoundHarpMgr_c()
: mpCurrVarSet(nullptr), mSoundId(-1), mTempo(-1), mPrevIdx(-1), mIsLoaded(false) {
reset();
}
void dSndBgmSoundHarpMgr_c::setSoundId(u32 soundId) {
mSoundId = soundId;
}
void dSndBgmSoundHarpMgr_c::setLoaded() {
mIsLoaded = true;
}
void dSndBgmSoundHarpMgr_c::reset() {
mSoundId = -1;
mTempo = -1;
mPrevIdx = -1;
mHarpData.resetVars();
mpCurrVarSet = 0;
mIsLoaded = false;
}
void dSndBgmSoundHarpMgr_c::setPlaySamplePosition(s32 position) {
if (position < 0) {
return;
}
s32 idx = mHarpData.getIdxForPosition(position);
if (idx != mPrevIdx && idx >= 0) {
mHarpData.writeSeqVars(idx);
mpCurrVarSet = mHarpData.getUsableVarSet(idx);
mPrevIdx = idx;
}
}
dSndBgmDataHarpVarSetBase_c *dSndBgmSoundHarpMgr_c::getCurrentVarSet() {
return mpCurrVarSet;
}
|