#include "xaudiochannelmapentry.h"

XAudioChannelMapEntry::XAudioChannelMapEntry()
    : XAsset()
    , mInputChannel(0)
    , mOutputChannel(0)
    , mVolume(0.0)
{
    
}

XAudioChannelMapEntry::~XAudioChannelMapEntry()
{
    
}

quint8 XAudioChannelMapEntry::GetInputChannel() const
{
    return mInputChannel;
}

void XAudioChannelMapEntry::SetInputChannel(quint8 aInputChannel)
{
    mInputChannel = aInputChannel;
}

quint8 XAudioChannelMapEntry::GetOutputChannel() const
{
    return mOutputChannel;
}

void XAudioChannelMapEntry::SetOutputChannel(quint8 aOutputChannel)
{
    mOutputChannel = aOutputChannel;
}

float XAudioChannelMapEntry::GetVolume() const
{
    return mVolume;
}

void XAudioChannelMapEntry::SetVolume(float aVolume)
{
    mVolume = aVolume;
}

void XAudioChannelMapEntry::ParseData(QDataStream *aStream)
{
    *aStream
        >> mInputChannel
        >> mOutputChannel;

    // Skip padding bytes in struct
    aStream->skipRawData(2);

    *aStream >> mVolume;
}

void XAudioChannelMapEntry::Clear()
{
    mInputChannel = 0;
    mOutputChannel = 0;
    mVolume = 0.0;
}
