#include "AudioSample.h"

AudioSample::AudioSample()
{

}

std::unique_ptr<AudioSample> AudioSample::Create()
{
    return std::make_unique<AudioSample>();
}

std::size_t AudioSample::GetNumChannels() const
{
    return mData.size();
}

unsigned AudioSample::GetSampleRate() const
{
    return mSampleRate;
}

unsigned AudioSample::GetBitDepth() const
{
    return mBitDepth;
}

void AudioSample::SetChannelData(const std::vector<short>& data, std::size_t channel)
{
    if (mData.size() == channel)
    {
        mData.push_back(data);
    }
    else if(mData.size() > channel)
    {
        mData[channel] = data;
    }
}

std::vector<short> AudioSample::GetChannelData(std::size_t channel) const
{
    if(mData.size() > channel)
    {
        return mData[channel];
    }
    return std::vector<short>();
}
