Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JASChannel.h
Go to the documentation of this file.
1#ifndef JASCHANNEL_H
2#define JASCHANNEL_H
3
10
11class JASDSPChannel;
12
13namespace JASDsp {
14 struct TChannel;
15}
16
22public:
24 mVolume = 1.0f;
25 mPitch = 1.0f;
26 field_0x8 = 0.0f;
27 mPan = 0.5f;
28 mFxMix = 0.0f;
29 mDolby = 0.0f;
30 }
31 void init() {
32 mVolume = 1.0f;
33 mPitch = 1.0f;
34 field_0x8 = 0.0f;
35 mPan = 0.5f;
36 mFxMix = 0.0f;
37 mDolby = 0.0f;
38 }
39
40 /* 0x00 */ f32 mVolume;
41 /* 0x04 */ f32 mPitch;
42 /* 0x08 */ f32 field_0x8;
43 /* 0x0C */ f32 mPan;
44 /* 0x10 */ f32 mFxMix;
45 /* 0x14 */ f32 mDolby;
46};
47
52class JASChannel : public JASPoolAllocObject_MultiThreaded<JASChannel> {
53public:
55
57 /* 0 */ CB_PLAY,
58 /* 1 */ CB_START,
59 /* 2 */ CB_STOP,
60 /* 3 */ CB_TIMER,
61 };
62
63 enum Status {
67 };
68
69 struct PanVector {
70 /* 0x0 */ f32 mSound;
71 /* 0x4 */ f32 mEffect;
72 /* 0x8 */ f32 mChannel;
73 };
74
75 union MixConfig {
77 struct {
82 };
83
84 /* 8029A800 */ JASChannel(Callback, void*);
85 /* 8029A918 */ ~JASChannel();
86 /* 8029A9F0 */ int play();
87 /* 8029AA60 */ int playForce();
88 /* 8029AAD0 */ void release(u16);
89 /* 8029AB64 */ void setOscInit(u32, JASOscillator::Data const*);
90 /* 8029AB98 */ void setMixConfig(u32, u16);
91 /* 8029ABA8 */ static f32 calcEffect(JASChannel::PanVector const*);
92 /* 8029ABC0 */ static f32 calcPan(JASChannel::PanVector const*);
93 /* 8029ABEC */ void effectOsc(u32, JASOscillator::EffectParams*);
94 /* 8029ACD4 */ void setKeySweepTarget(s32, u32);
95 /* 8029AD38 */ void updateEffectorParam(JASDsp::TChannel*, u16*,
97 /* 8029AF78 */ static s32 dspUpdateCallback(u32, JASDsp::TChannel*, void*);
99 /* 8029B324 */ s32 updateDSPChannel(JASDsp::TChannel*);
100 /* 8029B6A0 */ void updateAutoMixer(JASDsp::TChannel*, f32, f32, f32, f32);
101 /* 8029B7D8 */ void updateMixer(f32, f32, f32, f32, u16*);
102 /* 8029BBFC */ void free();
103 /* 8029BC0C */ static void initBankDisposeMsgQueue();
104 /* 8029BC48 */ static void receiveBankDisposeMsg();
105 /* 8029BCC0 */ bool checkBankDispose() const;
106
131 bool isDolbyMode() { return mMixConfig[0].whole == 0xffff; }
132
133 /* 0x00 */ int mStatus;
134 /* 0x04 */ bool mPauseFlag;
136 /* 0x0C */ Callback mCallback;
137 /* 0x10 */ void* mCallbackData;
138 /* 0x14 */ u32 mUpdateTimer;
139 /* 0x18 */ const void* mBankDisposeID;
141 /* 0x5C */ JASLfo mVibrate;
142 /* 0x74 */ JASLfo mTremolo;
143 /* 0x8C */ MixConfig mMixConfig[6];
144 /* 0x98 */ u16 mPriority;
147 /* 0xC8 */ s16 mKey;
148 /* 0xCA */ u16 mVelocity;
149 /* 0xCC */ f32 mKeySweep;
151 /* 0xD4 */ u32 mKeySweepCount;
152 /* 0xD8 */ u32 mSkipSamples;
153 struct {
158
163};
164
165#endif /* JASCHANNEL_H */
void * OSMessage
Definition OSMessage.h:10
T cLib_calcTimer(T *value)
Definition c_lib.h:74
Definition JASChannel.h:21
f32 mFxMix
Definition JASChannel.h:44
f32 mVolume
Definition JASChannel.h:40
f32 mPan
Definition JASChannel.h:43
f32 mDolby
Definition JASChannel.h:45
f32 mPitch
Definition JASChannel.h:41
void init()
Definition JASChannel.h:31
f32 field_0x8
Definition JASChannel.h:42
JASChannelParams()
Definition JASChannel.h:23
Definition JASAudioThread.cpp:53
int playForce()
Definition JASChannel.cpp:81
void setTremolo(f32 param_0, f32 param_1)
Definition JASChannel.h:116
void setInitDolby(f32 param_0)
Definition JASChannel.h:127
void setPriority(u16 param_0)
Definition JASChannel.h:121
void setVelocity(u32 param_0)
Definition JASChannel.h:129
void setKey(s32 param_0)
Definition JASChannel.h:128
u32 field_0x0
Definition JASChannel.h:154
Callback mCallback
Definition JASChannel.h:136
static void receiveBankDisposeMsg()
Definition JASChannel.cpp:519
int play()
Definition JASChannel.cpp:68
void updateMixer(f32, f32, f32, f32, u16 *)
Definition JASChannel.cpp:413
JASLfo mVibrate
Definition JASChannel.h:141
void setUpdateTimer(u32 param_0)
Definition JASChannel.h:108
void setParams(const JASChannelParams &param_0)
Definition JASChannel.h:122
void setPauseFlag(bool param_0)
Definition JASChannel.h:107
static int sBankDisposeListSize
Definition JASChannel.h:162
s32 updateDSPChannel(JASDsp::TChannel *)
Definition JASChannel.cpp:325
void setInitVolume(f32 param_0)
Definition JASChannel.h:123
static OSMessageQueue sBankDisposeMsgQ
Definition JASChannel.h:159
static void initBankDisposeMsgQueue()
Definition JASChannel.cpp:513
void setInitFxmix(f32 param_0)
Definition JASChannel.h:124
void * mCallbackData
Definition JASChannel.h:137
u32 mSkipSamples
Definition JASChannel.h:152
f32 mKeySweep
Definition JASChannel.h:149
static OSMessage sBankDisposeList[16]
Definition JASChannel.h:161
s32 initialUpdateDSPChannel(JASDsp::TChannel *)
Definition JASChannel.cpp:245
JASChannelParams mParams
Definition JASChannel.h:145
JASWaveInfo field_0x4
Definition JASChannel.h:155
const void * mBankDisposeID
Definition JASChannel.h:139
JASDSPChannel * mDspCh
Definition JASChannel.h:135
void setBankDisposeID(const void *param_0)
Definition JASChannel.h:109
static s32 dspUpdateCallback(u32, JASDsp::TChannel *, void *)
Definition JASChannel.cpp:226
Status
Definition JASChannel.h:63
@ STATUS_RELEASE
Definition JASChannel.h:66
@ STATUS_INACTIVE
Definition JASChannel.h:64
@ STATUS_ACTIVE
Definition JASChannel.h:65
bool mPauseFlag
Definition JASChannel.h:134
~JASChannel()
Definition JASChannel.cpp:57
void updateEffectorParam(JASDsp::TChannel *, u16 *, JASOscillator::EffectParams const &)
Definition JASChannel.cpp:178
int mStatus
Definition JASChannel.h:133
void setKeySweepTarget(s32, u32)
Definition JASChannel.cpp:166
static OSMessage sBankDisposeMsg[16]
Definition JASChannel.h:160
void setMixConfig(u32, u16)
Definition JASChannel.cpp:117
u16 mVelocity
Definition JASChannel.h:148
static f32 calcEffect(JASChannel::PanVector const *)
Definition JASChannel.cpp:123
void(* Callback)(u32, JASChannel *, JASDsp::TChannel *, void *)
Definition JASChannel.h:54
JASSoundParams mSoundParams
Definition JASChannel.h:146
static f32 calcPan(JASChannel::PanVector const *)
Definition JASChannel.cpp:129
void setVibrateDelay(u16 param_0)
Definition JASChannel.h:115
void release(u16)
Definition JASChannel.cpp:95
void setDirectRelease(u16 param_0)
Definition JASChannel.h:110
JASOscillator mOscillators[2]
Definition JASChannel.h:140
void setOscInit(u32, JASOscillator::Data const *)
Definition JASChannel.cpp:112
void setTremoloDelay(u16 param_0)
Definition JASChannel.h:120
bool checkBankDispose() const
Definition JASChannel.cpp:531
void setSkipSamples(u32 param_0)
Definition JASChannel.h:130
CallbackType
Definition JASChannel.h:56
@ CB_TIMER
Definition JASChannel.h:60
@ CB_PLAY
Definition JASChannel.h:57
@ CB_STOP
Definition JASChannel.h:59
@ CB_START
Definition JASChannel.h:58
int field_0x104
Definition JASChannel.h:157
void free()
Definition JASChannel.cpp:507
u32 mUpdateTimer
Definition JASChannel.h:138
s16 mKey
Definition JASChannel.h:147
void setInitPitch(f32 param_0)
Definition JASChannel.h:125
bool isDolbyMode()
Definition JASChannel.h:131
MixConfig mMixConfig[6]
Definition JASChannel.h:143
u16 mPriority
Definition JASChannel.h:144
void setInitPan(f32 param_0)
Definition JASChannel.h:126
f32 mKeySweepTarget
Definition JASChannel.h:150
u32 mKeySweepCount
Definition JASChannel.h:151
JASLfo mTremolo
Definition JASChannel.h:142
void updateAutoMixer(JASDsp::TChannel *, f32, f32, f32, f32)
Definition JASChannel.cpp:401
void effectOsc(u32, JASOscillator::EffectParams *)
Definition JASChannel.cpp:136
void setVibrate(f32 param_0, f32 param_1)
Definition JASChannel.h:111
struct JASChannel::@112 field_0xdc
Definition JASHeapCtrl.h:292
Definition JASAramStream.h:10
Definition JASChannel.h:69
f32 mSound
Definition JASChannel.h:70
f32 mChannel
Definition JASChannel.h:72
f32 mEffect
Definition JASChannel.h:71
Definition JASAudioReseter.cpp:16
Definition JASDSPInterface.h:32
Definition JASLfo.h:10
void setDelay(u16 param_0)
Definition JASLfo.h:18
void setPitch(f32 param_0)
Definition JASLfo.h:17
void setDepth(f32 param_0)
Definition JASLfo.h:16
Definition JASOscillator.h:37
Definition JASOscillator.h:17
Definition JASOscillator.h:10
void setDirectRelease(u16 param_0)
Definition JASOscillator.h:65
Definition JASSoundParams.h:10
f32 mDolby
Definition JASSoundParams.h:68
f32 mFxMix
Definition JASSoundParams.h:65
f32 mPan
Definition JASSoundParams.h:67
f32 mVolume
Definition JASSoundParams.h:64
f32 mPitch
Definition JASSoundParams.h:66
Definition JASWaveInfo.h:10
Definition OSMessage.h:12
unsigned long u32
Definition types.h:10
float f32
Definition types.h:22
signed short s16
Definition types.h:5
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8
Definition JASChannel.h:75
u8 lower1
Definition JASChannel.h:80
struct JASChannel::MixConfig::@113 parts
u8 upper
Definition JASChannel.h:78
u8 lower0
Definition JASChannel.h:79
u16 whole
Definition JASChannel.h:76