Files
tp/include/JSystem/JAudio2/JAISeMgr.h
T

140 lines
4.2 KiB
C++
Raw Normal View History

2021-03-28 22:49:05 +02:00
#ifndef JAISEMGR_H
#define JAISEMGR_H
2023-07-18 22:57:25 -07:00
#include "JSystem/JAudio2/JAISe.h"
2023-05-12 12:10:14 -07:00
#include "global.h"
struct JAIAudience;
struct JASSoundParams;
2021-03-28 22:49:05 +02:00
2024-04-12 00:10:30 -06:00
/**
* @ingroup jsystem-jaudio
*
*/
2021-09-30 07:13:49 -07:00
struct JASNonCopyable {
JASNonCopyable() {}
2021-09-30 07:13:49 -07:00
/* 0x0 */ int field_0x0;
}; // Size: 0x4
2024-04-12 00:10:30 -06:00
/**
* @ingroup jsystem-jaudio
*
*/
2023-07-12 10:59:33 +03:00
struct JAISeCategoryArrangementItem {
u8 mMaxActiveSe;
u8 mMaxInactiveSe;
};
2024-04-12 00:10:30 -06:00
/**
* @ingroup jsystem-jaudio
*
*/
2023-07-12 10:59:33 +03:00
struct JAISeCategoryArrangement {
JAISeCategoryArrangementItem mItems[16];
};
2021-09-30 07:13:49 -07:00
class JAISeMgr;
2024-04-12 00:10:30 -06:00
/**
* @ingroup jsystem-jaudio
*
*/
class JAISeCategoryMgr : public JAISeqDataUser, public JASNonCopyable {
2021-09-30 07:13:49 -07:00
public:
/* 8029F9C4 */ void JAISeMgr_calc_();
/* 8029FB30 */ void JAISeMgr_freeDeadSe_();
/* 8029FC88 */ bool JAISeMgr_acceptsNewSe_(u32 priority) const;
2021-09-30 07:13:49 -07:00
/* 8029FD40 */ void sortByPriority_();
/* 8029FDE0 */ void stop(u32 fadeTime);
2021-09-30 07:13:49 -07:00
/* 8029FE34 */ void stop();
/* 8029FE78 */ void stopSoundID(JAISoundID id);
2021-09-30 07:13:49 -07:00
/* 8029FEEC */ void pause(bool);
/* 8029FF18 */ void JAISeMgr_mixOut_(const JAISoundParamsMove& params, JAISoundActivity activity);
2025-03-22 02:03:43 -04:00
/* 802A0994 */ JAISeCategoryMgr() {
mParams.init();
mMaxActiveSe = 0;
mMaxInactiveSe = 0;
field_0x0 = 0;
2025-03-22 02:03:43 -04:00
}
2021-09-30 07:13:49 -07:00
/* 8029F8B0 */ virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);
/* 8029F91C */ virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion);
2021-09-30 07:13:49 -07:00
2022-12-19 11:06:32 -08:00
JAISoundParamsMove* getParams() { return &mParams; }
2023-07-12 10:59:33 +03:00
int getMaxSe() const {
if (mMaxActiveSe == 0) {
return 0;
}
return mMaxActiveSe + mMaxInactiveSe;
2023-07-12 10:59:33 +03:00
}
int getMaxActiveSe() const { return mMaxActiveSe; }
void setMaxActiveSe(int num) { mMaxActiveSe = num; }
void setMaxInactiveSe(int num) { mMaxInactiveSe = num; }
const JSUList<JAISe>* getSeList() const { return &mSeList; }
2023-07-12 10:59:33 +03:00
int getNumSe() const { return mSeList.getNumLinks(); }
JAIAudience* getAudience() { return (JAIAudience*)field_0x0; }
2024-10-23 19:25:13 -04:00
void JAISeMgr_appendSe_(JAISe* se) { mSeList.append(se); }
2022-12-19 11:06:32 -08:00
2021-09-30 07:13:49 -07:00
/* 0x08 */ JAISoundParamsMove mParams;
/* 0x58 */ JSUList<JAISe> mSeList;
/* 0x64 */ int mMaxInactiveSe;
/* 0x68 */ int mMaxActiveSe;
}; // Size: 0x6C
2024-04-12 00:10:30 -06:00
/**
* @ingroup jsystem-jaudio
*
*/
2023-07-12 10:59:33 +03:00
class JAISeMgr : public JASGlobalInstance<JAISeMgr>,
public JAISeqDataUser,
public JAISoundActivity {
2021-09-30 07:13:49 -07:00
public:
/* 802A0074 */ JAISeMgr(bool setInstance);
/* 802A0268 */ void setCategoryArrangement(const JAISeCategoryArrangement& arrangement);
2021-09-30 07:13:49 -07:00
/* 802A02A0 */ void stop();
/* 802A02F4 */ void stopSoundID(JAISoundID id);
2021-09-30 07:13:49 -07:00
/* 802A0358 */ void initParams();
/* 802A03D8 */ void setAudience(JAIAudience* audience);
/* 802A03E0 */ void setSeqDataMgr(JAISeqDataMgr* seqDataMgr);
2021-09-30 07:13:49 -07:00
/* 802A0434 */ void resetSeqDataMgr();
/* 802A0484 */ JAISe* newSe_(int category, u32 priority);
2021-09-30 07:13:49 -07:00
/* 802A0574 */ void calc();
/* 802A0704 */ void mixOut();
/* 802A0768 */ bool startSound(JAISoundID id, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr);
2023-07-12 10:59:33 +03:00
/* 802A08D0 */ int getNumActiveSe() const;
2021-09-30 07:13:49 -07:00
/* 802A0168 */ virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);
/* 802A01D8 */ virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion);
2021-09-30 07:13:49 -07:00
JAISeCategoryMgr* getCategory(int index) { return &mCategoryMgrs[index]; }
JAIAudience* getAudience() { return mAudience; }
JAIAudience* getAudience(int index) {
if (index >= 0 && index < NUM_CATEGORIES) {
JAIAudience* rv = mCategoryMgrs[index].getAudience();
2023-07-12 10:59:33 +03:00
if (rv) return rv;
}
return mAudience;
}
2023-07-18 22:57:25 -07:00
JAISeqDataMgr* getSeqDataMgr() { return mSeqDataMgr; }
2023-09-15 05:20:09 -07:00
JAISoundParamsMove* getParams() { return &mParams; }
2022-12-19 11:06:32 -08:00
bool isActive() const { return getNumActiveSe() > 0; }
static const int NUM_CATEGORIES = 16;
2021-09-30 07:13:49 -07:00
private:
/* 0x008 */ JAIAudience* mAudience;
/* 0x00C */ JAISeqDataMgr* mSeqDataMgr;
2024-10-23 19:25:13 -04:00
/* 0x010 */ JAISoundStrategyMgr<JAISe>* mStrategyMgr;
/* 0x014 */ JAISeCategoryMgr mCategoryMgrs[NUM_CATEGORIES];
2021-09-30 07:13:49 -07:00
/* 0x6D4 */ JAISoundParamsMove mParams;
}; // Size: 0x724
#if VERSION != VERSION_SHIELD_DEBUG
2021-09-30 07:13:49 -07:00
STATIC_ASSERT(sizeof(JAISeMgr) == 0x724);
#endif
2021-09-30 07:13:49 -07:00
2021-03-28 22:49:05 +02:00
#endif /* JAISEMGR_H */