VABinauralRealTimeRenderer.h 2.05 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 20 21
{
public:
	VABinauralRealTimeRenderer( const CVAAudioRendererInitParams& );
	virtual ~VABinauralRealTimeRenderer();

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

	void processStream( const ITAStreamInfo* pStreamInfo );

26
	void updateScene( CVASceneState* newSceneState );
27 28 29 30 31

	// Resets the renderer to it's initial state
	void reset();

	// Returns the renderers output stream datasource
32
	// ITADatasource* GetOutputDatasource();
33 34

private:
35
	const CVAAudioRendererInitParams _params;
36 37 38 39 40 41 42

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

	VABinauralClusterEngine _clusterEngine;

	CVACoreImpl* _core;
43 44 45
	
	CVASceneState* _newSceneState;
	CVASceneState* _curSceneState;
46 47 48 49
	
	IVAObjectPool* _sourcePool;
	IVAObjectPool* _listenerPool;

50
	ITAAtomicBool _indicateReset, _resetAck;
51 52 53 54

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

55
//	CVABFFUpdateMessage* _updateMessage;
Lucas Moesch's avatar
WIP  
Lucas Moesch committed
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
	int _defaultVDLSwitchingAlgorithm;
	int _hrirFilterLength;
	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 );
81 82 83 84
};


#endif // IW_VACORE_BINAURALREALTIMERENDERER