2012-03-17 09:45:18 +00:00
|
|
|
#ifndef GAME_SOUND_SOUND_H
|
|
|
|
#define GAME_SOUND_SOUND_H
|
|
|
|
|
2012-03-30 13:41:06 +00:00
|
|
|
#include <OgreVector3.h>
|
|
|
|
|
2012-08-09 12:33:21 +00:00
|
|
|
#include "soundmanagerimp.hpp"
|
2012-07-16 19:54:04 +00:00
|
|
|
|
2012-03-17 09:45:18 +00:00
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class Sound
|
|
|
|
{
|
2012-03-30 14:01:37 +00:00
|
|
|
virtual void update() = 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:
|
2012-03-30 13:41:06 +00:00
|
|
|
Ogre::Vector3 mPos;
|
2012-03-28 11:58:47 +00:00
|
|
|
float mVolume; /* NOTE: Real volume = mVolume*mBaseVolume */
|
|
|
|
float mBaseVolume;
|
2012-03-31 17:41:12 +00:00
|
|
|
float mPitch;
|
2012-03-28 11:58:47 +00:00
|
|
|
float mMinDistance;
|
|
|
|
float mMaxDistance;
|
2012-03-31 15:14:39 +00:00
|
|
|
int mFlags;
|
2012-03-28 11:58:47 +00:00
|
|
|
|
2012-03-17 09:45:18 +00:00
|
|
|
public:
|
2012-03-28 13:08:25 +00:00
|
|
|
virtual void stop() = 0;
|
|
|
|
virtual bool isPlaying() = 0;
|
2012-12-13 00:50:35 +00:00
|
|
|
virtual double getTimeOffset() = 0;
|
2012-03-31 08:34:26 +00:00
|
|
|
void setPosition(const Ogre::Vector3 &pos) { mPos = pos; }
|
2012-03-30 14:10:34 +00:00
|
|
|
void setVolume(float volume) { mVolume = volume; }
|
2012-03-28 13:08:25 +00:00
|
|
|
|
2012-03-30 13:41:06 +00:00
|
|
|
Sound() : mPos(0.0f, 0.0f, 0.0f)
|
|
|
|
, mVolume(1.0f)
|
2012-03-28 11:58:47 +00:00
|
|
|
, mBaseVolume(1.0f)
|
2012-03-31 17:41:12 +00:00
|
|
|
, mPitch(1.0f)
|
2012-03-28 11:58:47 +00:00
|
|
|
, mMinDistance(20.0f) /* 1 * min_range_scale */
|
|
|
|
, mMaxDistance(12750.0f) /* 255 * max_range_scale */
|
2012-08-09 12:33:21 +00:00
|
|
|
, mFlags(MWBase::SoundManager::Play_Normal)
|
2012-03-28 11:58:47 +00:00
|
|
|
{ }
|
2012-03-17 09:45:18 +00:00
|
|
|
virtual ~Sound() { }
|
|
|
|
|
|
|
|
friend class OpenAL_Output;
|
|
|
|
friend class SoundManager;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|