71 lines
1 KiB
C++
71 lines
1 KiB
C++
#include "AudioDevice.h"
|
|
|
|
AudioDevice::AudioDevice()
|
|
: mName("plughw:1,0"),
|
|
mSampleRate(44100),
|
|
mNumChannels(2),
|
|
mPeriod(2),
|
|
mBufferSize()
|
|
{
|
|
|
|
}
|
|
|
|
AudioDevice::~AudioDevice()
|
|
{
|
|
|
|
}
|
|
|
|
std::unique_ptr<AudioDevice> AudioDevice::Create()
|
|
{
|
|
return std::make_unique<AudioDevice>();
|
|
}
|
|
|
|
void AudioDevice::SetNumChannels(unsigned numChannels)
|
|
{
|
|
mNumChannels = numChannels;
|
|
}
|
|
|
|
void AudioDevice::SetPeriod(unsigned period)
|
|
{
|
|
mPeriod = period;
|
|
}
|
|
|
|
void AudioDevice::SetBufferSize(std::size_t bufferSize)
|
|
{
|
|
mBufferSize = bufferSize;
|
|
}
|
|
|
|
unsigned AudioDevice::GetNumChannels() const
|
|
{
|
|
return mNumChannels;
|
|
}
|
|
|
|
unsigned AudioDevice::GetPeriod() const
|
|
{
|
|
return mPeriod;
|
|
}
|
|
|
|
std::size_t AudioDevice::GetBufferSize() const
|
|
{
|
|
return mBufferSize;
|
|
}
|
|
|
|
void AudioDevice::SetSampleRate(unsigned rate)
|
|
{
|
|
mSampleRate = rate;
|
|
}
|
|
|
|
unsigned AudioDevice::GetSampleRate() const
|
|
{
|
|
return mSampleRate;
|
|
}
|
|
|
|
void AudioDevice::SetName(const std::string& name)
|
|
{
|
|
mName = name;
|
|
}
|
|
|
|
std::string AudioDevice::GetName() const
|
|
{
|
|
return mName;
|
|
}
|