JASVoiceBank, JASBasicWaveBank, JASBank, JAUSeqCollection (#1924)

* JASVoiceBank OK

* JASBasicWaveBank

* JASBank

* JAUSeqCollection
This commit is contained in:
Jcw87
2023-09-12 08:14:57 -07:00
committed by GitHub
parent 696024598c
commit 4ab104f390
35 changed files with 600 additions and 860 deletions
+2 -2
View File
@@ -37,9 +37,9 @@ struct JAISeqDataUser {
struct JAISeqDataMgr {
virtual ~JAISeqDataMgr();
virtual int getSeqData(JAISoundID, JAISeqData*) = 0;
virtual s32 getSeqData(JAISoundID, JAISeqData*) = 0;
virtual int releaseSeqData() = 0;
virtual void setSeqDataUser(JAISeqDataUser*) = 0;
virtual bool setSeqDataUser(JAISeqDataUser*) = 0;
};
#endif /* JAISEQDATAMGR_H */
+27
View File
@@ -3,4 +3,31 @@
#include "dolphin/types.h"
class JASChannel;
class JASInstParam;
class JASWaveBank;
namespace JASDsp {
class TChannel;
}
class JASBank {
public:
JASBank() { mWaveBank = NULL; }
virtual ~JASBank() {};
virtual bool getInstParam(int, int, int, JASInstParam*) const = 0;
virtual u32 getType() const = 0;
JASWaveBank* getWaveBank() const { return mWaveBank; }
void assignWaveBank(JASWaveBank* param_0) { mWaveBank = param_0; }
/* 80297930 */ static JASChannel* noteOn(JASBank const*, int, u8, u8, u16,
void (*)(u32, JASChannel*, JASDsp::TChannel*, void*), void*);
/* 80297C40 */ static JASChannel* noteOnOsc(int, u8, u8, u16,
void (*)(u32, JASChannel*, JASDsp::TChannel*, void*), void*);
private:
/* 0x04 */ JASWaveBank* mWaveBank;
};
#endif /* JASBANK_H */
+80 -1
View File
@@ -1,6 +1,85 @@
#ifndef JASBASICWAVEBANK_H
#define JASBASICWAVEBANK_H
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASWaveArcLoader.h"
#include "JSystem/JAudio2/JASWaveInfo.h"
#include "dolphin/os/OSMutex.h"
class JASWaveHandle {
public:
/* virtual */ ~JASWaveHandle() {};
//virtual const JASWaveInfo* getWaveInfo() const = 0;
//virtual int getWavePtr() const = 0;
void* vtable;
};
class JASWaveBank {
public:
/* 80298B88 */ /* virtual */ ~JASWaveBank() {};
//virtual JASWaveHandle* getWaveHandle(u32) const = 0;
//virtual JASWaveArc* getWaveArc(u32) = 0;
//virtual u32 getArcCount() const = 0;
void* vtable;
};
struct JASBasicWaveBank : public JASWaveBank {
struct TWaveHandle : public JASWaveHandle {
/* 802985E4 */ ~TWaveHandle();
/* 80298B64 */ int getWavePtr() const;
/* 80298C18 */ TWaveHandle() { mHeap = NULL; }
/* 80298C64 */ const JASWaveInfo* getWaveInfo() const { return &field_0x4; }
/* 0x04 */ JASWaveInfo field_0x4;
/* 0x28 */ JASHeap* mHeap;
};
struct TGroupWaveInfo {
/* 80298C4C */ TGroupWaveInfo() {
field_0x0 = 0xffff;
field_0x4 = -1;
}
/* 0x00 */ u16 field_0x0;
/* 0x04 */ int field_0x4;
};
struct TWaveGroup {
/* 802989C0 */ TWaveGroup();
/* 80298A0C */ ~TWaveGroup();
/* 80298A84 */ void setWaveCount(u32, JKRHeap*);
/* 80298B04 */ void onLoadDone();
/* 80298B2C */ void onEraseDone();
/* 80298B54 */ u32 getWaveID(int) const;
/* 0x00 */ JASWaveArc base;
/* 0x74 */ JASBasicWaveBank* mBank;
/* 0x78 */ TGroupWaveInfo* mCtrlWaveArray;
/* 0x7C */ u16 mWaveCount;
u32 getWaveCount() const { return mWaveCount; }
};
/* 802984F8 */ JASBasicWaveBank();
/* 80298558 */ ~JASBasicWaveBank();
/* 80298640 */ TWaveGroup* getWaveGroup(u32);
/* 80298664 */ void setGroupCount(u32, JKRHeap*);
/* 80298710 */ void setWaveTableSize(u32, JKRHeap*);
/* 80298790 */ void incWaveTable(JASBasicWaveBank::TWaveGroup const*);
/* 8029883C */ void decWaveTable(JASBasicWaveBank::TWaveGroup const*);
/* 802988DC */ JASWaveHandle* getWaveHandle(u32) const;
/* 80298910 */ void setWaveInfo(JASBasicWaveBank::TWaveGroup*, int, u16, JASWaveInfo const&);
/* 80298C6C */ JASWaveArc* getWaveArc(u32 param_0); // { return getWaveGroup(param_0); }
/* 80298C8C */ u32 getArcCount() const { return mGroupCount; }
/* 0x04 */ OSMutex field_0x4;
/* 0x1C */ TWaveHandle* mWaveTable;
/* 0x20 */ TWaveGroup* mWaveGroupArray;
/* 0x24 */ u16 mHandleCount;
/* 0x26 */ u16 mGroupCount;
static u8 mNoLoad[4 + 4 /* padding */];
};
#endif /* JASBASICWAVEBANK_H */
+123 -1
View File
@@ -1,6 +1,128 @@
#ifndef JASCHANNEL_H
#define JASCHANNEL_H
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASHeapCtrl.h"
#include "JSystem/JAudio2/JASLfo.h"
#include "JSystem/JAudio2/JASOscillator.h"
#include "JSystem/JAudio2/JASSoundParams.h"
#include "JSystem/JAudio2/JASWaveInfo.h"
#include "dolphin/os/OSMessage.h"
class JASDSPChannel;
namespace JASDsp {
struct TChannel;
}
class JASChannelParams {
public:
JASChannelParams() {
field_0x0 = 1.0f;
field_0x4 = 1.0f;
field_0x8 = 0.0f;
field_0xc = 0.5f;
field_0x10 = 0.0f;
field_0x14 = 0.0f;
}
void init() {
field_0x0 = 1.0f;
field_0x4 = 1.0f;
field_0x8 = 0.0f;
field_0xc = 0.5f;
field_0x10 = 0.0f;
field_0x14 = 0.0f;
}
f32 field_0x0;
f32 field_0x4;
f32 field_0x8;
f32 field_0xc;
f32 field_0x10;
f32 field_0x14;
};
class JASChannel : public JASPoolAllocObject_MultiThreaded<JASChannel> {
public:
struct PanVector {};
/* 8029A800 */ JASChannel(void (*)(u32, JASChannel*, JASDsp::TChannel*, void*), void*);
/* 8029A918 */ ~JASChannel();
/* 8029A9F0 */ int play();
/* 8029AA60 */ void playForce();
/* 8029AAD0 */ void release(u16);
/* 8029AB64 */ void setOscInit(u32, JASOscillator::Data const*);
/* 8029AB98 */ void setMixConfig(u32, u16);
/* 8029ABA8 */ void calcEffect(JASChannel::PanVector const*);
/* 8029ABC0 */ void calcPan(JASChannel::PanVector const*);
/* 8029ABEC */ void effectOsc(u32, JASOscillator::EffectParams*);
/* 8029ACD4 */ void setKeySweepTarget(s32, u32);
/* 8029AD38 */ void updateEffectorParam(JASDsp::TChannel*, u16*,
JASOscillator::EffectParams const&);
/* 8029AF78 */ static void dspUpdateCallback(u32, JASDsp::TChannel*, void*);
/* 8029B004 */ void initialUpdateDSPChannel(JASDsp::TChannel*);
/* 8029B324 */ void updateDSPChannel(JASDsp::TChannel*);
/* 8029B6A0 */ void updateAutoMixer(JASDsp::TChannel*, f32, f32, f32, f32);
/* 8029B7D8 */ void updateMixer(f32, f32, f32, f32, u16*);
/* 8029BBFC */ void free();
/* 8029BC0C */ static void initBankDisposeMsgQueue();
/* 8029BC48 */ static void receiveBankDisposeMsg();
/* 8029BCC0 */ void checkBankDispose() const;
void setPauseFlag(bool param_0) { mPauseFlag = param_0; }
void setUpdateTimer(u32 param_0) { mUpdateTimer = param_0; }
void setBankDisposeID(const void* param_0) { mBankDisposeID = param_0; }
void setDirectRelease(u16 param_0) { field_0x1c[0].setDirectRelease(param_0); }
void setVibrate(f32 param_0, f32 param_1) {
mVibrate.setDepth(param_0);
mVibrate.setPitch(param_1);
}
void setVibrateDelay(u16 param_0) { mVibrate.setDelay(param_0); }
void setTremolo(f32 param_0, f32 param_1) {
mTremolo.setDepth(param_0);
mTremolo.setPitch(param_1);
}
void setTremoloDelay(u16 param_0) { mTremolo.setDelay(param_0); }
void setPriority(u16 param_0) { mPriority = param_0; }
void setParams(const JASChannelParams& param_0) { mParams = param_0; }
void setInitVolume(f32 param_0) { field_0xb4.mVolume = param_0; }
void setInitFxmix(f32 param_0) { field_0xb4.mFxMix = param_0; }
void setInitPitch(f32 param_0) { field_0xb4.mPitch = param_0; }
void setInitPan(f32 param_0) { field_0xb4.mPan = param_0; }
void setInitDolby(f32 param_0) { field_0xb4.mDolby = param_0; }
void setKey(s32 param_0) { mKey = param_0; }
void setVelocity(u32 param_0) { mVelocity = param_0; }
void setSkipSamples(u32 param_0) { mSkipSamples = param_0; }
/* 0x00 */ int mStatus;
/* 0x04 */ bool mPauseFlag;
/* 0x08 */ JASDSPChannel* mDspCh;
/* 0x0C */ void* field_0xc;
/* 0x10 */ void* field_0x10;
/* 0x14 */ u32 mUpdateTimer;
/* 0x18 */ const void* mBankDisposeID;
/* 0x1C */ JASOscillator field_0x1c[2];
/* 0x5C */ JASLfo mVibrate;
/* 0x74 */ JASLfo mTremolo;
/* 0x8C */ u16 field_0x8c[6];
/* 0x98 */ short mPriority;
/* 0x9C */ JASChannelParams mParams;
/* 0xB4 */ JASSoundParams field_0xb4;
/* 0xC8 */ s16 mKey;
/* 0xCA */ u16 mVelocity;
/* 0xCC */ f32 field_0xcc;
/* 0xD0 */ f32 field_0xd0;
/* 0xD4 */ u32 field_0xd4;
/* 0xD8 */ u32 mSkipSamples;
struct {
u32 field_0x0;
JASWaveInfo field_0x4;
} field_0xdc;
int field_0x104;
static OSMessageQueue sBankDisposeMsgQ;
static OSMessage sBankDisposeMsg[16];
static u32 sBankDisposeList[16];
static u32 sBankDisposeListSize;
};
#endif /* JASCHANNEL_H */
+7 -3
View File
@@ -9,6 +9,10 @@ struct JASLfo {
/* 8029BDD8 */ void incCounter(f32);
/* 8029BE2C */ void resetCounter();
void setDepth(f32 param_0) { mDepth = param_0; }
void setPitch(f32 param_0) { mPitch = param_0; }
void setDelay(u16 param_0) { mDelay = param_0; }
static void updateFreeRun(f32 param_0) { sFreeRunLfo.incCounter(param_0); }
static JASLfo sFreeRunLfo;
@@ -16,9 +20,9 @@ struct JASLfo {
/* 0x00 */ u32 field_0x0;
/* 0x04 */ u32 field_0x4;
/* 0x08 */ f32 field_0x8;
/* 0x0C */ f32 field_0xC;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ u16 field_0x14;
/* 0x0C */ f32 mDepth;
/* 0x10 */ f32 mPitch;
/* 0x14 */ u16 mDelay;
/* 0x16 */ u16 field_0x16;
};
+7 -4
View File
@@ -6,12 +6,14 @@
struct JASOscillator {
struct Point {};
struct EffectParams {};
struct Data {
/* 0x00 */ u32 _00;
/* 0x04 */ f32 _04;
/* 0x08 */ short* _08;
/* 0x0C */ short* _0C;
/* 0x08 */ const short* _08;
/* 0x0C */ const short* _0C;
/* 0x10 */ f32 _10;
/* 0x14 */ f32 _14;
};
@@ -25,6 +27,7 @@ struct JASOscillator {
void update();
void updateCurrentValue(f32 param_0);
void setDirectRelease(u16 param_0) { mDirectRelease = param_0; }
void stop() {
_1C = 0;
}
@@ -35,7 +38,7 @@ struct JASOscillator {
/* 0x0C */ f32 _0C;
/* 0x10 */ f32 _10;
/* 0x14 */ u16 _14;
/* 0x16 */ u16 _16;
/* 0x16 */ u16 mDirectRelease;
/* 0x18 */ u8 _18;
/* 0x1A */ u16 _1A;
/* 0x1C */ int _1C;
+12 -1
View File
@@ -1,6 +1,17 @@
#ifndef JASVOICEBANK_H
#define JASVOICEBANK_H
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASBank.h"
#include "JSystem/JAudio2/JASOscillator.h"
class JASVoiceBank : public JASBank {
public:
/* 80297F74 */ virtual bool getInstParam(int, int, int, JASInstParam*) const;
/* 80297FAC */ virtual ~JASVoiceBank();
/* 80298008 */ virtual u32 getType() const;
static const JASOscillator::Data sOscData;
static JASOscillator::Data* sOscTable;
};
#endif /* JASVOICEBANK_H */
+7 -2
View File
@@ -4,10 +4,15 @@
#include "dolphin/types.h"
struct JASWaveInfo {
JASWaveInfo() {
field_0x01 = 0x3c;
field_0x20 = one;
}
/* 0x00 */ u8 field_0x00;
/* 0x01 */ u8 field_0x01;
/* 0x02 */ u8 field_0x02;
/* 0x04 */ int field_0x04;
/* 0x04 */ f32 field_0x04;
/* 0x08 */ int field_0x08;
/* 0x0C */ int field_0x0c;
/* 0x10 */ u32 field_0x10;
@@ -15,7 +20,7 @@ struct JASWaveInfo {
/* 0x18 */ int field_0x18;
/* 0x1C */ s16 field_0x1c;
/* 0x1E */ s16 field_0x1e;
/* 0x20 */ void* field_0x20;
/* 0x20 */ const void* field_0x20;
static u32 one[1 + 1 /* padding */];
};
+30 -1
View File
@@ -1,6 +1,35 @@
#ifndef JAUSEQCOLLECTION_H
#define JAUSEQCOLLECTION_H
#include "dolphin/types.h"
#include "JSystem/JAudio2/JAISeqDataMgr.h"
class JAISeqData;
class JAISeqDataRegion;
class JAUSeqCollection {
public:
/* 802A66A0 */ JAUSeqCollection();
/* 802A66AC */ void init(void const*);
/* 802A66FC */ bool getSeqData(int, int, JAISeqData*);
/* 802A6754 */ void getSeqDataRegion(JAISeqDataRegion*);
bool isValid() { return field_0x8; }
/* 0x00 */ u16 field_0x0;
/* 0x04 */ const u32* field_0x4;
/* 0x08 */ const void* field_0x8;
/* 0x0C */ int field_0xc;
};
class JAUSeqDataMgr_SeqCollection : JAISeqDataMgr, JAUSeqCollection {
public:
/* 802A677C */ JAUSeqDataMgr_SeqCollection();
/* 802A67D0 */ bool setSeqDataUser(JAISeqDataUser*);
/* 802A67DC */ int releaseSeqData();
/* 802A683C */ s32 getSeqData(JAISoundID, JAISeqData*);
/* 802A6894 */ ~JAUSeqDataMgr_SeqCollection();
/* 0x14 */ JAISeqDataUser* user_;
};
#endif /* JAUSEQCOLLECTION_H */