Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members

IAudioDevice.hpp

Go to the documentation of this file.
00001 // Copyright (c) 2007-2008 Tomer Nosrati
00002 // This file is part of the "NUSoftware Game Engine".
00003 // For conditions of distribution and use, see copyright notice in nge.hpp
00004 
00005 #pragma once
00006 #ifndef __I_AUDIO_DEVICE_H__
00007 #define __I_AUDIO_DEVICE_H__
00008 
00009 #include "Irrlicht/irrlicht.h"
00010 #include "IPlayedSound.hpp"
00011 #include "ISoundObj.hpp"
00012 
00013 using namespace irr;
00014 
00015 namespace nge
00016 {
00017         namespace audio
00018         {
00019 
00020                 enum E_AUDIO_DEVICE {EAD_NULL, EAD_IRRKLANG};
00021 
00022                 class IAudioDevice : public virtual IReferenceCounted
00023                 {
00024                 public:
00026                         virtual ~IAudioDevice();
00027 
00028                         virtual E_AUDIO_DEVICE getAudioDeviceType() = 0;
00029 
00031                         virtual const char* getVersion() = 0;
00032 
00034                         virtual const char* getDriverName() = 0;
00035 
00038                         virtual IPlayedSound* play2D(const c8* soundFileName, 
00039                                 bool playLooped = false,
00040                                 bool startPaused = false,
00041                                 bool enableSoundEffects = false) = 0;
00042 
00045                         virtual IPlayedSound* play2D(ISoundObj* source, 
00046                                 bool playLooped = false,
00047                                 bool startPaused = false,
00048                                 bool enableSoundEffects = false) = 0;
00049 
00052                         virtual IPlayedSound* play3D(const c8* soundFileName, vector3df pos,
00053                                 bool playLooped = false, 
00054                                 bool startPaused = false,
00055                                 bool enableSoundEffects = false) = 0;
00056 
00059                         virtual IPlayedSound* play3D(ISoundObj* source, vector3df pos,
00060                                 bool playLooped = false, 
00061                                 bool startPaused = false,
00062                                 bool enableSoundEffects = false) = 0;
00063 
00065                         virtual void stopAllSounds() = 0;
00066 
00068                         virtual void setAllSoundsPaused(bool bPaused = true) = 0;
00069 
00071                         virtual ISoundObj* getSoundObj(const c8* soundName, bool addIfNotFound=true) = 0;
00072 
00073                         virtual ISoundObj* getSoundObj(s32 index) = 0;
00074 
00075                         virtual s32 getSoundObjCount() = 0;
00076 
00077                         virtual ISoundObj* addSoundObjFromFile(const c8* fileName,  bool preload=false) = 0;
00078 
00079                         virtual ISoundObj* addSoundObjFromMemory(void* memory, s32 sizeInBytes, const c8* soundName,
00080                                 bool copyMemory=true) = 0;
00081 
00082                         virtual void removeSoundObj(ISoundObj* source) = 0;
00083 
00084                         virtual void removeSoundObj(const c8* name) = 0;
00085 
00086                         virtual void removeAllSoundObjs() = 0;
00087 
00088                         virtual void setSoundVolume(f32 volume) = 0;
00089 
00090                         virtual f32 getSoundVolume() = 0;
00091 
00092                         virtual void setListenerPosition(const vector3df& pos,
00093                                 const vector3df& lookdir,
00094                                 const vector3df& velPerSecond = vector3df(0,0,0),
00095                                 const vector3df& upVector = vector3df(0,1,0)) = 0;
00096 
00097                         virtual void update() = 0;
00098 
00099                         virtual bool isCurrentlyPlaying(const c8* soundName) = 0;
00100 
00101                         virtual bool isCurrentlyPlaying(ISoundObj* source) = 0;
00102 
00103                         virtual void setDefault3DSoundMinDistance(f32 minDistance) = 0;
00104 
00105                         virtual f32 getDefault3DSoundMinDistance() = 0;
00106 
00107                         virtual void setDefault3DSoundMaxDistance(f32 maxDistance) = 0;
00108 
00109                         virtual f32 getDefault3DSoundMaxDistance() = 0;
00110 
00111                         virtual void setRolloffFactor(f32 rolloff) = 0;
00112 
00113                         virtual array<IPlayedSound*>& getAllPlayedSounds()
00114                         {
00115                                 return m_aPlayedSounds;
00116                         }
00117 
00118                         virtual array<ISoundObj*>& getAllSoundObjs()
00119                         {
00120                                 return m_aSoundObjs;
00121                         }
00122 
00123                 protected:
00124                         array<IPlayedSound*> m_aPlayedSounds;
00125                         array<ISoundObj*> m_aSoundObjs;
00126                 };
00127 
00128                 IAudioDevice* createAudioDevice(E_AUDIO_DEVICE AudioDeviceType, ILogger* irrLogger);
00129 
00130         } // namespace audio
00131 } // namespace nge
00132 
00133 #endif // __I_AUDIO_DEVICE_H__

The NUSoftware Game Engine
The NUSoftware Game Engine Documentation © 2007-2008 by Tomer Nosrati. Generated on Sat Apr 26 16:52:34 2008 by Doxygen (1.5.5)