2012-03-17 09:45:18 +00:00
|
|
|
#ifndef GAME_SOUND_SOUND_H
|
|
|
|
#define GAME_SOUND_SOUND_H
|
|
|
|
|
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class Sound
|
|
|
|
{
|
2012-03-18 19:03:15 +00:00
|
|
|
virtual void stop() = 0;
|
2012-03-17 09:45:18 +00:00
|
|
|
virtual bool isPlaying() = 0;
|
2012-03-28 12:19:35 +00:00
|
|
|
virtual void setVolume(float volume) = 0;
|
2012-03-18 19:03:15 +00:00
|
|
|
virtual void update(const float *pos) = 0;
|
2012-03-17 09:45:18 +00:00
|
|
|
|
2012-03-24 10:49:03 +00:00
|
|
|
Sound& operator=(const Sound &rhs);
|
|
|
|
Sound(const Sound &rhs);
|
|
|
|
|
2012-03-28 11:58:47 +00:00
|
|
|
protected:
|
|
|
|
float mVolume; /* NOTE: Real volume = mVolume*mBaseVolume */
|
|
|
|
float mBaseVolume;
|
|
|
|
float mMinDistance;
|
|
|
|
float mMaxDistance;
|
|
|
|
|
2012-03-17 09:45:18 +00:00
|
|
|
public:
|
2012-03-28 11:58:47 +00:00
|
|
|
Sound() : mVolume(1.0f)
|
|
|
|
, mBaseVolume(1.0f)
|
|
|
|
, mMinDistance(20.0f) /* 1 * min_range_scale */
|
|
|
|
, mMaxDistance(12750.0f) /* 255 * max_range_scale */
|
|
|
|
{ }
|
2012-03-17 09:45:18 +00:00
|
|
|
virtual ~Sound() { }
|
|
|
|
|
|
|
|
friend class OpenAL_Output;
|
|
|
|
friend class SoundManager;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|