Files
tp/include/Z2AudioLib/Z2SoundHandles.h
T

46 lines
1.3 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
2025-03-22 02:03:43 -04:00
class Z2SoundHandlePool : public JAISoundHandle, public JSULink<Z2SoundHandlePool>, public JASPoolAllocObject<Z2SoundHandlePool> {
public:
Z2SoundHandlePool() : JAISoundHandle(), JSULink<Z2SoundHandlePool>(this) {}
};
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 stopSound(JAISoundID soundID, u32 param_1) {
JAISoundHandle* phandle = getHandleSoundID(soundID);
if (phandle != NULL) {
(*phandle)->stop(param_1);
}
}
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 */