Files
tp/include/Z2AudioLib/Z2SoundHandles.h
T
randomsalience b13ff9e3d0 Z2SoundObject, JAUSoundAnimator OK, work on Z2SoundHandles (#1968)
* d_a_tag_evtarea mostly done, work on d_a_npc

* work on d_a_npc_ash

* work on Z2SoundHandles

* Z2SoundObject, JAUSoundAnimator OK

* Update Progress.md

---------

Co-authored-by: randomsalience <randomsalience@gmail.com>
2023-10-26 15:41:03 +03:00

42 lines
1.2 KiB
C++

#ifndef Z2SOUNDHANDLES_H
#define Z2SOUNDHANDLES_H
#include "JSystem/JAudio2/JAISoundHandles.h"
#include "JSystem/JSupport/JSUList.h"
#include "JSystem/JAudio2/JASHeapCtrl.h"
#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();
JAISoundHandle* getFreeHandle();
JAISoundHandle* getLowPrioSound(JAISoundID pSoundId);
bool isActive() const;
JAISoundHandle* getHandleSoundID(JAISoundID pSoundId);
JAISoundHandle* getHandleUserData(u32 pUserData);
void stopAllSounds(u32 fadeout);
void setPos(const JGeometry::TVec3<f32>& pos);
int getNumHandles() const { return getNumLinks(); }
JAISoundHandle* getHandle(int index) { return (Z2SoundHandlePool*)getNth(index); }
private:
/* 0xC */ u8 mNumHandles;
};
#endif /* Z2SOUNDHANDLES_H */