Go to the documentation of this file.00001 #ifndef __NYTRO_SoundSource_H
00002 #define __NYTRO_SoundSource_H
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "system/nyCommon.h"
00012 #include "system/nyResource.h"
00013 #include "math/nyMath.h"
00014 #include "scene/nySceneNode.h"
00015
00016 namespace Nytro
00017 {
00018 namespace Audio
00019 {
00020 using namespace Core;
00021 using namespace Scene;
00022
00024 class NYTRO_API SoundBufferData : public Resource
00025 {
00026 public:
00027
00028 SoundBufferData();
00029 virtual ~SoundBufferData();
00030 };
00031
00034 class NYTRO_API SoundSource : public SceneNode
00035 {
00036 public:
00037
00039 enum ESoundMode
00040 {
00041 eSoundMode_2D = 0,
00042 eSoundMode_3D
00043 };
00044
00046 enum ESoundLoopMode
00047 {
00048 eSoundLoop_Off = 0,
00049 eSoundLoop_Repeat
00050 };
00051
00052 SoundSource();
00053 virtual ~SoundSource();
00054
00055
00056
00057
00058 virtual void playSound();
00059 virtual void stopSound();
00060 virtual void pauseSound();
00061 virtual void resumeSound();
00062
00063
00064
00065
00066 virtual void setVolume( float32 aValue );
00067 virtual void setTime( uint32 aValue );
00068 virtual void setFrequency( uint32 aValue );
00070 virtual void setPan( float32 aValue );
00071 virtual void setLoopMode( ESoundLoopMode aValue );
00072 virtual void setPitch( float32 aValue );
00073 virtual void setVelocity( const Vector3D& rVel );
00074 virtual void setPriority( int32 aValue );
00075 virtual void setMinSoundDistance( float32 aValue );
00076 virtual void setMaxSoundDistance( float32 aValue );
00077 virtual void setSoundMode( ESoundMode aMode );
00078
00079
00080
00081
00082 virtual float32 getVolume();
00083 virtual uint32 getTime();
00084 virtual uint32 getLength();
00085 virtual uint32 getFrequency();
00086 virtual void getOutputLevels( float32& rLeft, float32& rRight );
00087 virtual float32 getPitch();
00088 virtual float32 getPan();
00089 virtual const Vector3D& getVelocity();
00090 virtual int32 getPriority();
00091 virtual bool isPaused();
00092 virtual bool isPlaying();
00093 virtual float32 getMinSoundDistance();
00094 virtual float32 getMaxSoundDistance();
00095 virtual ESoundMode getSoundMode();
00096 virtual ESoundLoopMode getLoopMode();
00097
00098 protected:
00099
00101 Vector3D m_soundVelocity;
00103 ESoundMode m_soundMode;
00105 ESoundLoopMode m_soundLoopMode;
00107 int32 m_soundPriority;
00109 float32 m_minSoundDistance, m_maxSoundDistance;
00110 float32 m_volume, m_pitch, m_pan;
00111
00112 };
00113 };
00114 };
00115
00116 #endif