2021-03-28 22:49:05 +02:00
|
|
|
#ifndef Z2SOUNDHANDLES_H
|
|
|
|
|
#define Z2SOUNDHANDLES_H
|
|
|
|
|
|
2023-05-12 12:10:14 -07:00
|
|
|
#include "JSystem/JAudio2/JAISoundHandles.h"
|
2021-05-23 03:09:59 -07:00
|
|
|
#include "JSystem/JSupport/JSUList.h"
|
2023-10-26 08:41:03 -04:00
|
|
|
#include "JSystem/JAudio2/JASHeapCtrl.h"
|
2021-03-28 22:49:05 +02:00
|
|
|
#include "dolphin/types.h"
|
|
|
|
|
|
2023-10-26 08:41:03 -04:00
|
|
|
class Z2SoundHandlePool : public JAISoundHandle, public JSULink<Z2SoundHandlePool> { // , public JASPoolAllocObject<Z2SoundHandlePool> {
|
|
|
|
|
public:
|
|
|
|
|
Z2SoundHandlePool() : JAISoundHandle(), JSULink<Z2SoundHandlePool>(this) {}
|
|
|
|
|
~Z2SoundHandlePool() {}
|
|
|
|
|
};
|
2021-05-23 03:09:59 -07:00
|
|
|
|
|
|
|
|
class Z2SoundHandles : protected JSUList<Z2SoundHandlePool> {
|
|
|
|
|
public:
|
|
|
|
|
Z2SoundHandles();
|
|
|
|
|
~Z2SoundHandles();
|
|
|
|
|
|
|
|
|
|
void initHandlesPool(u8 pNumHandles);
|
|
|
|
|
void deleteHandlesPool();
|
2023-10-26 08:41:03 -04:00
|
|
|
JAISoundHandle* getFreeHandle();
|
|
|
|
|
JAISoundHandle* getLowPrioSound(JAISoundID pSoundId);
|
2021-05-23 03:09:59 -07:00
|
|
|
|
|
|
|
|
bool isActive() const;
|
|
|
|
|
|
|
|
|
|
JAISoundHandle* getHandleSoundID(JAISoundID pSoundId);
|
|
|
|
|
JAISoundHandle* getHandleUserData(u32 pUserData);
|
|
|
|
|
|
|
|
|
|
void stopAllSounds(u32 fadeout);
|
|
|
|
|
|
|
|
|
|
void setPos(const JGeometry::TVec3<f32>& pos);
|
|
|
|
|
|
2023-10-26 08:41:03 -04:00
|
|
|
int getNumHandles() const { return getNumLinks(); }
|
|
|
|
|
JAISoundHandle* getHandle(int index) { return (Z2SoundHandlePool*)getNth(index); }
|
2021-05-23 03:09:59 -07:00
|
|
|
|
|
|
|
|
private:
|
2022-12-19 11:06:32 -08:00
|
|
|
/* 0xC */ u8 mNumHandles;
|
2021-05-23 03:09:59 -07:00
|
|
|
};
|
|
|
|
|
|
2021-03-28 22:49:05 +02:00
|
|
|
#endif /* Z2SOUNDHANDLES_H */
|