// Filename: audio/SoundManager.h
// Author: Jorge Bernadas (JB)
// Date of Creation: 12/07/2006
// Version: 1.0
//
// TODO(): Add general comment here!
#ifndef BASE_AUDIO_SOUND_H__
#define BASE_AUDIO_SOUND_H__

#include "../../al/al.h"
#include "../../al/alc.h"
#include "../../al/alut.h"

#pragma comment(lib, "lib/OpenAl32.lib")
#pragma comment(lib, "lib/Alut.lib")

class Sound {
public:
  Sound();
  virtual ~Sound();

  // methods to create and destroy the sound
  bool Create(const char* filename);
  void Destroy();

  // methods to set the sound position
  void SetPosition(float x, float y, float z);

  // methods to play the sound
  void Play(bool rewindIfPlaying, bool loop);

protected:
  bool IsSoundLoaded() const;
  static bool LoadWaveFile(const char* filename, ALuint buffer);

private:
  ALuint buffer_;
  ALuint source_;
};

#endif  // BASE_AUDIO_SOUND_H__
