#pragma once

#include "blitz/common/NonCopyable.h"
#include "blitz/maths/Vector.h"
#include "client/audio/AudioBuffer.h"
#include <memory>

namespace blitz {
namespace audio {

typedef std::unique_ptr<AudioBuffer> AudioBufferPtr;

class AudioSource : NonCopyable {
  private:
	unsigned int m_ID;
	AudioBufferPtr m_Buffer;

  public:
	enum SourceState { ssInitial = 0, ssPlaying, ssPaused, ssStopped };

	AudioSource();
	~AudioSource();

	void SetGain(float a_Gain);
	void SetPitch(float a_Pitch);
	void SetPosition(const Vec3f& a_Position);
	void SetDirection(const Vec3f& a_Direction);
	void SetVelocity(const Vec3f& a_Velocity);
	void SetLooping(bool a_Looping);
	void SetBuffer(AudioBufferPtr&& a_Buffer);

	SourceState GetSourceState() const;

	void Play();
	void Pause();
	void Stop();
};

typedef std::unique_ptr<AudioSource> AudioSourcePtr;

}  // namespace audio
}  // namespace blitz
