2025-08-14 17:30:25 -04:00
|
|
|
#include "xsoundfileref.h"
|
2025-09-07 12:36:08 -04:00
|
|
|
#include "xsoundfile.h"
|
2025-08-14 17:30:25 -04:00
|
|
|
|
2025-09-05 18:35:17 -04:00
|
|
|
XSoundFileRef::XSoundFileRef()
|
|
|
|
|
: XAsset()
|
2025-09-07 12:36:08 -04:00
|
|
|
, mParent()
|
|
|
|
|
, mLoadedSnd()
|
|
|
|
|
, mStreamSnd()
|
|
|
|
|
{
|
2025-09-10 21:58:26 -04:00
|
|
|
SetName("Sound File Reference");
|
2025-09-07 12:36:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XSoundFileRef::XSoundFileRef(XSoundFile &aParent)
|
|
|
|
|
: XAsset()
|
|
|
|
|
, mParent(&aParent)
|
|
|
|
|
, mLoadedSnd()
|
2025-09-05 18:35:17 -04:00
|
|
|
, mStreamSnd()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
XSoundFileRef::~XSoundFileRef()
|
|
|
|
|
{
|
2025-09-07 12:36:08 -04:00
|
|
|
|
2025-09-05 18:35:17 -04:00
|
|
|
}
|
|
|
|
|
|
2025-09-10 21:58:26 -04:00
|
|
|
void XSoundFileRef::ParseData(XDataStream *aStream)
|
2025-09-05 18:35:17 -04:00
|
|
|
{
|
2025-09-07 12:36:08 -04:00
|
|
|
if (mParent->GetSoundType() == 1)
|
|
|
|
|
{
|
|
|
|
|
mLoadedSnd.ParsePtr(aStream);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
mStreamSnd.ParseData(aStream);
|
|
|
|
|
}
|
2025-09-05 18:35:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void XSoundFileRef::Clear()
|
|
|
|
|
{
|
|
|
|
|
mStreamSnd.Clear();
|
|
|
|
|
}
|