#include "xsoundfileref.h"
#include "xsoundfile.h"

XSoundFileRef::XSoundFileRef()
    : XAsset()
    , mParent()
    , mLoadedSnd()
    , mStreamSnd()
{
    SetName("Sound File Reference");
}

XSoundFileRef::XSoundFileRef(XSoundFile &aParent)
    : XAsset()
    , mParent(&aParent)
    , mLoadedSnd()
    , mStreamSnd()
{

}

XSoundFileRef::~XSoundFileRef()
{

}

void XSoundFileRef::ParseData(XDataStream *aStream)
{
    if (mParent->GetSoundType() == 1)
    {
        mLoadedSnd.ParsePtr(aStream);
    }
    else
    {
        mStreamSnd.ParseData(aStream);
    }
}

void XSoundFileRef::Clear()
{
    mStreamSnd.Clear();
}
