[go: up one dir, main page]

Menu

[r221]: / Include / sn / Sound3D.h  Maximize  Restore  History

Download this file

108 lines (74 with data), 2.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
// 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