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

XSoundFileRef::XSoundFileRef()
    : XAsset()
    , mParent()
    , mLoadedSnd()
    , mStreamSnd()
{

}

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

}

XSoundFileRef::~XSoundFileRef()
{

}

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

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