/****************************************************************************

   FILE: audioenv.h

   DESCRIPTION: header for audio environment class

****************************************************************************/


#include <stdio.h>
#include <math.h>
#include <AL/al.h>
#include <AL/alut.h>
//#include <strstream>
#include <sstream>

#if !defined (AUDIOENV)
#define AUDIOENV

#define LINUX
//#define MACOS
//#define WINDOWS

/*
#ifdef    Q_OS_LINUX
  #define LINUX
#endif

#ifdef    Q_OS_MACX
  #define MACOS
#endif

#ifdef    Q_OS_WIN32
  #define WINDOWS
#endif
*/
class AudioEnv
{
private:
   ALuint buffer[512];
   ALuint source[512];
   ALuint nextBuffer, nextSource;
   unsigned int EAXlevel;
public:
   AudioEnv ();
   ~AudioEnv ();
   void Init ();
   void ListenerPosition (float c[4][4] );
   void UpdateObstruction (int);
   int LoadFile (char *, bool);
   int PlayFile (char *, bool);
   void SetSourcePosition (int, float *);
   void SetSourceVelocity (int, float *);
   void SetSourceGain (int handle, float gain);
   void Play (int);
   void Stop (int);
   void Loop(int , int);
   void Relative(int , int);
   int  IsPlaying(int);

   int IncrementEnv();
};

typedef AudioEnv * AudioEnvPtr;

#endif // AUDIOENV

