2012-03-17 02:45:18 -07:00
|
|
|
#ifndef GAME_SOUND_SOUND_H
|
|
|
|
#define GAME_SOUND_SOUND_H
|
|
|
|
|
2012-03-30 06:41:06 -07:00
|
|
|
#include <OgreVector3.h>
|
|
|
|
|
2012-08-09 14:33:21 +02:00
|
|
|
#include "soundmanagerimp.hpp"
|
2012-07-16 23:54:04 +04:00
|
|
|
|
2012-03-17 02:45:18 -07:00
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class Sound
|
|
|
|
{
|
2012-03-30 07:01:37 -07:00
|
|
|
virtual void update() = 0;
|
2012-03-17 02:45:18 -07:00
|
|
|
|
2012-03-24 03:49:03 -07:00
|
|
|
Sound& operator=(const Sound &rhs);
|
|
|
|
Sound(const Sound &rhs);
|
|
|
|
|
2012-03-28 04:58:47 -07:00
|
|
|
protected:
|
2012-03-30 06:41:06 -07:00
|
|
|
Ogre::Vector3 mPos;
|
2012-03-28 04:58:47 -07:00
|
|
|
float mVolume; /* NOTE: Real volume = mVolume*mBaseVolume */
|
|
|
|
float mBaseVolume;
|
2012-03-31 10:41:12 -07:00
|
|
|
float mPitch;
|
2012-03-28 04:58:47 -07:00
|
|
|
float mMinDistance;
|
|
|
|
float mMaxDistance;
|
2012-03-31 08:14:39 -07:00
|
|
|
int mFlags;
|
2012-03-28 04:58:47 -07:00
|
|
|
|
2012-03-17 02:45:18 -07:00
|
|
|
public:
|
2012-03-28 06:08:25 -07:00
|
|
|
virtual void stop() = 0;
|
|
|
|
virtual bool isPlaying() = 0;
|
2012-12-12 16:50:35 -08:00
|
|
|
virtual double getTimeOffset() = 0;
|
2012-03-31 01:34:26 -07:00
|
|
|
void setPosition(const Ogre::Vector3 &pos) { mPos = pos; }
|
2012-03-30 07:10:34 -07:00
|
|
|
void setVolume(float volume) { mVolume = volume; }
|
2012-03-28 06:08:25 -07:00
|
|
|
|
2012-12-18 02:01:04 -08:00
|
|
|
MWBase::SoundManager::PlayType getPlayType() const
|
|
|
|
{ return (MWBase::SoundManager::PlayType)(mFlags&MWBase::SoundManager::Play_TypeMask); }
|
|
|
|
|
|
|
|
|
2012-12-17 23:35:20 -08:00
|
|
|
Sound(const Ogre::Vector3& pos, float vol, float basevol, float pitch, float mindist, float maxdist, int flags)
|
|
|
|
: mPos(pos)
|
|
|
|
, mVolume(vol)
|
|
|
|
, mBaseVolume(basevol)
|
|
|
|
, mPitch(pitch)
|
|
|
|
, mMinDistance(mindist)
|
|
|
|
, mMaxDistance(maxdist)
|
|
|
|
, mFlags(flags)
|
2012-03-28 04:58:47 -07:00
|
|
|
{ }
|
2012-03-17 02:45:18 -07:00
|
|
|
virtual ~Sound() { }
|
|
|
|
|
|
|
|
friend class OpenAL_Output;
|
|
|
|
friend class SoundManager;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|