summaryrefslogtreecommitdiff
path: root/src/JSystem/JAudio/JASNoteMgr.cpp
blob: 4e596e48f37c28d997587a4d67348ebbea964ba0 (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
//
// Generated by dtk
// Translation Unit: JASNoteMgr.cpp
//

#include "JSystem/JSystem.h" // IWYU pragma: keep

#include "JSystem/JAudio/JASTrack.h"
#include "JSystem/JAudio/JASChannel.h"
#include "JSystem/JUtility/JUTAssert.h"

static const int MULTI_MAX = 8;

/* 8027DD54-8027DD94       .text init__Q38JASystem6TTrack8TNoteMgrFv */
void JASystem::TTrack::TNoteMgr::init() {
    mBaseTime = 0;
    mConnectCase = 0;
    mLastNote = 0;
    mBeforeTieMode = 0;
    for (int i = 0; i < MULTI_MAX; i++) {
        field_0x0[i] = NULL;
        field_0x20[i] = 0;
    }
}

/* 8027DD94-8027DDBC       .text endProcess__Q38JASystem6TTrack8TNoteMgrFv */
void JASystem::TTrack::TNoteMgr::endProcess() {
    if (mBaseTime == 0xffffffff) {
        return;
    }
    if (mConnectCase != 0) {
        return;
    }
    field_0x0[0] = NULL;
}

/* 8027DDBC-8027DE78       .text setChannel__Q38JASystem6TTrack8TNoteMgrFiPQ28JASystem8TChannel */
void JASystem::TTrack::TNoteMgr::setChannel(int index, JASystem::TChannel* channel) {
    JUT_ASSERT(44, index >= 0);
    JUT_ASSERT(45, index < MULTI_MAX);
    field_0x0[index] = channel;
    field_0x20[index] = channel->field_0xc8;
}

/* 8027DE78-8027DF24       .text releaseChannel__Q38JASystem6TTrack8TNoteMgrFi */
void JASystem::TTrack::TNoteMgr::releaseChannel(int index) {
    JUT_ASSERT(53, index >= 0);
    JUT_ASSERT(54, index < MULTI_MAX);
    field_0x0[index] = NULL;
}

/* 8027DF24-8027DFD8       .text getChannel__Q38JASystem6TTrack8TNoteMgrFi */
JASystem::TChannel* JASystem::TTrack::TNoteMgr::getChannel(int index) {
    JUT_ASSERT(61, index >= 0);
    if (index >= MULTI_MAX) {
        return NULL;
    }
    TChannel* channel = field_0x0[index];
    if (!channel) {
        return NULL;
    }
    if (field_0x20[index] != channel->field_0xc8) {
        field_0x0[index] = NULL;
        return NULL;
    }
    return channel;
}