summaryrefslogtreecommitdiff
path: root/include/d/snd/d_snd_harp_song_data.h
blob: 9ca29b0e21db5a07b588bb2cf0cb84c68f313e84 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef D_SND_HARP_SONG_DATA_H
#define D_SND_HARP_SONG_DATA_H

#include "common.h"

class dSndHarpSongEntryBase_c {
public:
    dSndHarpSongEntryBase_c(s16 count, s16 stride);
    ~dSndHarpSongEntryBase_c();

    void insert(u32 idx, s16 value);
    s32 get(u32 idx) const;

    void reset();

private:
    /* 0x00 */ s16 *mpData;
    /* 0x04 */ u16 mCount;
    /* 0x06 */ u16 mStride;
};

class dSndHarpSongEntry1_c : public dSndHarpSongEntryBase_c {
    static const s32 NUM_ENTRIES_TYPE_1 = 24;

public:
    dSndHarpSongEntry1_c();
    void loadStaticData(s32 i1, u32 i2, s32 i3);
    s16 getStaticDatum(u32 idx) const;

private:
    /* 0x08 */ s16 mStaticValues[24];
};

class dSndHarpSongEntry2_c : public dSndHarpSongEntryBase_c {
    static const s32 NUM_ENTRIES_TYPE_2 = 12;

public:
    dSndHarpSongEntry2_c() : dSndHarpSongEntryBase_c(NUM_ENTRIES_TYPE_2, NUM_ENTRIES_TYPE_2 * 2) {}

private:
};

class dSndHarpSongData_c {
public:
    dSndHarpSongData_c();

    void init(u32 idx);
    void loadStaticValues();

    void insert2(u32 key, s16 value, s32);
    void insert1(u32 key, s16 value);

    static const s32 sNumHarpSongs;

    void setSoundId(u32 id) {
        mSoundId = id;
    }

private:
    /* 0x00 */ u32 mSoundId;
    /* 0x04 */ u32 mIndex;
    /* 0x08 */ UNKWORD field_0x08;
    /* 0x0C */ f32 field_0x0C;
    /* 0x10 */ dSndHarpSongEntry2_c mEntries2[4][2][2];
    /* 0x90 */ UNKWORD field_0x90[4][2];
    /* 0xB0 */ dSndHarpSongEntry1_c mEntries1[4][2];
};

#endif