VABinauralRealTimeRenderer.h 2.3 KB
Newer Older
1 2 3
#ifndef IW_VACORE_BINAURALREALTIMERENDERER
#define IW_VACORE_BINAURALREALTIMERENDERER

4
// VA Includes
5 6 7 8 9 10
#include <VA.h>
#include "../../VAAudioRenderer.h"

// ITA includes
#include <ITADataSourceRealization.h>

11 12 13 14 15
// Other
#include "./Utils/BinauralClusterEngine/VABinauralClusterEngine.h"
#include "./Utils/BinauralSoundSource/VABinauralSoundSource.h"
#include "./Utils/BinauralListener/VABinauralListener.h"

Lucas Moesch's avatar
WIP  
Lucas Moesch committed
16
class VABinauralRealTimeRenderer : public IVAAudioRenderer, public CVAObject, public ITADatasourceRealization
17 18 19
{
public:
	VABinauralRealTimeRenderer( const CVAAudioRendererInitParams& );
20
	~VABinauralRealTimeRenderer();
21

22 23
	inline void 
	LoadScene( const std::string& ) {};
24

25 26
	void 
	ProcessStream( const ITAStreamInfo* pStreamInfo );
27

28 29
	void 
	UpdateScene( CVASceneState* newSceneState );
30 31

	// Resets the renderer to it's initial state
32 33
	void 
	Reset();
34 35

	// Returns the renderers output stream datasource
36
	// ITADatasource* GetOutputDatasource();
37

38 39 40 41 42 43 44 45
	void UpdateGlobalAuralizationMode(int iGlobalAuralizationMode);

	ITADatasource*
	GetOutputDatasource();

	CVAStruct 
	CallObject(const CVAStruct& oArgs);

46
private:
47
	const CVAAudioRendererInitParams _params;
48 49 50 51

	std::map< int, VABinauralSoundSource* > _sources;	
	std::map< int, VABinauralListener* > _listeners;

52
	VABinauralClusterEngine* _clusterEngine;
53 54

	CVACoreImpl* _core;
55 56 57
	
	CVASceneState* _newSceneState;
	CVASceneState* _curSceneState;
58 59 60 61
	
	IVAObjectPool* _sourcePool;
	IVAObjectPool* _listenerPool;

62
	ITAAtomicBool _indicateReset, _resetAck;
63 64 65 66

	VABinauralListener::config_t _defaultListenerConf; //!< Default listener config for factory object creation
	VABinauralSoundSource::config_t _defaultSourceConf;

67
//	CVABFFUpdateMessage* _updateMessage;
Lucas Moesch's avatar
WIP  
Lucas Moesch committed
68

69 70
	int _defaultVDLSwitchingAlgorithm;
	int _hrirFilterLength;
71
	int _curGlobalAuralizationMode;
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
	double _additionalStaticDelaySeconds;

	void
	init( const CVAStruct& oArgs );

	void
	updateListeners( CVASceneStateDiff* diff );

	void
	updateSources( CVASceneStateDiff* diff );

	void
	createListener( const int listenerID, const CVAReceiverState* receiverState );

	void
	createSource( const int sourceID, const CVASoundSourceState* sourceState );

	void
	deleteListener( const int listenerID );

	void
	deleteSource( const int sourceID );
Lucas Moesch's avatar
wip  
Lucas Moesch committed
94 95 96 97 98 99

	void
	updateMotionStates();

	void
	updateTrajectories(double time);
100 101 102 103
};


#endif // IW_VACORE_BINAURALREALTIMERENDERER