#pragma once

#include "IAudioInterface.h"
#include "AudioDevice.h"

#include <memory>
#include <vector>

class AudioSample;

class AudioManager
{

public:
    AudioManager();

    ~AudioManager();

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

    void addAudioDevice(AudioDevicePtr device);

    std::size_t getNumAudioDevices() const;

    AudioDevice* getAudioDevice(unsigned idx) const;

    void play(AudioSample* sample, unsigned duration);

private:
    std::vector<AudioDevicePtr> mAudioDevices;
    IAudioInterfacePtr mAudioInterface;
};

using AudioManagerUPtr = std::unique_ptr<AudioManager>;
