VABinauralOutdoorWaveFront.h 2.25 KB
Newer Older
1 2 3 4 5 6 7 8
#ifndef IW_VACORE_BINAURAL_OUTDOOR_WAVE_FRONT
#define IW_VACORE_BINAURAL_OUTDOOR_WAVE_FRONT

// VA includes
#include <VA.h>
#include <VAPoolObject.h>

#include "../Clustering/WaveFront/VABinauralWaveFront.h"
henryjandrew's avatar
wip  
henryjandrew committed
9 10
#include <ITAThirdOctaveMagnitudeSpectrum.h>

11 12 13 14 15 16 17

// Forwards
class CVASoundSourceState;
class CVASoundSourceDesc;
class CVASharedMotionModel;
class CITAVariableDelayLine;
class ITASampleBuffer;
henryjandrew's avatar
wip  
henryjandrew committed
18
class CVABinauralOutdoorSource;
19 20 21 22 23 24 25 26 27

//! Represents a wave front emitted from a sound source for an outdoor scenario
/**
  * @henry: The implementation of this class is not nice (yet), but focus on the DSP output and leave it as is.
  */
class CVABinauralOutdoorWaveFront : public IVABinauralWaveFront, public CVAPoolObject
{
public:

henryjandrew's avatar
wip  
henryjandrew committed
28 29 30 31
	CVABinauralOutdoorSource* pSource;

	int iCursorID;

32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
	bool hasValidTrajectory;
	const CVABinauralWaveFrontBase::Config oConf;

	CVASoundSourceState* pState;
	CVASoundSourceDesc* pData;
	CVASharedMotionModel* pMotionModel;

	VAVec3 m_v3PredictedClusteringPos;
	VAVec3 m_v3PredictedClusteringView;
	VAVec3 m_v3PredictedClusteringUp;

	VAVec3 v3PredictedPos;
	VAVec3 predView; // @todo jst: appears to be useless in the context of clustering, confirm
	VAVec3 predUp; // @todo jst: appears to be useless in the context of clustering, confirm

	CVABinauralOutdoorWaveFront( const CVABinauralWaveFrontBase::Config& conf );
	~CVABinauralOutdoorWaveFront();

	void PreRequest();
	void PreRelease();

	void GetOutput( ITASampleBuffer* pfLeftChannel, ITASampleBuffer* pfRightChannel );
	void SetClusteringPose( const VAVec3& v3Pos, const VAVec3& v3View, const VAVec3& v3Up );
henryjandrew's avatar
wip  
henryjandrew committed
55 56

	void setParameters( const CVAStruct &oInArgs );
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
	
	virtual bool GetValidTrajectory() const
	{
		return hasValidTrajectory;
	};

	inline VAVec3 GetPosition()
	{
		return v3PredictedPos;
	};

	virtual inline int AddReference()
	{
		return CVAPoolObject::AddReference();
	};

	virtual inline int RemoveReference()
	{
		return CVAPoolObject::RemoveReference();
	};

private:
	double m_dCreationTimeStamp;
	CITAVariableDelayLine* vdlChL; // Substitute with SIMO VDL (must be extended with a non-interpolating output)
	CITAVariableDelayLine* vdlChR; // Remove, use eparate  SIMO VDL cursor for L/R channels
henryjandrew's avatar
wip  
henryjandrew committed
82 83

	ITABase::CThirdOctaveGainMagnitudeSpectrum fMags;
84 85 86
};

#endif // IW_VACORE_BINAURAL_OUTDOOR_WAVE_FRONT