Files
ss/include/nw4r/snd/snd_SoundHandle.h
T
elijah-thomas774 fa9a9ce949 lyt_common match
2024-05-12 20:23:22 -04:00

43 lines
885 B
C++

#ifndef NW4R_SND_SOUND_HANDLE_H
#define NW4R_SND_SOUND_HANDLE_H
#include "common.h"
#include "snd_BasicSound.h"
namespace nw4r {
namespace snd {
struct SoundHandle {
detail::BasicSound *mSound; // at 0x0
void detail_AttachSound(detail::BasicSound *);
void detail_AttachSoundAsTempHandle(detail::BasicSound *);
void DetachSound();
inline SoundHandle() : mSound(NULL) {}
inline ~SoundHandle() {
DetachSound();
}
inline detail::BasicSound *detail_GetAttachedSound() {
return mSound;
}
inline bool IsAttachedSound() const {
return mSound != NULL;
}
inline void StartPrepared() {
if (IsAttachedSound()) {
mSound->StartPrepared();
}
}
inline u32 GetId() const {
return IsAttachedSound() ? mSound->GetId() : -1;
}
};
} // namespace snd
} // namespace nw4r
#endif