#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 ChannelData& data, std::size_t channel)
{
    if (mData.size() == channel)
    {
        mData.push_back(data);
    }
    else if(mData.size() > channel)
    {
        mData[channel] = data;
    }
}

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