VABinauralListener.cpp 1013 Bytes
Newer Older
1 2 3
#include "VABinauralListener.h"


4 5 6 7 8 9 10
VABinauralListener::VABinauralListener(const CVACoreImpl* core, const config_t& conf)
	: _core(core),
	  _conf(conf)
{};


VABinauralListener::~VABinauralListener()
11 12 13
{
}

14 15 16 17
void
VABinauralListener::PreRequest()
{
	CVABasicMotionModel::Config listenerMotionConf;
18

19 20 21 22 23 24
	listenerMotionConf.bLogEstimatedOutputEnabled = _conf.motionModelLogEstimated;
	listenerMotionConf.bLogInputEnabled = _conf.motionModelLogInput;
	listenerMotionConf.dWindowDelay = _conf.motionModelWindowDelay;
	listenerMotionConf.dWindowSize = _conf.motionModelWindowSize;
	listenerMotionConf.iNumHistoryKeys = _conf.motionModelNumHistoryKeys;

25
	output = new ITASampleFrame(
26 27 28 29 30 31
		2,
		_core->GetCoreConfig()->oAudioDriverConfig.iBuffersize,
		true
	);

	motionModel = new CVASharedMotionModel(new CVABasicMotionModel(listenerMotionConf), true);
32 33 34
	
	// TODO: load HRTF from some kind of config
	toaEstimator = new VABinauralTOAEstimator();
35 36 37 38 39
	data = nullptr;
}

void
VABinauralListener::PreRelease()
40
{
41
	delete motionModel;
42
}