VABinauralSoundSource.cpp 1.05 KB
Newer Older
1 2 3
#include "VABinauralSoundSource.h"


Lucas Moesch's avatar
WIP  
Lucas Moesch committed
4
VABinauralSoundSource::VABinauralSoundSource(const config_t& conf) :
5
	conf( conf )
Lucas Moesch's avatar
WIP  
Lucas Moesch committed
6
{
7 8
	vdlChL = new CITAVariableDelayLine(conf.sampleRate, conf.blockLength, 3. * conf.sampleRate, CITAVariableDelayLine::SWITCH);
	vdlChR = new CITAVariableDelayLine(conf.sampleRate, conf.blockLength, 3. * conf.sampleRate, CITAVariableDelayLine::SWITCH);
Lucas Moesch's avatar
WIP  
Lucas Moesch committed
9
}
10 11 12 13 14 15 16 17 18


VABinauralSoundSource::~VABinauralSoundSource()
{
}

void
VABinauralSoundSource::PreRequest()
{
Lucas Moesch's avatar
WIP  
Lucas Moesch committed
19
	CVABasicMotionModel::Config sourceMotionConf;
20

21 22 23 24 25
	sourceMotionConf.bLogEstimatedOutputEnabled = conf.motionModelLogEstimated;
	sourceMotionConf.bLogInputEnabled = conf.motionModelLogInput;
	sourceMotionConf.dWindowDelay = conf.motionModelWindowDelay;
	sourceMotionConf.dWindowSize = conf.motionModelWindowSize;
	sourceMotionConf.iNumHistoryKeys = conf.motionModelNumHistoryKeys;
26

Lucas Moesch's avatar
WIP  
Lucas Moesch committed
27
	motionModel = new CVASharedMotionModel(new CVABasicMotionModel(sourceMotionConf), true);
28
	state = nullptr;
29
	data = nullptr;
30
	hasValidTrajectory = false;
31 32 33 34 35 36 37
}

void
VABinauralSoundSource::PreRelease()
{
	delete motionModel;
}