#include "xaudioreverbsettings.h"

XAudioReverbSettings::XAudioReverbSettings()
    : XAsset()
    , mPresetOverridden(0)
    , mReverbSettings(new XReverbSettings())
{
    SetName("Audio Reverb Settings");
}

void XAudioReverbSettings::Clear()
{
    mPresetOverridden = 0;
    mReverbSettings->Clear();
}

int XAudioReverbSettings::GetPresetOverridden() const
{
    return mPresetOverridden;
}

XReverbSettings* XAudioReverbSettings::GetReverbSettings() const
{
    return mReverbSettings;
}

void XAudioReverbSettings::ParseData(XDataStream *aStream)
{
    if (GetPtr())
    {
        mPresetOverridden = aStream->ParseInt32(QString("%1 preset overidden").arg(GetName()));

        if (mReverbSettings != nullptr)
        {
            mReverbSettings->ParseData(aStream);
        }
    }
}

void XAudioReverbSettings::SetPresetOverridden(int aPresetOveridden)
{
    mPresetOverridden = aPresetOveridden;
}

void XAudioReverbSettings::SetReverbSettings(XReverbSettings* aReverbSettings)
{
    mReverbSettings = aReverbSettings;
}
