// File name: Sound3D.h
// Des: This is a 3d sound node.
// Date: 15/2/1387
// Programmers: Pooya Shahinfar (Pswin), Ali Akbar Mohammadi (Kochol)
#ifndef KGE_SOUND3D_H
#define KGE_SOUND3D_H
#include "SceneNode.h"
#include "../av/Structs.h"
#include "../av/SoundBuffer.h"
namespace kge
{
namespace sn
{
//! 3D Sound node.
class KGE_API Sound3D : public SceneNode
{
public:
//! Constructor
Sound3D();
//! Destructor
~Sound3D();
//! Recalculate the sound position.
void PreRender();
//! Nothing to do.
void Render() { /* Nothing to do */ }
//! Nothing to do.
void PostRender() { /* Nothing to do */ }
//! Nothing to do
bool AddEffect ( efx::EffectType p, efx::Effect** ppOut ) { return false; }
//! Nothing to do
void Draw( bool WithMaterial , bool WithTransform, bool bPosition , bool bNormalTexcoord , bool bTangentBinormal ) { /* Nothing to do */ }
//! Set the position of the sound.
void SetPosition(math::Vector v);
//! Set sound source velocity
void SetVelocity(math::Vector velocity);
//! Get sound source velocity
math::Vector GetVelocity();
//! Set the sound source voulome
void SetVolume (float value, av::SourceVolumeFactor factor = av::SVF_GAIN);
//! Get the sound source voulome
float GetVolume (av::SourceVolumeFactor factor = av::SVF_GAIN);
// sorate pakhshe manbae
void SetPitch(float value);
float GetPitch();
//parametr haye mohasebe gain nesbat be fasle manbae az shenavande
float GetDistanceFactor (av::SourceDistanceFactor factor );
void SetDistanceFactor (av::SourceDistanceFactor factor, float value);
//! Set loop
void SetLoop(bool looping);
//! Get loop
bool GetLoop();
// vaziate manbae
av::SourceStates GetState();
//! Attach a buffer from source.
void AttachBuffer(av::SoundBuffer* buffer);
//! Attach a buffer from a file.
void AttachFromFile(char* filename);
// Remove a buffer from source.
//void RemoveBuffer(av::SoundBuffer* buffer);
// bool AttachBufferQueue (); "in the next reversion"
// noe manbae (static,streaming...)
av::SourceType GetSoundType();
// pakhshe seda az manbae
void Play();
// makse pakhshe seda
void Pause();
// iste pakhshe seda
void Stop();
protected:
u32 Source;
}; // Sound3D
} // sn
} // kge
#endif // KGE_SOUND3D_H