1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 10:49:57 +00:00
openmw-tes3mp/apps/openmw/mwsound/sound_output.hpp

60 lines
1.9 KiB
C++
Raw Normal View History

#ifndef GAME_SOUND_SOUND_OUTPUT_H
#define GAME_SOUND_SOUND_OUTPUT_H
#include <string>
2012-03-17 09:55:08 +00:00
#include <memory>
#include "soundmanagerimp.hpp"
2012-03-17 13:51:44 +00:00
#include "../mwworld/ptr.hpp"
namespace MWSound
{
class SoundManager;
struct Sound_Decoder;
2012-03-17 09:55:08 +00:00
class Sound;
class Sound_Output
{
SoundManager &mManager;
virtual std::vector<std::string> enumerate() = 0;
2012-03-18 19:19:54 +00:00
virtual void init(const std::string &devname="") = 0;
virtual void deinit() = 0;
/// @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.
2015-05-12 17:02:56 +00:00
virtual MWBase::SoundPtr playSound3D(const std::string &fname, const osg::Vec3f &pos,
float vol, float basevol, float pitch, float min, float max, int flags, float offset, bool extractLoudness=false) = 0;
virtual MWBase::SoundPtr streamSound(DecoderPtr decoder, float volume, float pitch, int flags) = 0;
2012-03-17 09:55:08 +00:00
2015-05-12 17:02:56 +00:00
virtual void updateListener(const osg::Vec3f &pos, const osg::Vec3f &atdir, const osg::Vec3f &updir, Environment env) = 0;
virtual void pauseSounds(int types) = 0;
virtual void resumeSounds(int types) = 0;
Sound_Output& operator=(const Sound_Output &rhs);
Sound_Output(const Sound_Output &rhs);
protected:
bool mInitialized;
2015-05-12 17:02:56 +00:00
osg::Vec3f mPos;
Sound_Output(SoundManager &mgr)
: mManager(mgr)
, mInitialized(false)
, mPos(0.0f, 0.0f, 0.0f)
{ }
public:
virtual ~Sound_Output() { }
2012-06-06 18:29:30 +00:00
bool isInitialized() const { return mInitialized; }
friend class OpenAL_Output;
friend class SoundManager;
};
}
#endif