2012-03-17 06:40:07 +00:00
|
|
|
#ifndef GAME_SOUND_SOUND_OUTPUT_H
|
|
|
|
#define GAME_SOUND_SOUND_OUTPUT_H
|
|
|
|
|
|
|
|
#include <string>
|
2012-03-17 09:55:08 +00:00
|
|
|
#include <memory>
|
2012-03-17 06:40:07 +00:00
|
|
|
|
2012-03-30 14:30:17 +00:00
|
|
|
#include <OgreVector3.h>
|
|
|
|
|
2012-08-09 12:33:21 +00:00
|
|
|
#include "soundmanagerimp.hpp"
|
2012-03-27 12:59:09 +00:00
|
|
|
|
2012-03-17 13:51:44 +00:00
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2012-03-17 06:40:07 +00:00
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class SoundManager;
|
2012-03-17 09:55:08 +00:00
|
|
|
class Sound_Decoder;
|
|
|
|
class Sound;
|
2012-03-17 06:40:07 +00:00
|
|
|
|
|
|
|
class Sound_Output
|
|
|
|
{
|
2012-03-18 18:30:53 +00:00
|
|
|
SoundManager &mManager;
|
2012-03-17 06:40:07 +00:00
|
|
|
|
2012-03-22 03:15:01 +00:00
|
|
|
virtual std::vector<std::string> enumerate() = 0;
|
2012-03-18 19:19:54 +00:00
|
|
|
virtual void init(const std::string &devname="") = 0;
|
2012-03-18 18:30:53 +00:00
|
|
|
virtual void deinit() = 0;
|
2012-03-17 06:40:07 +00:00
|
|
|
|
2013-07-26 16:43:06 +00:00
|
|
|
/// @param offset Value from [0,1] meaning from which fraction the sound the playback starts.
|
|
|
|
virtual MWBase::SoundPtr playSound(const std::string &fname, float vol, float basevol, float pitch, int flags, float offset) = 0;
|
|
|
|
/// @param offset Value from [0,1] meaning from which fraction the sound the playback starts.
|
2012-08-09 12:33:21 +00:00
|
|
|
virtual MWBase::SoundPtr playSound3D(const std::string &fname, const Ogre::Vector3 &pos,
|
2013-07-26 16:43:06 +00:00
|
|
|
float vol, float basevol, float pitch, float min, float max, int flags, float offset) = 0;
|
2012-12-13 06:32:02 +00:00
|
|
|
virtual MWBase::SoundPtr streamSound(DecoderPtr decoder, float volume, float pitch, int flags) = 0;
|
2012-03-17 09:55:08 +00:00
|
|
|
|
2012-03-31 17:06:12 +00:00
|
|
|
virtual void updateListener(const Ogre::Vector3 &pos, const Ogre::Vector3 &atdir, const Ogre::Vector3 &updir, Environment env) = 0;
|
2012-03-17 11:22:54 +00:00
|
|
|
|
2012-12-18 12:19:35 +00:00
|
|
|
virtual void pauseSounds(int types) = 0;
|
|
|
|
virtual void resumeSounds(int types) = 0;
|
2012-12-12 10:33:12 +00:00
|
|
|
|
2012-03-24 10:49:03 +00:00
|
|
|
Sound_Output& operator=(const Sound_Output &rhs);
|
|
|
|
Sound_Output(const Sound_Output &rhs);
|
|
|
|
|
2012-03-30 14:30:17 +00:00
|
|
|
protected:
|
2012-04-06 17:43:14 +00:00
|
|
|
bool mInitialized;
|
2012-03-30 14:30:17 +00:00
|
|
|
Ogre::Vector3 mPos;
|
|
|
|
|
|
|
|
Sound_Output(SoundManager &mgr)
|
|
|
|
: mManager(mgr)
|
2012-04-06 17:43:14 +00:00
|
|
|
, mInitialized(false)
|
2012-03-30 14:30:17 +00:00
|
|
|
, mPos(0.0f, 0.0f, 0.0f)
|
|
|
|
{ }
|
2012-03-17 06:40:07 +00:00
|
|
|
public:
|
|
|
|
virtual ~Sound_Output() { }
|
|
|
|
|
2012-06-06 18:29:30 +00:00
|
|
|
bool isInitialized() const { return mInitialized; }
|
2012-04-06 17:43:14 +00:00
|
|
|
|
2012-03-17 06:40:07 +00:00
|
|
|
friend class OpenAL_Output;
|
|
|
|
friend class SoundManager;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|