#pragma once

#include <memory>
#include <string>

class AudioDevice
{

public:
    AudioDevice();

    ~AudioDevice();

    static std::unique_ptr<AudioDevice> Create();

    unsigned getSampleRate() const;

    unsigned getNumChannels() const;

    unsigned getPeriod() const;

    std::size_t getBufferSize() const;

    bool getIsOpen() const;

    std::string getName() const;

    void setName(const std::string& name);

    void setNumChannels(unsigned numChannels);

    void setPeriod(unsigned period);

    void setBufferSize(std::size_t bufferSize);

    void setSampleRate(unsigned rate);

    void setIsOpen(bool isOpen);
private:
    std::string mName {"unset"};
    unsigned mSampleRate {44100};
    unsigned mNumChannels {1};
    unsigned mPeriod {2};
    std::size_t mBufferSize{0};
    bool mIsOpen{false};
};

using AudioDevicePtr = std::unique_ptr<AudioDevice>;
