Files
tp/include/Z2AudioLib/Z2SoundHandles.h
T

41 lines
1.1 KiB
C++
Raw Normal View History

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