OpenMW
|
00001 #ifndef GAME_SOUND_SOUND_OUTPUT_H 00002 #define GAME_SOUND_SOUND_OUTPUT_H 00003 00004 #include <string> 00005 #include <memory> 00006 00007 #include <OgreVector3.h> 00008 00009 #include "soundmanagerimp.hpp" 00010 00011 #include "../mwworld/ptr.hpp" 00012 00013 namespace MWSound 00014 { 00015 class SoundManager; 00016 class Sound_Decoder; 00017 class Sound; 00018 00019 class Sound_Output 00020 { 00021 SoundManager &mManager; 00022 00023 virtual std::vector<std::string> enumerate() = 0; 00024 virtual void init(const std::string &devname="") = 0; 00025 virtual void deinit() = 0; 00026 00028 virtual MWBase::SoundPtr playSound(const std::string &fname, float vol, float basevol, float pitch, int flags, float offset) = 0; 00030 virtual MWBase::SoundPtr playSound3D(const std::string &fname, const Ogre::Vector3 &pos, 00031 float vol, float basevol, float pitch, float min, float max, int flags, float offset) = 0; 00032 virtual MWBase::SoundPtr streamSound(DecoderPtr decoder, float volume, float pitch, int flags) = 0; 00033 00034 virtual void updateListener(const Ogre::Vector3 &pos, const Ogre::Vector3 &atdir, const Ogre::Vector3 &updir, Environment env) = 0; 00035 00036 virtual void pauseSounds(int types) = 0; 00037 virtual void resumeSounds(int types) = 0; 00038 00039 Sound_Output& operator=(const Sound_Output &rhs); 00040 Sound_Output(const Sound_Output &rhs); 00041 00042 protected: 00043 bool mInitialized; 00044 Ogre::Vector3 mPos; 00045 00046 Sound_Output(SoundManager &mgr) 00047 : mManager(mgr) 00048 , mInitialized(false) 00049 , mPos(0.0f, 0.0f, 0.0f) 00050 { } 00051 public: 00052 virtual ~Sound_Output() { } 00053 00054 bool isInitialized() const { return mInitialized; } 00055 00056 friend class OpenAL_Output; 00057 friend class SoundManager; 00058 }; 00059 } 00060 00061 #endif